Jostein Posted November 25, 2007 Share Posted November 25, 2007 Was just wondering how i did the While "Not" code, like I want the script to pause when the value im asking for is not true like $value = PixelGetColor(1,1) while $value (were the value is not true) sleep(100) wend MouseMove(12, 765) Sleep(100) MouseDown("left") MouseUp("left") Or if i can do it this way do $randomwait = random(100,500,1) $value = PixelGetColor(1,1) sleep($randomwait) until $value = (the spesefic collor im looking for) MouseMove(12, 765) Sleep(100) MouseDown("left") MouseUp("left") Dont know if im totaly lost here, but Atleast what i want is the script to pause while the pixelgetcolor dont find its true color. Tried lots of different types of doing it, and I havent gotten it to work. And somhow Pixelgetcolor shows up whit the same value, even if the pixel is an different color. Link to comment Share on other sites More sharing options...
Nahuel Posted November 25, 2007 Share Posted November 25, 2007 (edited) Well.. you mean something like this? While Not $Value blah blah Wend -edit- Oops, sorry. That's not what you wanted. Have you tried this? do $randomwait = random(100,500,1);Not really necessary, just use Sleep() $value = PixelGetColor(1,1) sleep($randomwait) until $value = (the spesefic collor im looking for) That should do what you want. Edited November 25, 2007 by Nahuel Link to comment Share on other sites More sharing options...
Generator Posted November 25, 2007 Share Posted November 25, 2007 Was just wondering how i did the While "Not" code, like I want the script to pause when the value im asking for is not true like $value = PixelGetColor(1,1) while $value (were the value is not true) sleep(100) wend MouseMove(12, 765) Sleep(100) MouseDown("left") MouseUp("left") Or if i can do it this way do $randomwait = random(100,500,1) $value = PixelGetColor(1,1) sleep($randomwait) until $value = (the spesefic collor im looking for) MouseMove(12, 765) Sleep(100) MouseDown("left") MouseUp("left") Dont know if im totaly lost here, but Atleast what i want is the script to pause while the pixelgetcolor dont find its true color. Tried lots of different types of doing it, and I havent gotten it to work. And somhow Pixelgetcolor shows up whit the same value, even if the pixel is an different color.Use Sleep(1) Link to comment Share on other sites More sharing options...
Jostein Posted November 25, 2007 Author Share Posted November 25, 2007 issue solved:D this code works. #include "color.au3" HotKeySet("{esc}", "terminate") do $value = PixelGetColor (19, 241) sleep(1) msgbox(2, $value, "Still not the right color", 15) until $value = (16777215) func terminate() Exit EndFunc Link to comment Share on other sites More sharing options...
Jostein Posted November 25, 2007 Author Share Posted November 25, 2007 well Nahuel, I now its not needed. But there is an good reason for it to be there:D Random times is importain for my script. But the (1) is to ofthen, only need a check each sec or 2, and i want the script to act randomly. when it comes to times it uses to perform actions Link to comment Share on other sites More sharing options...
ame1011 Posted November 25, 2007 Share Posted November 25, 2007 (edited) this would also work for you (not tested): #include "color.au3" HotKeySet("{esc}", "terminate") while $value <> 16777215 $value = PixelGetColor (19, 241) sleep(1) msgbox(2, $value, "Still not the right color", 15) wend func terminate() Exit EndFunc <> means 'not equal to' Also, try using Traytips instead of message boxes, personally I feel they get the job done better in most cases as theyre less obtrusive Edited November 25, 2007 by ame1011 [font="Impact"] I always thought dogs laid eggs, and I learned something today. [/font] Link to comment Share on other sites More sharing options...
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