Skip to content

Instantly share code, notes, and snippets.

@grayatrox
Last active March 29, 2024 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grayatrox/20bf0e665fa5611bb40be6eada4d0616 to your computer and use it in GitHub Desktop.
Save grayatrox/20bf0e665fa5611bb40be6eada4d0616 to your computer and use it in GitHub Desktop.
#Requires AutoHotkey v2.0
#Warn all, off
Persistent
mcWindow := "ahk_class GLFW30" ; Minecraft Window
healButton := "F13"
healCommand := "heal"
HotIfWinActive(mcWindow)
Hotkey healButton, (*) => sendCommand(healCommand, healButton)
#HotIf
sendCommand(text,hotkey)
{
KeyWait(hotkey)
BlockInput("Send")
SendInput("/")
Sleep(300)
SendInput(text)
SendInput ("{enter}")
BlockInput("Off")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment