poisonkiller Posted October 14, 2005 Posted October 14, 2005 Whats the problem? I have no idea how can i make this work! Plz help! While 1 HotKeySet("^h", "Pixel") Sleep(100) WEnd Func Pixel() $col = "100" Sleep(2000) $pix = PixelSearch(0, 0, 1023, 767, $col) MouseMove($pix[0], $pix[1]) Sleep(500) Exit EndFunc
LxP Posted October 14, 2005 Posted October 14, 2005 (edited) Most likely the "100", which may not be the colour you want (I think it's equivalent to HTML #000064). This should move the mouse to the first white location on the screen:Global $PixelColor = 0xFFFFFF HotkeySet("^h", "Pixel") Func Pixel() Local $PixelLoc = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, $PixelColor) If Not(@Error) Then MouseMove($PixelLoc[0], $PixelLoc[1]) EndFunc While 1 Sleep(0x7FFFFFFF) WEndEdit: I've not played around with the MouseMove() command since its v2 incarnation. It's fantastic how it smoothly moves to the new location with varying speed! Edited October 14, 2005 by LxP
poisonkiller Posted October 14, 2005 Author Posted October 14, 2005 What this : While 1 Sleep(0x7FFFFFFF) WEnd does? Is this sleep 0xFFFFFFF color?
w0uter Posted October 14, 2005 Posted October 14, 2005 0x7FFFFFFF is the longest number autoit can support. wich means that this will get you the lowest cpu usage possible. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
Valik Posted October 14, 2005 Posted October 14, 2005 0x7FFFFFFF is the longest number autoit can support. wich means that this will get you the lowest cpu usage possible.No, the largest possible number AutoIt should be able to support is somewhere around 2^(64-1) or the maximum size of a 64-bit signed integer. The Windows API function Sleep() takes a DWORD which is an unsigned long so with a 32-bit unsigned long the maximum value is actually 0xFFFFFFFF. However, AutoIt doesn't use the Sleep() function directly when AutoIt's Sleep() is called.
LxP Posted October 15, 2005 Posted October 15, 2005 So out of curiosity, why is it that AutoIt can support numbers as large as 9,223,372,036,854,775,807 in decimal notation but will only support numbers as large as 2,147,483,647 in hex notation?
Valik Posted October 15, 2005 Posted October 15, 2005 Primarily because nobody ever expanded the hex notation to support more than 8 characters.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now