Jump to content
Sign in to follow this  
UnknownWarrior

Do/Until question

Recommended Posts

UnknownWarrior

I have a question relating to the Do/Until Function... if my code this:

$Pixel = PixelGetColor(1, 1)
                While 1
                  Sleep(15000)
                
                
                                Do
                                   $LPixel = $Pixel
                                   $Pixel = PixelGetColor(1, 1)
                                Until $Pixel <> $LPixel
                                     

                
                Send("{F4}")
                Sleep(3000)
                Exit

WEnd

what i want to get out of this is: i want it to wait for the color at 1, 1 to CHANGE, once its CHANGED, i want it to continue on and send f4 and exit the program... but when i run it it sleeps 15 seconds, sends f4, and exits....... it completely skips the Do/Until

any help would be fantabulous, thanks :P

Share this post


Link to post
Share on other sites
muncherw

Try using PixelChecksum to look for a change in your pixel color. instead of your do/until loop.


Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]

Share this post


Link to post
Share on other sites
FreeFry

While 1
Sleep(15000)
$LPixel = PixelGetColor(1, 1)
Do
$Pixel = PixelGetColor(1, 1)
Until $Pixel <> $LPixel
Send("{F4}")
Sleep(3000)
Exit
WEnd

Just removed the variable assignment in your Do Until loop.

Share this post


Link to post
Share on other sites
UnknownWarrior

While 1
Sleep(15000)
$LPixel = PixelGetColor(1, 1)
Do
$Pixel = PixelGetColor(1, 1)
Until $Pixel <> $LPixel
Send("{F4}")
Sleep(3000)
Exit
WEnd

Just removed the variable assignment in your Do Until loop.

EDIT: Works now, i had to leave the LPixel inside my while loop... ill test for further detail, thanks a bunch Edited by UnknownWarrior

Share this post


Link to post
Share on other sites
muncherw

EDIT: Works now, i had to leave the LPixel inside my while loop... ill test for further detail, thanks a bunch

It's good that it's working. In the future when you have something like that you should try throwing in a msgbox set to your variable inside the loop then you could see if it's hitting it or if the loop is set wrong.


Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.