Jump to content

Recommended Posts

Posted

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

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

Posted (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 by JLogan3o13
Posted (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 by JLogan3o13
Posted
3 minutes ago, JLogan3o13 said:

Care to explain exactly what sp d2 is please?

Oh sorry, its single player Diablo 2.

  • Moderators
Posted

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!

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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