alessio Posted March 7, 2008 Share Posted March 7, 2008 hey guys, im quite new to autoit, and i tried to use autoit help already, but nothing has really helped me. well i want to make a script, that looks for a certain colour in a rectangle, and everytime that colour appears, it should make a left click. MouseClick("left", 35, 575, 2, 20) MouseClick("left", 50, 100, 2, 100) Sleep ( 3000 ) MouseClick("left", 282, 370, 1, 30) sleep ( 30000 ) MouseClick("left", 742, 642, 1, 30) sleep ( 2000 ) Mousemove ( 684, 413, 30 ) $i = 0 While $i <= 10 PixelSearch ( 684, 413, 685, 414, 0x583315 ) if Not @error Then MouseClick ( "left" ) $i = $i + 0 EndIf WEnd however it only looks once for that colour and then it stops. or should the script i wrote work? does it work like a loop and repeat itself untill end of time? thanks alot guys. Link to comment Share on other sites More sharing options...
theguy0000 Posted March 7, 2008 Share Posted March 7, 2008 The loop does continue infinitely for me, I don't know what's wrong on your end. However, you are doing some extremely pointless things. First, you don't need to declare $i=0. $i is declared when the loop starts. Second, You are making an infinite loop in a weird way...take away the line $i = $i+0 because that's doing nothing. Second, just use "While 1" to make an infinite loop. While 1 stuff to repeat forever WEnd The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
redhairedfoo Posted March 7, 2008 Share Posted March 7, 2008 the problem is in ur code....You Put:$i = 0While $i <= 10 PixelSearch ( 684, 413, 685, 414, 0x583315 )if Not @error Then MouseClick ( "left" ) $i = $i + 0EndIfWEndIt should be:$i = 0While $i <= 10 PixelSearch ( 684, 413, 685, 414, 0x583315 )if Not @error Then MouseClick ( "left" ) $i = $i + 1EndIfWEnd Link to comment Share on other sites More sharing options...
theguy0000 Posted March 7, 2008 Share Posted March 7, 2008 @redhairedfoo - I believe it was an endless loop he wanted. The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
redhairedfoo Posted March 7, 2008 Share Posted March 7, 2008 oh my bad. sorry. im still trying to get that totally figured out myself... 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