Created
January 29, 2024 06:35
-
-
Save kumarchandresh/166c64b3232ea006c00a5e407a0a71e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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