Jump to content

Stupid question, starting the Code via Hotkey


Recommended Posts

How is this possible.

I am completly new.

HotKeySet("b","beenden");

func beenden()

Exit

EndFunc

thats the function i use to exit the programm. It would be bether to just pause the programm. The second part: i need a function to continue running the programm. Help please :lmao:

thanks

Link to comment
Share on other sites

this should work:

HotKeySet("{F9}", "TogglePause")
Global $PAUSED = False


While 1
    sleep(10)
    while ($PAUSED)
        sleep(100)
        ;The Code is paused.
    WEnd
    ;Put your normal code here
    
WEnd
Func TogglePause()
    if ($PAUSED == False) Then
        $PAUSED = True
    Else
        $Paused = False
    EndIf
EndFunc
oÝ÷ Ù©Ýiû¥ìZ^jëh×6
HotKeySet("{F9}", "TogglePause")
Global $PAUSED = False
GLobal $INT = 0
$d = GUICreate("Test")
$lab = GUICtrlCreateLabel("Not Paused", 10, 10)
$lab2 = GUICtrlCreateLabel($INT, 10, 40, 200)
GUISetState()
While 1
    sleep(10)
    while ($PAUSED)
        sleep(100)
        ;The Code is paused.
        if (GUICtrlRead($lab) == "Not Paused") Then GUICtrlSetData($lab, "Paused!")
        WEnd
        if (GUICtrlRead($lab) == "Paused!") Then GUICtrlSetData($lab, "Not Paused")
    ;Put your normal code here
    $INT += 1
    GUICtrlSetData($lab2, $INT)
WEnd
Func TogglePause()
    if ($PAUSED == False) Then
        $PAUSED = True
    Else
        $Paused = False
    EndIf
EndFunc
Edited by CHRIS95219
Link to comment
Share on other sites

; copy any you want to change  ;default value is listed firstPixel
WinActivate("Warcraft III")

HotKeySet("b","beenden");
HotKeySet("p", "TogglePause")


Global $PAUSED = False

While 1
    sleep(10)
    while ($PAUSED)
        sleep(100)

WEnd

Sleep(5000);
Send("!a");
Send("{F10}");
Send("!e");
Send("!q");
MouseClick("left",1018,942,1,1);
WEnd

func beenden()
    Exit
EndFunc

Func TogglePause()
    if ($PAUSED == False) Then
        $PAUSED = True
    Else
        $Paused = False
    EndIf
EndFunc

this is my code... The pause doesnt work.. Additionatly i would like the part

Sleep(5000);
Send("!a");
Send("{F10}");
Send("!e");
Send("!q");
MouseClick("left",1018,942,1,1);

to run as an infinite loop.

Thanks for your patience + help.

Link to comment
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
 Share

  • Recently Browsing   0 members

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