Nethel Posted February 22, 2004 Posted February 22, 2004 Looked through the help file, it just says that the color commands return the RGB value, I'm sure I'm just missing something as to how to implement this to check the pixel color. If the color is right, I would like the script to proceed, but if its wrong I need to have a 1 second delay to allow it to load. Any suggestions?
Nethel Posted February 22, 2004 Author Posted February 22, 2004 I would also like to know if I can run a loop for a set amount of seconds, and then switch to another infinate loop. PS, here is the code I am using, feel free to do anything with it, its just my newbie attempt at a macro. expandcollapse popupsleep (1500) HotKeySet("{ESC}", "Terminate") While 1 send ("{F2}") sleep (1200) send ("{F5}") sleep (1700) mouseClick ("left", 635, 345, 1) mouseClick ("left", 635, 345, 1) mouseClick ("left", 665, 345, 1) mouseClick ("left", 665, 345, 1) send ("{F1}") sleep (5000) send ("{F3}") sleep (1200) send ("{F5}") sleep (1700) mouseClick ("left", 635, 345, 1) mouseClick ("left", 635, 345, 1) mouseClick ("left", 665, 345, 1) mouseClick ("left", 665, 345, 1) send ("{F1}") sleep (5000) send ("{F4}") sleep (1200) send ("{F5}") sleep (1700) mouseClick ("left", 635, 345, 1) mouseClick ("left", 635, 345, 1) mouseClick ("left", 665, 345, 1) mouseClick ("left", 665, 345, 1) send ("{F1}") sleep (5000) WEnd Func Terminate() Exit EndFunc The two coordinates in there are the ones I would like to check, the color for the first is 495D4B and the second is 000000. Thanks again
Developers Jos Posted February 22, 2004 Developers Posted February 22, 2004 I would also like to know if I can run a loop for a set amount of seconds, and then switch to another infinate loop.$begin = TimerStart() ; first loop will loop for 5 seconds Do ; First loop code ... Until TimerStop($begin) > 5000 ; While 1 ; Endless loop code ........ Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Nethel Posted February 22, 2004 Author Posted February 22, 2004 Thanks much, JdeB it worked perfectly.
GrahamS Posted February 22, 2004 Posted February 22, 2004 Try If "495D4B" = Hex(PixelGetColor(635, 345),6) Then ; do stuff EndIf GrahamS
Nethel Posted February 22, 2004 Author Posted February 22, 2004 Ok, if it doesnt find the pixel, I want it to pause for a second, where should I put that?
Developers Jos Posted February 22, 2004 Developers Posted February 22, 2004 (edited) Ok, if it doesnt find the pixel, I want it to pause for a second, where should I put that? If "495D4B" = Hex(PixelGetColor(635, 345),6) Then ; do stuff Else sleep(1000) EndIf Edited February 22, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
GrahamS Posted February 22, 2004 Posted February 22, 2004 THe following code sleeps for a second at a time until the pixel contains the desired colour. While "495D4B" <> Hex(PixelGetColor(635, 345),6) Sleep(1000) EndIf GrahamS
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