update 7. Desember: Bugfixed the Worldedit script and uploaded the script as a file.
Autohotkey is a program that lets you create hotkeys for different commands. This is a thread for discussing use of autohotkey macros in minecraft. Do you have some good scripts you want to share with us? Also, if someone have questions, please ask.
I will start off with posting the script I use right now for Minecraft. Half of it was written by fnordcircle of the Something Awful forums, the rest by me. What the script does:
- Automine, toggled with mousebutton 4, your character will mine until the button is clicked again.
- Autorun, toggled with mousebutton 5, no more holding down W for endless amounts of time.
- Autocrouch, toggled with caps lock, you won't fall down, as long as caps lock is down.
- Ctrl-H Utilizes the /home command. I have the serveradmin commands I use the most, mapped up to other hotkeys. You can easily make your own, just by using this as a template.
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#IfWinActive, Minecraft
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Gathering - Hold down Left Mouse Button
;; Toggled with Mouse button 5.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Xbutton2::
If GetKeyState("Lbutton")
Send {Lbutton Up}
else
Send {Lbutton Down}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Toggle Autorun
;; Toggled with Mouse button 4.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Xbutton1::
If GetKeyState("w")
Send {w Up}
else
Send {w Down}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Toggle crouch
;; Toggled with Ctrl-R
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#IfWinActive, Minecraft
^r::
GetKeyState, state, Shift
if state = D
Send {LShift Up}
else
Send {LShift Down}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; use /home
;; Toggled with Ctrl-H
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^h::
Send t/home {enter}
return
I think that Worldedit and Autohotkey is a match made in heaven. Below is a script that gives hotkeys for the most common commands, for instance Ctrl-C to copy, Ctrl-V to paste and so on. Check it out and tell me what you think.
Note that ^=Ctrl, so for example "^1" means you need to press Ctrl-1.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; WORLDEDIT SCRIPT 0.2 by Avien
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#singleinstance force
#IfWinActive, Minecraft
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Disable F11
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
F11::Return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Set pos1
;; Toggled with Ctrl-1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^1::
Send t//pos1 {enter}
return
^Numpad1::
Send t//pos1 {enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Set pos2
;; Toggled with Ctrl-2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^2::
Send t//pos2 {enter}
return
^Numpad2::
Send t//pos2 {enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Set (fill in number and press enter)
;; Toggled with Ctrl-5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^5::
Send t//set{space}
return
^Numpad5::
Send t//set{space}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Copy
;; Toggled with Ctrl-C
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^C::
Send t//copy{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Paste
;; Toggled with Ctrl-V
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^V::
Send t//paste{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Delete
;; Toggled with Ctrl-Del
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^delete::
Send t//set 0{enter}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Cut
;; Toggled with Ctrl-X
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^X::
Send t//copy{enter}
Send t//set 0{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Undo
;; Toggled with Ctrl-Z
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^Z::
Send t//undo{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Delete all in radius 10
;; Toggled with Ctrl-Backspace
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^Backspace::
Send t//sphere 0 10{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Paste with air
;; Toggled with Ctrl-Ins
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^Insert::
Send t//pasteair{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Smooth (tip: use 20 times)
;; Toggled with Ctrl-Home
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^Home::
Send t//smooth{enter}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Fixwater in radius 10, good for swimming.
;; Toggled with Ctrl-Spacebar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
^Space::
Send t/fixwater 10{enter}
return
If your getting pains it means you have been playing for more than 2 hours straight.
2 hours? That's a rather arbitrary length of time. Many people can use a computer for much longer than 2 hours and not experience pain in their wrists.
I use Keyboard Express for commonly used commands and have a bot to do repetitive things.
I never said people would get pain on the 2 hour mark. 2 hours straight playing a game isn't recommended (If im correct its meant to be something like every hour take a 10 minute break. Not that anyone does), let alone more. My whole point is that if the guy is getting pains in his wrists then he is playing the game too long without taking any kind of break. So taking breaks should solve his problem and be better than continuing to sit infront of a computer for too long.
I'm trying to figure out a script that'll click mine while I'm holding down a specified key. I'm having trouble with the key hold-down part of it. Anyone have any suggestions?
Umm... I'm trying to use an Autohotkey script that works in Minecraft, but it's not. Can someone PM me a de-bugged version? Basically, all it does it execute some simple commands, like kicking my friends, or saying warnings like Creepers! The problem is, they don't run at all. I don't know what to do.
When I try pressing Ctrl + F, it doesn't do anything.
Does anyone know the problem here?
EDIT - I found out that SCP had the "Bind" command, so I am using that instead.
Rollback Post to RevisionRollBack
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
Um, I dont have a MOUSE4 or 5....how can i change this?
Have a microsoft mouse, but it wont work for some reason, so I have to use this light up mouse that works fine but
I want the keys to be B for auto walk and N for auto mine
Please help!
I've played 8 hours straight without wrist pain, what are you talking about
Seems you have a really huge addiction problem, you should see a doctor about that.
Anyway, this looks like a nice idea. I've been checking all that WorldEdit thing, and it really has a lot of commands, so this will probably help a lot of newbies.
I'm trying to make a script to open up an inputbox to ask what block you want, and then run the //set command with the block type set to what you type in the inputbox, however, the program won't run past the first line of the script. Help?
The Meaning of Life, the Universe, and Everything.
Location:
Stockholm
Join Date:
9/26/2011
Posts:
140
Member Details
I have a strange problem with this. I can manage to get autohotkey to work fine with minecraft, activating the window, sending key clicks, sending number keys to switch between my inventory items...
But if I send a "t", nothing happens. I get my chat bar if I press the t button in-game, but sending it from autohotkey - nada. I've tried remapping the key to something else and had no luck. Yet I see a whole lot of people posting scripts that contain that sort of code.
Help? I've tried everything and can't understand what the problem is. Running on Windows 7 64-bit, if that makes a difference. Tried both 64 bit and 32 bit versions of ahk.
Ahh, perhaps someone here can help me with my issue.
Here is my script:
END::Suspend
RButton::N ; reverse with Right Mouse Button
SPACE::RButton ; space to Place/Use/Split Stack
send {F3 down}
Return
When MC 1.8 came out with the ability to bind functions to mouse keys, I thought I could get around using AHK (and the only reason I want to is because of the extra key-strokes for suspending/re-enabling the script). MC now lets me bind it's own 'use' function to the space bar, but Worldedit's 'use' (brushes, info, repl, pos2 etc) stays bound to mouse-button-2. I would like to bind both sets of functions to the space-bar.
I've been using the same bindings for FPS-type games since Doom I. The above script works just fine, but what I would like to be able to do is eliminate the need to manually suspend the script when I want to type in the console.
After seeing this thread I'm intrigued by some other things I see here, so really, the problem is my own disingenuousness.
Can anyone here tell me how to do ALL of the following:
1. Go backwards with mouse-button-2
2. Place blocks, split stacks, shoot arrows, etc with the space bar
3. Set pos2, use brushes, replace using the /repl tool, get info using /info tool etc with the space bar
4. Type commands in the console (with spaces in them) WITHOUT having to hit another key to suspend AHK (and yet another to re-enable it)
The extra key strokes may not seem like too much trouble to you, and I've almost got myself trained to do them, but as often as I use them it gets really annoying - even more so when I forget.
Please try to refrain from suggesting I use another key configuration. If that was a solution then programs like AHK wouldn't exist, and none of us would be here.
Anyone? Thanks.
Edit to add: I posted about this on the SinglePlayerCommands thread and realized it was more of a Worldedit issue than SPC, so I also posted in the Worldedit thread. I don't mean to spam the forums, I just wasn't sure who to ask.
Autohotkey is a program that lets you create hotkeys for different commands. This is a thread for discussing use of autohotkey macros in minecraft. Do you have some good scripts you want to share with us? Also, if someone have questions, please ask.
I will start off with posting the script I use right now for Minecraft. Half of it was written by fnordcircle of the Something Awful forums, the rest by me. What the script does:
- Automine, toggled with mousebutton 4, your character will mine until the button is clicked again.
- Autorun, toggled with mousebutton 5, no more holding down W for endless amounts of time.
- Autocrouch, toggled with caps lock, you won't fall down, as long as caps lock is down.
- Ctrl-H Utilizes the /home command. I have the serveradmin commands I use the most, mapped up to other hotkeys. You can easily make your own, just by using this as a template.
I think that Worldedit and Autohotkey is a match made in heaven. Below is a script that gives hotkeys for the most common commands, for instance Ctrl-C to copy, Ctrl-V to paste and so on. Check it out and tell me what you think.
Note that ^=Ctrl, so for example "^1" means you need to press Ctrl-1.
This script has already alleviated the pain in my wrist.
This program and Avien's script are both HIGHLY recommended to anyone who is more than just a casual player.
Better solution is to actually take breaks from the game. If your getting pains it means you have been playing for more than 2 hours straight.
Minecraft Info - Game Requirements - Minecraft Screensaver - MCI Craft
2 hours? That's a rather arbitrary length of time. Many people can use a computer for much longer than 2 hours and not experience pain in their wrists.
I use Keyboard Express for commonly used commands and have a bot to do repetitive things.
I've played 8 hours straight without wrist pain, what are you talking about
Minecraft Info - Game Requirements - Minecraft Screensaver - MCI Craft
Thanks, appreciate it!
I have copied this script, with minor adaptations, but have given you attribution at the top of the file. You may want to alter that here yourself.
Help!
When I try pressing Ctrl + F, it doesn't do anything.
Does anyone know the problem here?
EDIT - I found out that SCP had the "Bind" command, so I am using that instead.
Instant Blocks Mod - 17 new blocks that generate structures upon right-click. Includes: Farm, Rainbow Skydive, Grinder, Escape Ladder, Water, Lava, Suction, and Statue Blocks.
Have a microsoft mouse, but it wont work for some reason, so I have to use this light up mouse that works fine but
I want the keys to be B for auto walk and N for auto mine
Please help!
How would i go about making a script for move ford with mouse 4 and move back with mouse 5 in autohotkey?
Seems you have a really huge addiction problem, you should see a doctor about that.
Anyway, this looks like a nice idea. I've been checking all that WorldEdit thing, and it really has a lot of commands, so this will probably help a lot of newbies.
But if I send a "t", nothing happens. I get my chat bar if I press the t button in-game, but sending it from autohotkey - nada. I've tried remapping the key to something else and had no luck. Yet I see a whole lot of people posting scripts that contain that sort of code.
Help? I've tried everything and can't understand what the problem is. Running on Windows 7 64-bit, if that makes a difference. Tried both 64 bit and 32 bit versions of ahk.
Here is my script:
When MC 1.8 came out with the ability to bind functions to mouse keys, I thought I could get around using AHK (and the only reason I want to is because of the extra key-strokes for suspending/re-enabling the script). MC now lets me bind it's own 'use' function to the space bar, but Worldedit's 'use' (brushes, info, repl, pos2 etc) stays bound to mouse-button-2. I would like to bind both sets of functions to the space-bar.
I've been using the same bindings for FPS-type games since Doom I. The above script works just fine, but what I would like to be able to do is eliminate the need to manually suspend the script when I want to type in the console.
After seeing this thread I'm intrigued by some other things I see here, so really, the problem is my own disingenuousness.
Can anyone here tell me how to do ALL of the following:
1. Go backwards with mouse-button-2
2. Place blocks, split stacks, shoot arrows, etc with the space bar
3. Set pos2, use brushes, replace using the /repl tool, get info using /info tool etc with the space bar
4. Type commands in the console (with spaces in them) WITHOUT having to hit another key to suspend AHK (and yet another to re-enable it)
The extra key strokes may not seem like too much trouble to you, and I've almost got myself trained to do them, but as often as I use them it gets really annoying - even more so when I forget.
Please try to refrain from suggesting I use another key configuration. If that was a solution then programs like AHK wouldn't exist, and none of us would be here.
Anyone? Thanks.
Edit to add: I posted about this on the SinglePlayerCommands thread and realized it was more of a Worldedit issue than SPC, so I also posted in the Worldedit thread. I don't mean to spam the forums, I just wasn't sure who to ask.