Skip to content

Instantly share code, notes, and snippets.

@drguildo
Last active April 17, 2017 16:24
Show Gist options
  • Save drguildo/714a4cb7a8c2647a4c1d5b3000931be4 to your computer and use it in GitHub Desktop.
Save drguildo/714a4cb7a8c2647a4c1d5b3000931be4 to your computer and use it in GitHub Desktop.
An AutoHotKey program that plays the game Reigns automatically.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#IfWinActive Reigns
Loop {
Sleep, 3000
WinGetPos, , , width, height, A
Random, rand, 0, 1
y := height / 2
If rand {
; Swipe left
x := 10
} Else {
; Swipe right
x := width - 10
}
Click %x% %y%
Sleep, 100
x := width / 2
Click %x% %y% 0
}
Return
#IfWinActive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment