Jump to content

Why does this script run each function 1 time?


Recommended Posts

Why does this script run each function only one time, and do it not again? I have to restart the script after each function is ran to run it again... why??? Am I missing something here?

HotKeySet("6", "Send6Then2");6
HotKeySet("5", "Send5Then3");5

While 1
    Sleep(100)
WEnd

Func Send6Then2()
    HotkeySet (@HotKeyPressed)
    Send(@HotKeyPressed)
    Sleep(300)
    Send("2")
    EndFunc

Func Send5Then3()
    HotkeySet (@HotKeyPressed)
    Send(@HotKeyPressed)
    Sleep(300)
    Send("3")
    EndFunc

Func Terminate()
    Exit 0
EndFunc
Edited by uber125
Link to comment
Share on other sites

You disable the hotkey during your functions but didn't reset it at the end. See below

HotKeySet("6", "Send6Then2");6
HotKeySet("5", "Send5Then3");5

While 1
    Sleep(100)
WEnd

Func Send6Then2()
    HotkeySet (@HotKeyPressed)
    Send(@HotKeyPressed)
    Sleep(300)
    Send("2")
    HotkeySet (@HotKeyPressed,"Send6Then2")
    EndFunc

Func Send5Then3()
    HotkeySet (@HotKeyPressed)
    Send(@HotKeyPressed)
    Sleep(300)
    Send("3")
    HotkeySet (@HotKeyPressed,"Send5Then3")
    EndFunc

Func Terminate()
    Exit 0
EndFunc
Edited by ChrisL
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...