Lentil

Adding script reset

10 posts in this topic

#1 ·  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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

dbl post 

Edited by Lentil

Share this post


Link to post
Share on other sites

#3 ·  Posted

what app you are automating?


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#4 ·  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.

Share this post


Link to post
Share on other sites

#5 ·  Posted

I googled your spd2 and got this, :lol:


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites

#6 ·  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

I am not a lawyer.  (-_-) Xandy About  (^o^) Discord - Xandy Programmer

Share this post


Link to post
Share on other sites

#7 ·  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

Share this post


Link to post
Share on other sites

#8 ·  Posted

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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#9 ·  Posted

3 minutes ago, JLogan3o13 said:

Care to explain exactly what sp d2 is please?

Oh sorry, its single player Diablo 2.

Share this post


Link to post
Share on other sites

#10 ·  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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.