Skip to content

Instantly share code, notes, and snippets.

@Specnr
Last active January 6, 2022 04:21
Show Gist options
  • Save Specnr/b5a95e9c5e60eb40c818737a7658b556 to your computer and use it in GitHub Desktop.
Save Specnr/b5a95e9c5e60eb40c818737a7658b556 to your computer and use it in GitHub Desktop.
Joins first world, toggles sprint, perspective and sets up pie for mapless buried treasures
; by Specnr :)
; v0.2
; Startup all instances on title screen, run script, then once all instances are in the world, press Shift+F
#NoEnv
#SingleInstance Force
SetKeyDelay, 0
SetWinDelay, 1
SetTitleMatchMode, 2
global sprintKey := "N"
global perspKey := "X"
StartSettings(pid) {
ControlSend, ahk_parent, {Blind}{Shift Down}{F3}{Shift Up}, ahk_pid %pid%
Sleep, 1000
ControlSend, ahk_parent, {Blind}{1}{1}{1}, ahk_pid %pid%
ControlSend, ahk_parent, {Blind}{%sprintKey%}{%perspKey%}{F3}, ahk_pid %pid%
Sleep, 1000
ControlSend, ahk_parent, {Blind}{F3 Down}{B}{Esc}{F3 Up}, ahk_pid %pid%
}
WinGet, all, list
Loop, %all%
{
WinGet, pid, PID, % "ahk_id " all%A_Index%
WinGetTitle, title, ahk_pid %pid%
if (InStr(title, "Minecraft*")) {
ControlSend, ahk_parent, {Blind}{Shift down}{Tab}{Shift up}{Enter}, ahk_pid %pid%
}
}
*+F::
{
Loop, %all%
{
WinGet, pid, PID, % "ahk_id " all%A_Index%
WinGetTitle, title, ahk_pid %pid%
if (InStr(title, "Minecraft*")) {
WinSet, AlwaysOnTop, On, ahk_pid %pid%
WinSet, AlwaysOnTop, Off, ahk_pid %pid%
WinMaximize, ahk_pid %pid%
ControlSend, ahk_parent, {Blind}{Esc}, ahk_pid %pid%
}
}
Loop, %all%
{
WinGet, pid, PID, % "ahk_id " all%A_Index%
WinGetTitle, title, ahk_pid %pid%
if (InStr(title, "Minecraft*")) {
ControlSend, ahk_parent, {Blind}{Esc}, ahk_pid %pid%
StartSettings(pid)
}
}
ExitApp
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment