Skip to content

Instantly share code, notes, and snippets.

@kumarchandresh
Created January 29, 2024 06:35
Show Gist options
  • Select an option

  • Save kumarchandresh/166c64b3232ea006c00a5e407a0a71e6 to your computer and use it in GitHub Desktop.

Select an option

Save kumarchandresh/166c64b3232ea006c00a5e407a0a71e6 to your computer and use it in GitHub Desktop.
#Requires AutoHotkey v2.0
; AutoHotkey script for animation cancel in Stardew Valley
; Source: https://forums.stardewvalley.net/threads/a-better-animation-canceling-autohotkey-script.7391/
#HotIf WinActive("ahk_exe StardewModdingAPI.exe") or WinActive("ahk_exe Stardew Valley.exe")
SleepForFrames(x)
{
Sleep(x * 16.666)
}
Space::
{
While GetKeyState("Space", "P")
{
SendEvent "{LButton down}{LButton up}"
SleepForFrames(5) ; This value depends heavily on the actual FPS you're getting
SendEvent "{Del down}{RShift down}{r down}"
SendEvent "{Del up}{RShift up}{r up}"
}
}
; Use the following script if you like to manually cancel the animation.
; Space::
; {
; SendInput "{Del down}{RShift down}{r down}"
; KeyWait "Space"
; SendInput "{Del up}{RShift up}{r up}"
; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment