Popeye1 Posted March 2, 2010 Share Posted March 2, 2010 I'm looking to solve an issue in my script, but am not sure where to even look. The script checks an if statement using pixelsearch, if for example 0x000000 is found, then the script needs to store that information and add +1. The script would then continue on and eventually start at the beginning of the master while loop again, and come back round to this pixelsearch if statement and if the colour is still 0x000000 then it needs to add another +1, so if the original value was 0, it would now be 2, and every time the script repeats this cycle and finds 0x000000, it would add another +1. A different section in the script would be checking to see if this number has became 30 or greater (for example) and executing some code if so, aswell as resetting the number back to 0 again. I don't even know where to look in the help file for this, can anyone help? Link to comment Share on other sites More sharing options...
JohnOne Posted March 2, 2010 Share Posted March 2, 2010 Heres a simple way, although I find it quite difficult to believe you searched either the forum of the help file after having said you've written a script. $count = 0 While 1 PixelSearch(0, 0, 10, 10, 0x000000) If @error <> 1 Then $count += 1 If $count >= 30 Then MsgBox(0, "", "Yippeeeee") $count = 0 EndIf EndIf WEnd AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Popeye1 Posted March 2, 2010 Author Share Posted March 2, 2010 Great, that works, thanks. Can I use the message box to display what number $count is currently at? Link to comment Share on other sites More sharing options...
kaotkbliss Posted March 2, 2010 Share Posted March 2, 2010 you can, but you would definately want a timeout on it otherwise you would have to keep clicking ok. MsgBox(0,"Count",$count,5) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Popeye1 Posted March 2, 2010 Author Share Posted March 2, 2010 I'm using a tooltip instead of a messagebox ToolTip(" check xxx", 400, 3) Can this be used to display the number %count is at? Link to comment Share on other sites More sharing options...
kaotkbliss Posted March 2, 2010 Share Posted March 2, 2010 I'm using a tooltip instead of a messageboxToolTip(" check xxx", 400, 3)Can this be used to display the number %count is at?I don't see why notif xxx is your count then it would beToolTip(" check "&$count,400,3) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Bert Posted March 2, 2010 Share Posted March 2, 2010 Sure. Give it a try. Halve the fun of AutoIt is experimenting to see what you can do. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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