Sign in to follow this  
Followers 0
culexdd

While paused unlock hotkeys.

4 posts in this topic

#1 ·  Posted (edited)

Hi, so, i have a script which i use to make one hotkey press itself after another key, the Script is working fine, i have no problems at all...
But i can't find a way to make it work the way i want... what i want is for when the script is paused, for the hotkeys i set to be free, to be typed without problem, and when the script is upaused, for it to send the hotkeys to the functions...
well, maybe you can help me as i have looked for it and not found it anywhere (probably because of bad wording, or not knowing what to search for.).

Please do bear in mind i have about 1 hour of knowledge about AutoIT and english isn't my main language.

This is what i got so far...

Opt("SendKeyDelay", 50)
Opt("SendKeyDownDelay", 100)

Global $Paused
HotKeySet("3", "Hotkey1")
HotKeySet("2", "Hotkey2")
HotKeySet("e", "Hotkey3")
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{F5}", "Terminate")

While 1
        Sleep(500)
        ToolTip("...",0,0)
WEnd

Func TogglePause()
        $Paused = Not $Paused
        While $Paused
                Sleep(100)
                ToolTip('Script is Paused', 0, 0)
        WEnd
        ToolTip("")
 EndFunc
 
Func Hotkey1()
   If $Paused Then
          Sleep(100)
   ElseIf Not $Paused Then
   HotKeySet("3")
        ToolTip("1...",0,0)
        Send("{SPACE}")
        Sleep(50)
        Send("3")
        HotKeySet("3", "Hotkey1")
        EndIf
 EndFunc
 
 Func Hotkey2()
        If $Paused Then
          Sleep(100)
   ElseIf Not $Paused Then
        HotKeySet("2")
        ToolTip("2...",0,0)
        Send("{SPACE}")
        Sleep(50)
        Send("2")
        HotKeySet("2", "Hotkey2")
        EndIf
EndFunc

 Func Hotkey3()
        If $Paused Then
          Sleep(100)
   ElseIf Not $Paused Then
        HotKeySet("e")
        ToolTip("3...",0,0)
        Send("{SPACE}")
        Sleep(50)
        Send("e")
        HotKeySet("e", "Hotkey3")
        EndIf
 EndFunc
 
 Func Terminate()
        Exit 0
EndFunc

Any help is welcome, thank you.

Edited by culexdd

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

i see, that makes sense.
i'll search how to do that, thank you so much.
if i run into any problems i'll post soon, btw, is there any keyword i should search for how to do that?

Edited by culexdd

Share this post


Link to post
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
Sign in to follow this  
Followers 0