shag Posted December 15, 2015 Share Posted December 15, 2015 (edited) Hello I'm trying to use the exit and pause function, but I can't get it to work. Can you please look at my code and see what is wrong?Thank you HotKeySet("{p}","TogglePause")HotKeySet("{Pause}", "TogglePause")HotKeySet("{ESC}", "Terminate")While 1 Send("{ALT DOWN}") Sleep(200) $load = 0 While ($load = 0) $load = _ImageSearchArea("Ore.BMP",1,$centre_x-100,$centre_y-100,$centre_x+100,$centre_y+100,$site_x,$site_y,80) WEnd MouseMove($site_x,$site_y) Sleep(200) MouseClick("left",$site_x,$site_y,3,0) MouseMove($centre_x,$centre_y-250) MouseClick("left",$centre_x,$centre_y-250,3,0) Sleep(200) Send("{ALT UP}")WEndFunc TogglePause() $paused = NOT $paused While $paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd Sleep(2000) ToolTip("")EndFuncFunc Terminate() Exit 0EndFunc Edited December 15, 2015 by shag Link to comment Share on other sites More sharing options...
TouchOdeath Posted December 15, 2015 Share Posted December 15, 2015 Alt is held the entire time, so escape never gets pressed. Alt + escape does instead. shag 1 Link to comment Share on other sites More sharing options...
shag Posted December 15, 2015 Author Share Posted December 15, 2015 is there a way to send Alt + escape to exit the script?or do I need to put a small break in there where th Alt key is not pressed? Link to comment Share on other sites More sharing options...
TouchOdeath Posted December 15, 2015 Share Posted December 15, 2015 (edited) HotKeySet("!{ESC}","Terminate")I'm not at my computer but that should do the trick Edited December 15, 2015 by TouchOdeath 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