Jump to content

Question


Recommended Posts

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 by AC130
Link to comment
Share on other sites

??

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
Link to comment
Share on other sites

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 by dufran3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...