Jump to content
Sign in to follow this  
uber125

Why does this script run each function 1 time?

Recommended Posts

uber125

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

Share this post


Link to post
Share on other sites
uber125

I hear what you're saying man, but I just don't understand. :)

Share this post


Link to post
Share on other sites
ChrisL

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

Share this post


Link to post
Share on other sites
uber125

Ooooohhhhhhhhh, I see now. Thank you very much. :)

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  

×