Code: Select all
#Requires AutoHotkey v2.0
#SingleInstance Force
; Create gui display
MyGui := Gui(, "Secret Key")
MyGui.SetFont("s12")
MyGui.Add("Text", "x0 w200 Center", "Press F1 to toggle")
MyGui.Add("Text", "Right w100", "Active: ")
MyGui.Add("Text", "x+0 yp cRed vactive", "FALSE")
MyGui.Show("x1700 y920 w200 h80 NoActivate")
; Variable to control loop
LoopControl := false
LoopFunction()
{
Loop
{
if (LoopControl)
{
; Press D for 0.25 seconds
Send "{d down}"
Sleep(250)
Send "{d up}"
; Click on a specific point on the screen
;Click, 100, 100 ; Change the coordinates to your specific point
; Wait for 0.25 seconds
Sleep(250)
; Press D for 0.25 seconds
Send "{d down}"
Sleep(250)
Send "{d up}"
; Press W for 1.5 seconds
Send "{W down}"
Sleep(1500)
Send "{W up}"
; Click on a specific point on the screen
;Click, 200, 200 ; Change the coordinates to your specific point
; Wait for 2 seconds
Sleep(2000)
}
else
{
Break ; Terminates the loop
}
}
}
; F1 toggle keybind
F1:: {
static Toggle := false
if Toggle := !Toggle {
LoopControl := true
MyGui["active"].Opt("cGreen")
MyGui["active"].Text := "TRUE"
}
else {
LoopControl := false
MyGui["active"].Opt("cRed")
MyGui["active"].Text := "FALSE"
}
}