Skip to content

Instantly share code, notes, and snippets.

@BirkhoffLee
Created February 16, 2017 10:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BirkhoffLee/ace777be9516a9cb4a89a83564defc25 to your computer and use it in GitHub Desktop.
Save BirkhoffLee/ace777be9516a9cb4a89a83564defc25 to your computer and use it in GitHub Desktop.
An AutoHotKey script for Minecraft AFK mining, which keep pressing the left mouse button and locks the movement of mouse while mining. Use "z" to toggle.
z::
if GetKeyState("LButton") {
Send % "{Click Up}"
BlockInput, MouseMoveOff
} else {
Send % "{Click Down}"
BlockInput, MouseMove
}
return
@BirkhoffLee
Copy link
Author

AHK install: https://autohotkey.com/download/ahk-install.exe
Save the code as "MinecraftAFKMining.ahk" and double-click it to launch. Use "z" to toggle.

Copy link

ghost commented Sep 6, 2019

This works much better when u add the '#IfWinActive Minecraft line' so you can use 'Z' on the desktop without activating the script all the time.

#IfWinActive Minecraft
z::
    if GetKeyState("LButton") {
        Send % "{Click Up}"
        BlockInput, MouseMoveOff
    } else {
        Send % "{Click Down}"
        BlockInput, MouseMove
    }
return

@piotroza
Copy link

@BirkhoffLee how do i uninstall it

@darwinuwu
Copy link

@BirkhoffLee how do i uninstall it

press show hidden icons and close from their

@NotHashkey
Copy link

@BirkhoffLee how do you turn off "MouseMoveOff" ?

@wallobor
Copy link

wallobor commented Nov 6, 2021

@BirkhoffLee how do i uninstall it

press "z" again

i recommend to make it like this

#IfWinActive Minecraft
!z:: ; alt + Z to activate and de-activate this script
if GetKeyState("LButton") {
Send % "{Click Up}"
BlockInput, MouseMoveOff
} else {
Send % "{Click Down}"
BlockInput, MouseMove
}
return

@Poplosion
Copy link

Poplosion commented Apr 7, 2023

Can someone please update this. Also is there a way where you dont need the original minecraft for example lunar client? I fixed it myself now but I need help on adding it so it automates moving foward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment