Jump to content

Recommended Posts

Posted

Here's a way for you to do sequential actions through a single hotkey, expandable to more than just 2 options:

HotKeySet('\', 'fc') ; Keep in mind that Send can trigger hotkeys, so using '1' is a bad idea if you're Sending a 1 in your function

While True
    Sleep(10)
WEnd

Func fc()
    Local Static $iCount = 0
    Local Const $iCountMax = 5

    Switch $iCount
        Case 0 ; Keep in mind if you're starting at 0 or 1, and what you reset it to
            Send('Pulse 1')
        Case 1
            Send('Pulse 2')
        Case 2
            Send('Pulse 3')
        Case 3
            Send('Pulse 4')
        Case 4
            Send('Pulse 5')
        Case Else
            ConsoleWrite('Unregistered count/action: ' & $iCount & @CRLF)
    EndSwitch

    $iCount += 1
    If $iCount >= $iCountMax Then ; You can reset your count when you've reached your specified max
        $iCount = 0
    EndIf

    Return $iCount
EndFunc

 

We ought not to misbehave, but we should look as though we could.

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
  • Recently Browsing   0 members

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