Skip to content

Instantly share code, notes, and snippets.

@akersten
Created February 15, 2024 02:47
Show Gist options
  • Save akersten/4b7729dda9d8470ef9fc45b3589fe95d to your computer and use it in GitHub Desktop.
Save akersten/4b7729dda9d8470ef9fc45b3589fe95d to your computer and use it in GitHub Desktop.
AHK 1.1
#SingleInstance, Force
#IfWinActive, Stardew Valley
SleepForFrames(x)
{
Sleep, x * 16.666
}
XButton1::
While GetKeyState("XButton1", "P")
{
SendEvent, {LButton Down}
SleepForFrames(1)
SendEvent, {LButton Up}
SleepForFrames(5) ; This value depends heavily on the actual FPS you're getting
SendEvent, {r Down}{Delete Down}{RShift Down}
SleepForFrames(1)
SendEvent, {r Up}{Delete Up}{RShift Up}
}
SleepForFrames(1)
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment