Draegon Posted October 28, 2009 Posted October 28, 2009 Is it possible to click ______ pixel colour then when it changes to ______ pixel colour it does the next line? As in if I tell it to find 0xFF0000 and then click it, now once it changes colour to, lets say 0x8E8660 after a few seconds I need it to do the next line of script, but wait until the pixel 0xFF0000 it found turns into 0x8E8660. Hope you understand and please help!
JohnOne Posted October 28, 2009 Posted October 28, 2009 Look at these loops in the help file "Do Until" "While Wend" Be sure to put a sleep in there too AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Draegon Posted October 28, 2009 Author Posted October 28, 2009 Okay thanks, although how would I get it to wait for X,Y pixel to turn into 0xXXXXXX?
PsaltyDS Posted October 28, 2009 Posted October 28, 2009 Okay thanks, although how would I get it to wait for X,Y pixel to turn into 0xXXXXXX?It won't "wait", you'll have to check it in a loop doing PixelGetColor() until it changes to what you're looking for. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Draegon Posted October 28, 2009 Author Posted October 28, 2009 Like...? while 1 $pixel = PixelSearch (0,0,@DesktopWidth,@DesktopHeight,0xXXXXXX) WEnd Do until
JohnOne Posted October 28, 2009 Posted October 28, 2009 (edited) Do $pixel = PixelSearch (0,0,@DesktopWidth,@DesktopHeight,0xXXXXXX) Sleep(200) Until $pixel = @error That will continue your next bit of script if the colour disappers, or indeed if it not there to begin with. (i think) If you know where the pixel is, you might be better using PixelGetColor Edited October 28, 2009 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Draegon Posted October 28, 2009 Author Posted October 28, 2009 Getting this notice:UntilUntil^ ErrorError: Error in expressionThis happens ever time after I click the pixel. Is this because the pixel does not disappear right away.
JohnOne Posted October 28, 2009 Posted October 28, 2009 Do $pixel = PixelSearch (0,0,@DesktopWidth,@DesktopHeight,0xXXXXXX) Sleep(200) Until $pixel = @error I may have gotten it wrong try it like this AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Draegon Posted October 29, 2009 Author Posted October 29, 2009 it switches to diffrent pixels without waiting for the first one it goes to, to change. Help please?
PsaltyDS Posted October 29, 2009 Posted October 29, 2009 Do $pixel = PixelSearch (0,0,@DesktopWidth,@DesktopHeight,0xXXXXXX) Sleep(200) Until $pixel = @error I may have gotten it wrong try it like this PixelSearch() returns an array. How are you comparing that to @error? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
PsaltyDS Posted October 29, 2009 Posted October 29, 2009 it switches to diffrent pixels without waiting for the first one it goes to, to change. Help please?If by "Help please" you mean "Please write it for me", then NO. But this is a pretty simple exercise for you to learn from. So try again and post the code you are using so far when you ask for help. It shows your work and makes it easier to see where you mistake is. PixelSearch() returns an array with the coordinates of the pixel. After you have that, just loop on PixelGetColor() at those coordinates, until the color changes to something else. That seemed to be what you were looking for before.Get that much working correctly before you try to continue adding things to your script. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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