Lentil Posted May 14, 2017 Share Posted May 14, 2017 Hello, I've been using this template with pause and terminate hotkey for some time now. I'm hoping someone can help me add a reset function that will restart the script to the beginning with a hotkey. Thanks a lot! ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{NUMPAD0}", "TogglePause") HotKeySet("{numpad1}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d While 1 Sleep(10) Send('{backspace}') Sleep(100) Send('{ESC}') Sleep(100) Sleep(50) Send('{numpad0}') Sleep(50) Send('{space}') Sleep(50) WEnd While 1 MsgBox (0, "Pause ;-)") Sleep (2000) WEnd ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('"Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","This is a message.") EndFunc Script.au3 Link to comment Share on other sites More sharing options...
Lentil Posted May 14, 2017 Author Share Posted May 14, 2017 (edited) dbl post Edited May 14, 2017 by Lentil Link to comment Share on other sites More sharing options...
232showtime Posted May 15, 2017 Share Posted May 15, 2017 what app you are automating? ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Lentil Posted May 15, 2017 Author Share Posted May 15, 2017 4 minutes ago, 232showtime said: what app you are automating? I've been using this for grinding in sp d2 with my own basic movement scripts. Hand can get tired so its nice to have the script do the manual work and I just ID stuff. Link to comment Share on other sites More sharing options...
232showtime Posted May 15, 2017 Share Posted May 15, 2017 I googled your spd2 and got this, ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Xandy Posted May 15, 2017 Share Posted May 15, 2017 (edited) Put whatever you want to Restart in a function body. Up at your list of HotKeySet()s add a new key and the name of your new function. Now when you press the new key your function will be called again (Just like restarting). Something like this <snip> Edited May 15, 2017 by JLogan3o13 Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Lentil Posted May 15, 2017 Author Share Posted May 15, 2017 (edited) Thanks Xandy, it works great but I notice that when I use the reset button the script seems to ignore the auto pause I put in the script. I use numbpad0 to pause and inserted send for it in the script but reset seems to ignore it, but it does stop at the end of the script. Is there any fix for this? <snip> Edited May 15, 2017 by JLogan3o13 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 15, 2017 Moderators Share Posted May 15, 2017 8 hours ago, Lentil said: I've been using this for grinding in sp d2 with my own basic movement scripts. Care to explain exactly what sp d2 is please? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Lentil Posted May 15, 2017 Author Share Posted May 15, 2017 3 minutes ago, JLogan3o13 said: Care to explain exactly what sp d2 is please? Oh sorry, its single player Diablo 2. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 15, 2017 Moderators Share Posted May 15, 2017 I figured as much. You seem to have walked right by our forum rules on your way in. Please read them now, especially the part about game automation, and you'll see why this thread is locked. You will get no help on this subject. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts