Many/most of the hotkeys are "toggle" hotkeys. For toggle hotkeys, press the hotkey once to enable and press it again to disable.
Hotkeys
List of hotkeys and their functions. See the script for more info.
General purpose hotkeys:
- Ctrl + Esc - Quit the script.
- Alt + Esc - Cancel any held down keys and reload.
- F10 - Auto attack. (Toggle)
- F11 - Hold down Use (RButton). (Toggle)
- F12 - Hold down Attack (LButton). (Toggle)
- Up - Pitch the camera up by a small amount.
- Down - Pitch the camera down by a small amount.
- Left - Rotate the camera left by a small amount.
- Right - Rotate the camera right by a small amount.
- Alt + C - Hold down Shift to crouch. (Toggle, or just press Shift to cancel)
Note: Some of the macros assume that you will be crouching.
- F6 - Hold down RButton, S, and A for bridging out into the void. (Mainly for Skyblock.) (Toggle)
- F7 - Hold down RButton, S, and D. (Same as F6 hotkey, but move right instead of left.) (Toggle)
- F8 - Similar to F6 and F7 hotkeys, but move straight back holding RButton and S. Also useful for general block placement, tilling dirt, etc. (Toggle)
- F9 - Plant crops, bonemeal, harvest, repeat. (Toggle)
- Delete - Hold down RButton and spin in a circle. (Useful for piglin trading.) (Toggle)
- Ins - Crafting/villager trading macro. Move the mouse right, click, move left, click, repeat. (Hold down the hotkey) This is probably one of the most useful macros in this script, but it will require some cutomization for each specific task. Change the variables dx and dy to adjust how much the mouse moves up/down and left/right.
- Ctrl + F6 - Hold down Lbutton, W and A. (Toggle)
- Ctrl + F7 - Hold down Lbutton, W and D. (Toggle)
- Alt + F8 - Hold down Use (Rbutton) and move forward (W). (Toggle)
Code: Select all
; Minecraft script
#Requires AutoHotkey v2.0
#SingleInstance Force
; Customize settings here.
PeriodicAttack := 620 ; Speed of attack for F10 hotkey below.
PeriodicHoldAttack := 100 ; Time to hold attack for F10 hotkey below.
BonemealDelay := 90 ; Delay between actions for F9 hotkey below.
; Ctrl + Esc to quit.
^Esc::
+^Esc:: {
ExitApp
}
; Alt + Esc to cancel any held down keys and reload the script. Useful if you hit the
; wrong hotkeys and can't turn them off.
!Esc::
+!Esc:: {
Send "{LButton Up}{RButton Up}{w Up}{a Up}{s Up}{d Up}{Shift Up}"
Reload
}
#HotIf WinActive("Minecraft ahk_class GLFW30") || WinActive("Minecraft ahk_class ApplicationFrameWindow")
; Pitch camera up by a small amount.
$Up::
$+Up::MouseEvent(0x0000, -0x0001)
; Pitch camera down by a small amount.
$Down::
$+Down::MouseEvent(0x0000, 0x0001)
; Rotate camera left by a small amount.
$Left::
$+Left::MouseEvent(-0x0001, 0x0000)
; Rotate camera right by a small amount.
$Right::
$+Right::MouseEvent(0x0001, 0x0000)
; The arrow keys and Delete are used as hotkeys which prevents their normal function. Hold Ctrl while pressing
; the key to use the normal function. A usage example would be naming something at an anvil.
^Up::Send("{Up}")
^Down::Send("{Down}")
^Left::Send("{Left}")
^Right::Send("{Right}")
^Delete::Send("{Delete}")
MouseEvent(dx, dy) {
static MOUSEEVENTF_MOVE := 0x0001
DllCall("mouse_event", "UInt", MOUSEEVENTF_MOVE, "Int", dx, "Int", dy)
}
; Hold down Shift to crouch. Press again to cancel, or just press Shift.
!c::
+!c:: {
global CrouchToggle := IsSet(CrouchToggle) ? !CrouchToggle : 1
CrouchToggle ? Send("{Shift Down}") : Send("{Shift Up}")
}
~$Shift Up:: {
global CrouchToggle := 0
}
; F6 holds down RButton, S, and A for bridging out into the void (Skyblock). Press again to disable.
; Crouch (you can enable crouch "toggle" ON in Minecraft options or use the Alt + C hotkey in this script),
; and face toward one of the following.
; (45.0, 75.0), (-45.0, 75.0), (135.0, 75.0), or (-135.0, 75.0) - Press F3 to show the direction you are facing.
; Facing towards 45.0, -45.0, 135.0, or -135.0 should be exact because they control the direction you move.
; Up/down facing can be +/- ~0.5 and still work. For example, facing (45.0, 75.3) works fine.
F6::
+F6:: {
static toggle := 0
(toggle := !toggle) ?
Send("{RButton Down}{s Down}{a Down}") :
Send("{RButton Up}{s Up}{a Up}")
}
; F7 holds down RButton, S, and D for bridging out into the void. Press again to disable.
; Same as F6 hotkey, but this holds D instead of A to move right instead of left.
F7::
+F7:: {
static toggle := 0
(toggle := !toggle) ?
Send("{RButton Down}{s Down}{d Down}") :
Send("{RButton Up}{s Up}{d Up}")
}
; This holds down RButton and S. Useful for bridging out into the void, tilling dirt with a hoe, general building etc..
; For bridging out into the void it's the same as the F6 hotkey but face toward one of the following:
; (0.0, 79.0), (-0.0, 79.0), (90.0, 79.0), or (-90.0, 79.0)
F8::
+F8:: {
static toggle := 0
(toggle := !toggle) ?
Send("{RButton Down}{s Down}") :
Send("{RButton Up}{s Up}")
}
; Auto attack.
; To change the speed, change "PeriodicAttack" and "PeriodicHoldAttack" at the top of this script.
F10::
+F10:: {
global AttackToggle := IsSet(AttackToggle) ? !AttackToggle : 1
SetTimer SwingWeapon, AttackToggle ? -10 : 0
}
SwingWeapon() {
global AttackToggle, PeriodicAttack, PeriodicHoldAttack
Send "{LButton Down}"
Sleep PeriodicHoldAttack
Send "{LButton Up}"
SetTimer SwingWeapon, AttackToggle ? -PeriodicAttack : 0
}
; Hold down Use (RButton).
F11::
+F11:: {
static toggle := 0
(toggle := !toggle) ? Send("{RButton Down}") : Send("{RButton Up}")
}
; Hold down Attack (LButton).
F12::
+F12:: {
static toggle := 0
(toggle := !toggle) ? Send("{LButton Down}") : Send("{LButton Up}")
}
;==============================================================================
; Below this are macros that were created for temporary and/or specific tasks.
; Yes, much of this can be replaced with redstone eventually. But until you get there...
; Plant crops, bonemeal, harvest, repeat.
; Carrots, potatoes, wheat, etc. must be in hotbar position 8, and bonemeal is in hotbar position 7.
; Stand over the crop then face towards the ground and enable the hotkey. Press the hotkey again to disable.
F9::
+F9:: {
global BonemealToggle := IsSet(BonemealToggle) ? !BonemealToggle : 1
SetTimer PlantAndBonemeal, BonemealToggle ? -10 : 0
}
PlantAndBonemeal() {
global BonemealToggle, BonemealDelay
Send "8"
Sleep BonemealDelay
Send "{RButton}"
Sleep BonemealDelay
Send "7"
Sleep BonemealDelay
Send "{RButton 4}"
Sleep BonemealDelay
Send "{LButton}"
SetTimer PlantAndBonemeal, BonemealToggle ? -BonemealDelay : 0
}
; Hold RButton and spin in a circle. (Useful for piglin trading.)
; Stand in the center of a circle of piglins (in boats) and spin around to trade gold.
$Delete::
$+Delete:: {
global RotateToggle := IsSet(RotateToggle) ? !RotateToggle : 1
RotateToggle ? Send("{RButton Down}") : Send("{RButton Up}")
SetTimer Rotate, RotateToggle ? -1 : 0
}
Rotate() {
global RotateToggle
MouseEvent(0x0012, 0x0000)
SetTimer Rotate, RotateToggle ? -16 : 0
}
; This is a macro that was created for mass trading / crafting. It moves the mouse right, then clicks the mouse,
; then another press of the hotkey moves the mouse left and clicks the mouse.
; Note: If you want to use this you will probably need to adjust the variables "dx" and "dy" for your
; needs (use trial and error). dx is horizontal distance and dy is vertical distance.
Ins::Trade(0x01DD, 0x0040) ; Cleric, rotten flesh - first click should be center of the emerald.
^Ins::Trade(0x02CB, 0x0000) ; Craft paper
;!Ins::Trade(0x01EE, 0x0000) ; Craft sand - a Skyblock map I play has added the ability to craft sand.
Trade(dx, dy) {
static LeftRight := 0, Tick := 0
; If it has been more than 4 seconds since this hotkey was fired then automatically set the direction
; (LeftRight) to 1, else set it to the opposite.
if (A_TickCount - Tick) > 4000
LeftRight := 1
else
LeftRight := !LeftRight
Tick := A_TickCount
; The first time you press this hotkey it seems to move a different amount compared to the next time,
; so just moving the mouse by 1 will get that out of the way. (there must be a better way)
MouseEvent(0x0001, 0x0000)
MouseEvent(-0x0001, 0x0000)
; Move the mouse right/left and click
MouseEvent((LeftRight ? 1 : -1) * dx, (LeftRight ? 1 : -1) * dy)
Sleep 100
Send "+{LButton}" ; Shift click to trade all items
}
; Hold down Attack (LButton), W and A.
^F6::
+^F6:: {
static toggle := 0
(toggle := !toggle) ?
Send("{LButton Down}{w Down}{a Down}") :
Send("{LButton Up}{w Up}{a Up}")
}
; Hold down Attack (LButton), W and D.
^F7::
+^F7:: {
static toggle := 0
(toggle := !toggle) ?
Send("{LButton Down}{w Down}{d Down}") :
Send("{LButton Up}{w Up}{d Up}")
}
; Click Use (Rbutton) and move forward (w).
; Example usage would be using a hoe to till dirt wile moving forward.
!F8::
+!F8:: {
static toggle := 0
(toggle := !toggle) ?
Send("{RButton Down}{w Down}") :
Send("{RButton Up}{w Up}")
}
#HotIf