Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ^PgDn::
- if winc_presses > 0 ; SetTimer already started, so we log the keypress instead.
- {
- winc_presses += 1
- return
- }
- ; Otherwise, this is the first press of a new series. Set count to 1 and start
- ; the timer:
- winc_presses = 1
- SetTimer, KeyWinC, -600 ; Wait for more presses within a 400 millisecond window.
- return
- KeyWinC:
- if winc_presses = 1 ; The key was pressed once.
- {
- IfWinExist, NemosMiner
- {
- WinClose, NemosMiner
- }
- Run, C:\Users\marcu\Desktop\Tools\MineWhat.bat , , , processVarMine
- Sleep, 250
- WinActivate, ahk_pid %processVarMine%
- Send 3
- Send {Enter}
- }
- else if winc_presses = 2 ; The key was pressed twice.
- {
- IfWinExist, NemosMiner
- {
- WinClose, NemosMiner
- }
- Run, C:\Users\marcu\Desktop\Tools\MineWhat.bat , , , processVarMine
- Sleep, 250
- WinActivate, ahk_pid %processVarMine%
- Send 4
- Send {Enter}
- }
- else if winc_presses > 2
- {
- SetTimer, CheckForBatchWindow, 1800000
- Return
- CheckForBatchWindow:
- IfLess, A_TimeIdlePhysical, 600000
- {
- SetTimer, ,ON
- Return
- }
- ;Else
- If DeactiveRestart = false
- {
- IfWinExist, NemosMiner
- {
- WinClose, NemosMiner
- }
- Run, C:\Users\marcu\Desktop\Tools\MineWhat.bat , , , processVarMine
- Sleep, 250
- WinActivate, ahk_pid %processVarMine%
- Send 4
- Send {Enter}
- SetTimer, ,ON
- Return
- }
- }
- Else {
- MsgBox, Restart is Deactived.
- }
- ; Regardless of which action above was triggered, reset the count to
- ; prepare for the next series of presses:
- winc_presses = 0
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement