AC130 Posted May 17, 2011 Posted May 17, 2011 (edited) Hello again. I have a question, how do you stop a script? I have my program set to search for a pixel after i press the gui button. Case $Command1 $Pixel = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x000000) If Not @Error Then MouseClick ( "left" , $Pixel[0], $Pixel[1]) ; Now I want it to end that script and start the script below: $Pixel2 = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x111111) MouseClick ( "left" , $Pixel1[0], $Pixel1[1] EndIf Edited May 17, 2011 by AC130
dufran3 Posted May 17, 2011 Posted May 17, 2011 ?? Case $Command1 While 1 $Pixel = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x000000) If Not @Error Then MouseClick ( "left" , $Pixel[0], $Pixel[1]) WEnd ; Now I want it to end that script and start the script below: While 1 $Pixel2 = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x111111) MouseClick ( "left" , $Pixel1[0], $Pixel1[1] WEnd
AC130 Posted May 17, 2011 Author Posted May 17, 2011 oh rofl! see i was trying to hard. thanks dude!!
dufran3 Posted May 17, 2011 Posted May 17, 2011 (edited) are you making sure you end your Case statement correctly? Select Case $Command1 While 1 $Pixel = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x000000) If Not @Error Then MouseClick ( "left" , $Pixel[0], $Pixel[1]) WEnd ;Script Has Now Ended While 1 $Pixel2 = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x111111) If Not @Error Then Msgbox (0,'', 'blah blah' ) WEnd EndSelect Edited May 17, 2011 by dufran3
dufran3 Posted May 17, 2011 Posted May 17, 2011 Select...Case...EndSelect is a conditional statement. Check the help file. It will explain it.
dufran3 Posted May 17, 2011 Posted May 17, 2011 the problem is with your $Command1 variable. If I set $Command1 = 1, the script works.
dufran3 Posted May 17, 2011 Posted May 17, 2011 that isn't what you want to do. Try adding a debug to see what is being assigned to $Command variable. ConsoleWrite('$command1: ' & $command1)
dufran3 Posted May 17, 2011 Posted May 17, 2011 where do i put this at?put it above the while statement.isn't there a way to like sleep until it finds that pixel?you can put a sleep in between checks, yeh... Sleep()
AC130 Posted May 18, 2011 Author Posted May 18, 2011 nevermine. I got it works. thanks for allll the help!!
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