Sign in to follow this  
Followers 0
Xav

Why alway Exitloop

4 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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 !

Share this post


Link to post
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
Sign in to follow this  
Followers 0