Jump to content

Why alway Exitloop


Xav
 Share

Recommended Posts

How can the script exit only when he found the color and after it sent Exit and .... ??

THANKS!

HotKeySet ("{PAUSE}","Chicken")
HotKeySet ("{ESC}","ExitP")

While 1
  Sleep(1)
  Wend

Func Chicken()
While 1
     $Coord = PixelSearch( 742, 32,792,146, 0x8C4810 )
     If not @error Then
     Send("{SPACE}")
     Send ("{Esc}")
     MouseClick("left" ,393, 292 ,1 ,0)
     Sleep(100)
     ExitLoop;----+> it exit when i send Pause hotkey!
     EndIf
   Wend
EndFunc

Func ExitP()
Exit
EndFunc
Edited by Xav
Link to comment
Share on other sites

I don't quite understand what your trying to get...

Could the problem be that you are sending a {Esc}, and that it is the hotkey to exit?

Please explain what the program is supposed to do better if that isn't the problem.

Link to comment
Share on other sites

Maybe this?

HotKeySet ("{PAUSE}","Chicken")
HotKeySet ("{ESC}","ExitP")

While 1
  Sleep(1)
  Wend

Func Chicken()
    $Coord = PixelSearch( 742, 32,792,146, 0x8C4810 )
    While (@error)
        $Coord = PixelSearch(742, 32, 792, 146, 0x8C4810)
    Wend
    Send("{SPACE}")
    Send ("{Esc}")
    MouseClick("left" ,393, 292 ,1 ,0)
    Sleep(100)
EndFunc

Func ExitP()
Exit
EndFunc
Link to comment
Share on other sites

Maybe this?

HotKeySet ("{PAUSE}","Chicken")
HotKeySet ("{ESC}","ExitP")

While 1
  Sleep(1)
  Wend

Func Chicken()
    $Coord = PixelSearch( 742, 32,792,146, 0x8C4810 )
    While (@error)
        $Coord = PixelSearch(742, 32, 792, 146, 0x8C4810)
    Wend
    Send("{SPACE}")
    Send ("{Esc}")
    MouseClick("left" ,393, 292 ,1 ,0)
    Sleep(100)
EndFunc

Func ExitP()
Exit
EndFunc

Yes sir Thanks !

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...