logo

Indigo Empire

 

AFK with AHK

Part 55 ~ 16 August 2025

Posted: 2 May 2026

Author's note:

Autohotkey at your own risk – it can mess with your computer. AFK at your own risk – it can result in character death! And, if you're on a server, check with the admins first...

Also, this post is out of chronological order because I never finished the draft lol.

~ Lemming


This one's all about playing the game without playing! We're going AFK in SSP with the help of AHK. I hope you like TLAs, btw.¹

I wanna introduce you to a little helper program that I've been running alongside Minecraft for the past few years. This definitely leans into the... less principled side of survival Minecraft. Not unethical, per se – I'm already waaay ahead of that with the villager halls and iron golem farm. But *setting up the game to play itself* is a different dimension of uncomfy that might turn some people off. Not me though. I LOVE this stuff :D

Stock image of a laptop on a desk, with an empty chair, a mug, and a lamp. On the screen is an overlaid screenshot of Ela mining at the stone generator.

So what is this "AHK" thing? It's a neat Free Open-Source Software (FOSS) scripting tool called Autohotkey. With a little programmer know-how (and/or tutorials), you can write up keyboard macros to automate any number of tasks. Just look at the example uses from Wikipedia! Pasting text strings (including special characters), opening programs, scheduling system tasks... And simulating mouse input. Hello there.

Seasoned crafters will know that there are other ways to hold down the mouse, like the F3+T trick, Tweakeroo mod, or in newer versions, in-game settings to toggle 'attack' and 'use'. I've found these too limited for what I'm trying to do – and in the case of Tweakeroo, also way overkill, to the point where I've actually uninstalled it on this world. And hey, I like to code, and it's just fun to do things my own way :)

So I went and found a tutorial on how to run mouse input into a program. (I forget where; it's been a LONG time.) Over the course of MANY tests, I figured out a bunch of fun things like:

  • Autohotkey runs on a "timer" that counts in milliseconds (1000 = 1 second).
  • The mouse click consists of a "click down" and a "click up" and you need to send these inputs separately to "hold down" the mouse.
  • You need to tell AHK which program or process to send the input to, otherwise it will just click on your screen and cause chaos!

Here's one of the scripts I came up with! When AHK is running, I can press F10 and it will simulate a left mouse button press, meaning I can dig without clicking. It's called "Digger" like the skill from Lemmings, and even shares the same hotkey!

;DIGGER: Hold left-click.

f10::

; get ahk_exe for active window

WinGet, activeprocess, ProcessName, A

SetTimer Digger, 1000

toggle0 := !toggle0

ControlClick, , ahk_exe %activeprocess%, ,Left, , NAU

Digger:

if (!toggle0)

{

return

}

ControlClick, , ahk_exe %activeprocess%, ,Left, , NAD

return

Let's see the Digger macro at work! I'll grab a new diamond pickaxe (plus Efficiency and Unbreaking) from the villagers, portal out to Ghost Lake, and position myself at the stone generator. Aim at the centre of the stone block, tab out, open AHK, tab back in, and hit F10. And like a person possessed, I will MINE THAT BLOCK until I'm told to stop with another F10.

Ela mines stone from a stone generator, consisting of lava suspended over water surrounded by solid blocks.

I also have four other Lemmings-themed macros:

  • Blocker: Holds right-click – good for farms where you just place blocks, like tree farms.
  • Basher: Holds right-click, and left-clicks once per second. Ideal for mob farms with player kills.
  • Miner: Holds both mouse buttons – useful for farms where you both place and mine blocks, and for tasks like concrete converting.
  • Builder: Holds Shift, S, and right-click. An experimental auto-bridge-building macro. Would not use in the End.

Somehow this was allowed on the server I was on at the time (I'm as surprised as you are) and I was able to get filthy rich by farming raids and zombie pigmen. And so it goes again on this world. Did you really think I stood there *physically clicking the mouse* for 15 minutes at the gold farm? That sounds like a speedrun to repetitive strain injury. Instead, I launched AHK, hit F8 to start the Basher macro, and watched Youtube until my timer ran out. I got a good test run, and my hands got a much-needed break.

Ela swings their sword at a batch of zombified piglins at the gold farm, killing many with a single blow.

And the third macro, which I've used the most in recent times, is the Blocker. This has a fun double meaning in Minecraft, where the right mouse button is used both for blocking with the shield and for placing blocks! I've been using it at the newly-built TNT tree farm where it lets me spam saplings/mushrooms from my left hand and bonemeal from my right.

Using bonemeal to grow a mushroom on podzol in a tree farm, as a TNT explosion goes off behind.

These macros aren't perfect. The one-second timer seems to interrupt the actions (this may just be me being a noob with AHK). Sometimes they randomly bug out, or I hit the wrong hotkey and lose track of which ones are active, in which case I have to close and reopen AHK. And, as mentioned, there's other tools out there that can do the job, and probably better than what I've hacked together here. But, as with so many things in Indigo Empire, it's mine, and it's Good Enough For Me! :D

"But Ela", you may protest. "This is crazy! Why would you let the computer take control of you?" Well... I'm a Miner! I was spawned into this world to mine, and I'm at my happiest with a pickaxe in hand. Plus I love the consistent, rhythmic routine of these macros. All I ask is that I'm safe from monsters and topped up on food!

As far as me, the IRL person, going AFK? That's a win for accessibility and game/life balance! The stone generator produces the same number of blocks per hour, whether I sit there holding the mouse or set up the computer to do it for me. So I get to take a little break from the game and get some food, do some cleaning, or go outside and touch grass.

Now, how far can you go with AHK? Very, it turns out. People have been cooking up all kinds of scripts for such tasks as:

And even more advanced things like fishing or strip mining. Heck, there's even a raid farm out there that uses AHK to run back and forth and start the next raid. However, I don't intend to take it much further on this world than I already have. For one, the Stacker mod largely removes the need for item-shuffling macros. But also, my hotkey space is basically full, thanks to all the mods I have installed. I could start adding Ctrl- and Shift- keybinds, but I fear I'd have to start keeping post-it notes around my computer to remember them all... It's not meant to be that serious – we're playing Minecraft, not Starcraft!

So, FYI, that was AHK. NGL, it's pretty good, IMO. I can go AFK and do something IRL without hurting the ROI on my farms. LOL.²


  1. Away from keyboard, survival singleplayer, Autohotkey, three-letter acronym, by the way.
  2. For your information, Autohotkey, not gonna lie, in my opinion, away from keyboard, in real life, return on investment, laughing out loud.

Previous entry: Part 54: Flower Power