Browse Source

updated minecraft script to use alt

ahk-v1
Mar Alegre 4 years ago
parent
commit
f5a678331b
  1. 2
      lib/Prelude.ahk
  2. 16
      lib/Wrapper.ahk
  3. 3
      src/AutoSave.ahk
  4. 0
      src/AutorunAutoclick.ahk
  5. 0
      src/Dark Souls III.ahk
  6. 66
      src/Minecraft Bedrock Edition.ahk
  7. 67
      src/Minecraft.ahk
  8. 0
      src/Outer Wilds.ahk

2
lib/Prelude.ahk

@ -3,7 +3,7 @@
;
; Set default location and name convention for compiled scripts to use
;@Ahk2Exe-ExeName %A_MyDocuments%\AutoHotkey\bin\AHK-%A_ScriptName%
;@Ahk2Exe-ExeName %A_MyDocuments%\AutoHotkey\bin\%A_ScriptName%
; Install hooks to make sure script can get physical state of keys instead of logical state.
#InstallKeybdHook

16
lib/Wrapper.ahk

@ -0,0 +1,16 @@
;
; Turn script into wrapper for a program
;
CheckWinExist(Window) {
if !WinExist(Window) {
ExitApp
}
}
Run %WrapperPath%
WinWait %WrapperWindow%
; Check if window exists once per second
WrapperFunc := Func("CheckWinExist").bind(WrapperWindow)
SetTimer, %WrapperFunc%, 1000

3
src/AutoSave.ahk

@ -20,5 +20,4 @@ Autosave:
Sleep 50
Send {s up}
Sleep 50
Send {Ctrl up}
SetTimer, Autosave, On
Send {Ctrl up}

0
src/Basic.ahk → src/AutorunAutoclick.ahk

0
src/Dark_Souls_III.ahk → src/Dark Souls III.ahk

66
src/Minecraft Bedrock Edition.ahk

@ -0,0 +1,66 @@
; Script can be directly run by or compiled into an .exe by the open-source software AutoHotkey
; https://www.autohotkey.com
;
; Front Matter
;
; Include relevant libraries
#Include ../lib/Prelude.ahk
#Include ../lib/HoldRepeat.ahk
; Make this a wrapper script
WrapperPath:="shell:AppsFolder\Microsoft.MinecraftUWP_8wekyb3d8bbwe!App"
WrapperWindow:="Minecraft"
#Include ../lib/Wrapper.ahk
;
; Hotkeys
;
; Remap LAlt so it doesn't active Minecraft's Alt+Space menu shortcut
#InputLevel 1
*LAlt::vkFF
#InputLevel 0
vkFF & Tab::
Send {Alt down}
Send {Blind}{Tab}
SetTimer, AltUp, -1
return
AltUp:
KeyWait LAlt
Send {Alt up}
return
; Hold/Autoclick mouse buttons
; Holds if single click, autoclicks if double click
vkFF & LButton UP::HoldOrRepeat("LButton",["RButton","MButton"])
vkFF & RButton UP::HoldOrRepeat("RButton",["LButton","MButton"])
; Autorun
vkFF & w UP::Hold("w",["s"])
vkFF & s UP::Hold("s",["w"])
vkFF & a UP::Hold("a",["d","w","s"])
vkFF & d UP::Hold("d",["a","w","s"])
; Hold crouch
vkFF & Shift UP::Hold("Shift",["Ctrl"])
; Autojump/auto-ascend
vkFF & Space UP::Hold("Space",["Shift"])
; Mouse button 4: auto-takeoff
; Macro assumes you have your fireworks in the first hotbar slot
XButton1::
Loop, 5 {
Send {Space down}
Sleep 10
}
Send {Space up}1
Sleep 225
Loop, 5 {
Send {Space down}
Sleep 10
}
Send {Space up}{RButton}
return

67
src/Minecraft.ahk

@ -1,67 +0,0 @@
; Script can be directly run by or compiled into an .exe by the open-source software AutoHotkey
; https://www.autohotkey.com
;
; Front Matter
;
; Include relevant libraries
#Include ../lib/Prelude.ahk
#Include ../lib/HoldRepeat.ahk
; Only do hotkeys if relevant window is active
#If WinActive("Minecraft")
;
; Hotkeys
;
; Tab will be the hotkey
~Tab::return
*!RButton::
Send {RButton}
Sleep 100
Send {Esc down}
Sleep 50
Send {Esc up}
return
; Hold/Autoclick mouse buttons
; Holds if single click, autoclicks if double click
Tab & LButton UP::HoldOrRepeat("LButton",["RButton","MButton"])
Tab & RButton UP::HoldOrRepeat("RButton",["LButton","MButton"])
; Autorun
Tab & w UP::Hold("w",["s"])
Tab & s UP::Hold("s",["w"])
Tab & a UP::Hold("a",["d","w","s"])
Tab & d UP::Hold("d",["a","w","s"])
; Hold crouch
Tab & Shift UP::
if GetKeyState("Alt","P") {
Hold("Shift",["Ctrl"])
} else {
Hold("Shift",["Ctrl","Space"])
}
return
; Autojump/auto-ascend
Tab & Space UP::Hold("Space",["Shift"])
; Mouse button 4: auto-takeoff
; Macro assumes you have your fireworks in the first hotbar slot
XButton1::
Loop, 5 {
Send {Space down}
Sleep 10
}
Send {Space up}1
Sleep 225
Loop, 5 {
Send {Space down}
Sleep 10
}
Send {Space up}{RButton}
return

0
src/Outer_Wilds.ahk → src/Outer Wilds.ahk

Loading…
Cancel
Save