GreenReptile Posted December 9, 2008 Share Posted December 9, 2008 (edited) .Solved Edited December 9, 2008 by GreenReptile Link to comment Share on other sites More sharing options...
youknowwho4eva Posted December 9, 2008 Share Posted December 9, 2008 Well for one, what is the point of having If $var=1 then twice? then $var = 0 so after that all the program will do is update $coord also change your while to just while 1 Giggity Link to comment Share on other sites More sharing options...
JSThePatriot Posted December 9, 2008 Share Posted December 9, 2008 (edited) I would try the following code...$var = 1 While 1 $pos = MouseGetPos() $coord = PixelSearch($pos[0], $pos[1], $pos[0], $pos[1], 0x2CFD39) If Not @error Then If $var = 1 Then Send("{a}") Sleep(20) If $var = 1 Then MouseClick('left') Sleep(50) $var = 0 EndIf EndIf Else ExitLoop EndIf WEnd Edit: You may not want the else statement there, but I figure at some point you'll want out of the loop so I put it in there. I hope it helps, Jarvis Edited December 9, 2008 by JSThePatriot AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
youknowwho4eva Posted December 9, 2008 Share Posted December 9, 2008 I would try the following code...$var = 1 While 1 $pos = MouseGetPos() $coord = PixelSearch($pos[0], $pos[1], $pos[0], $pos[1], 0x2CFD39) If Not @error Then If $var = 1 Then Send("{a}") Sleep(20) If $var = 1 Then MouseClick('left') Sleep(50) $var = 0 EndIf EndIf Else ExitLoop EndIf WEnd Edit: You may not want the else statement there, but I figure at some point you'll want out of the loop so I put it in there. I hope it helps, Jarvis Still what is the point of $var = 1 then being there twice? nothing between the first statement and second can change the variable. and it still wont do anything after the first through. Giggity Link to comment Share on other sites More sharing options...
JSThePatriot Posted December 9, 2008 Share Posted December 9, 2008 The reason why it doesn't do both is you're not allowing for the speed of your system. You would need a larger sleep between them. It's just large enough when you add another evaluation in there before performing the remaining options. If you want it to sleep at the end add that right before the WEnd. I hope it helps, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
youknowwho4eva Posted December 9, 2008 Share Posted December 9, 2008 Sorry I was making my post while you were posting yours. so take away the $var = 0? Giggity 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