Created
July 24, 2014 01:39
-
-
Save WolfieMario/6ab80ef6fb377663080a to your computer and use it in GitHub Desktop.
Temporary gist of an AutoHotkey script which provides helpful shortcuts for Minecraft map-makers and server ops. This is a heavily abridged version; the full version is currently a 4885 line WIP with far more features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*===================================================================================*\ | |
| Mapmaking Shortcuts Abridged script copyright WolfieMario | | |
| Feel free to use for your mapmaking endeavors or other purposes, and feel free to | | |
| make modifications, but do not remove this notice if you distribute this script. | | |
| I am not liable for any way in which you use or abuse this script. | | |
\*=================================================================================\ / | |
*/ | |
; If you game is slow and hotkeys seem unstable, make this number bigger. | |
global delayStep := 70 | |
; Its default value is 70. | |
; You can set the default difficulty (used by Butcher (Alt+B) and Purify (Alt+P) here: | |
global defaultDifficulty := "n" | |
; Difficulties recognized by Minecraft: peaceful = p = 0, easy = e = 1, normal = n = 2, and hard = h = 3 | |
/*==============================*\ | |
/ Script Command Reference \ | |
/==============v===========^======v===========================^=========================\ | |
| Alt+Y | Repeat Chat | Repeat last Minecraft command/chat | | |
| Alt+V | Paste Text | Types text from the Windows clipboard. Useful for | | |
| | | signs and book titles, where Ctrl+V won't work. | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+S | Stone Platform | Sets the block below you to stone | | |
| Ctrl+Alt+S | Setblock | Input "/setblock ~ ~ ~ minecraft:" | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+Space | Teleport Up | Teleport 50 blocks up | | |
| Ctl+Alt+Space| Teleport Down | Teleport 1 block down | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+N | Night Vision | Give 100 minutes of Night Vision to self | | |
| Ctrl+Alt+N |Clear Night Vision| Clear Night Vision from self | | |
|Ctl+Alt+Shft+N| Clear Effects | Clear all status effects from self | | |
| Alt+K | Resistance | Give 30 seconds of Resistance 5 to self | | |
| Ctrl+Alt+K | Kill Self | Kill self with /kill | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+M | Creative Mode | /gamemode c (Creative) to self | | |
| Ctrl+Alt+M | Survival Mode | /gamemode s (Survival) to self | | |
| Alt+Shift+M | Spectator Mode | /gamemode sp (Spectator) to self | | |
|Ctl+Alt+Shft+M| Adventure Mode | /gamemode a (Adventure) to self | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+G |Give Command Block| Give self a Command Block | | |
| Ctrl+Alt+G | Give Doubleslab | Input "/give @p minecraft:double_stone_slab 1 " | | |
| | | (8, 9, and 15 are special seamless doubleslabs) | | |
| Alt+Shift+G | Give Redstone Kit| Give self Redstone Dust, Redstone Torch, Repeater, | | |
| | | Comparator, and Sign | | |
|Ctl+Alt+Shft+G| Give Barrier | Give self a Barrier block | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+T | Time Day | Set time to Day (1000) | | |
| Ctrl+Alt+T | Time Night | Set time to Night (14000) | | |
| Alt+W | Weather Clear | Clear weather: /weather clear 1000000 | | |
| Ctrl+Alt+W | Weather Rain | Rainy weather: /weather rain 1000000 | | |
|Ctl+Alt+Shft+W| Weather Thunder | Thundering weather: /weather thunder 1000000 | | |
|--------------|------------------|-----------------------------------------------------| | |
| Alt+B | Butcher | Kill all hostile mobs by switching difficulty to | | |
| | | Peaceful, then back to Normal (configurable) | | |
| Shift+Alt+B | Set Difficulty | Set the difficulty Alt+B switches back to | | |
| Alt+P | Purify | Use Time Day, Weather Clear, & Butcher in sequence | | |
|--------------|------------------|-----------------------------------------------------| | |
| Shift+Alt+[#]| Bind Command | Bind a single line of command/chat to # (0-9) | | |
| Alt+[#] | Bound Command | Execute a command/chat which the above bound to # | | |
| Shft+Ctrl+[#]| Bind Input | Bind a single text input to # (0-9) | | |
| Ctrl+[#] | Bound Input | Type an input which the above bound to # | | |
| Shift+Alt+[#]| Bind Sequence | Bind a sequence of commands/chat to # (0-9) | | |
| Alt+[#] | Bound Sequence | Execute a sequence which the above bound to # | | |
\==============^==================^=====================================================/ | |
|_____ Everything beyond this is actual code. Play at your own risk! | | |
\ /================================================================================/ | |
\ / | |
*/ | |
GroupAdd, Minecraft, ahk_class SunAwtFrame | |
GroupAdd, Minecraft, ahk_class LWJGL | |
#IfWinActive ahk_group Minecraft | |
global bindS := [], bindM := [], bindI := [] | |
!Y:: chat("{Up}") | |
!V:: SendInput % "{Raw}" . RegExReplace(Clipboard, "\r\n?|\n\r?", "`n") | |
!S:: command("setblock ~ ~-1 ~ minecraft:stone") | |
^!S:: input("/setblock ~ ~ ~ minecraft:") | |
!Space:: command("tp ~0 ~50 ~0") | |
^!Space:: command("tp ~0 ~-1 ~0") | |
!N:: command("effect @p 16 6000") | |
^!N:: command("effect @p 16 0") | |
^!+N:: command("effect @p clear") | |
!K:: command("effect @p 11 30 4") | |
^!K:: command("kill") | |
!M:: command("gamemode c") | |
^!M:: command("gamemode s") | |
!+M:: command("gamemode sp") | |
^!+M:: command("gamemode a") | |
!G:: command("give @p minecraft:command_block") | |
^!G:: input("/give @p minecraft:double_stone_slab 1 ") | |
!+G:: | |
command("give @p minecraft:redstone") | |
command("give @p minecraft:redstone_torch") | |
command("give @p minecraft:repeater") | |
command("give @p minecraft:comparator") | |
command("give @p minecraft:sign") | |
Return | |
^!+G:: command("give @p minecraft:barrier") | |
!T:: command("time set 1000") | |
^!T:: command("time set 14000") | |
!W:: command("weather clear 1000000") | |
^!W:: command("weather rain 1000000") | |
^!+W:: command("weather thunder 1000000") | |
!B:: | |
command("difficulty p") | |
command("difficulty " . defaultDifficulty) | |
Return | |
+!B:: | |
result := set("Input Default Difficulty", "Input difficulty for Alt+B to reset to (default ""n"").`n" | |
. "peaceful = p = 0`neasy = e = 1`nnormal = n = 2`nhard = h = 3") | |
if not ErrorLevel | |
defaultDifficulty := result | |
Return | |
!P:: | |
Gosub !T | |
Gosub !W | |
Gosub !B | |
Return | |
!1:: | |
!2:: | |
!3:: | |
!4:: | |
!5:: | |
!6:: | |
!7:: | |
!8:: | |
!9:: | |
!0:: | |
key := getKey() | |
chat("{Raw}" . bindS[key]) | |
Return | |
+!1:: | |
+!2:: | |
+!3:: | |
+!4:: | |
+!5:: | |
+!6:: | |
+!7:: | |
+!8:: | |
+!9:: | |
+!0:: | |
key := getKey() | |
result := setS(key) | |
if not ErrorLevel | |
bindS[key] := result | |
Return | |
^1:: | |
^2:: | |
^3:: | |
^4:: | |
^5:: | |
^6:: | |
^7:: | |
^8:: | |
^9:: | |
^0:: | |
key := getKey() | |
input("{Raw}" . bindI[key]) | |
Return | |
+^1:: | |
+^2:: | |
+^3:: | |
+^4:: | |
+^5:: | |
+^6:: | |
+^7:: | |
+^8:: | |
+^9:: | |
+^0:: | |
key := getKey() | |
result := setI(key) | |
if not ErrorLevel | |
bindI[key] := result | |
Return | |
^!1:: | |
^!2:: | |
^!3:: | |
^!4:: | |
^!5:: | |
^!6:: | |
^!7:: | |
^!8:: | |
^!9:: | |
^!0:: | |
key := getKey() | |
For index, text in bindM[key] | |
chat("{Raw}" . text) | |
Return | |
+^!1:: | |
+^!2:: | |
+^!3:: | |
+^!4:: | |
+^!5:: | |
+^!6:: | |
+^!7:: | |
+^!8:: | |
+^!9:: | |
+^!0:: | |
key := getKey() | |
num := set("Bind Multichat " . key, "How many lines of chat would you like to bind?") | |
if not ErrorLevel | |
{ | |
original := bindM[key] | |
bindM[key] := [] | |
Loop %num% | |
{ | |
result := setM(key, A_Index) | |
if ErrorLevel | |
{ | |
bindM[key] := original | |
Break | |
} | |
else | |
bindM[key][A_Index] := result | |
} | |
} | |
Return | |
getKey() | |
{ | |
StringRight, key, A_ThisLabel, 1 | |
Return key | |
} | |
set(title, input) | |
{ | |
InputBox, value, %title%, %input% | |
Return value | |
} | |
setS(bind) | |
{ | |
Return set("Bind Chat " . bind, "Enter the chat or command to bind to Alt+" . bind . " (currently """ . bindS[bind] . """):") | |
} | |
setI(bind) | |
{ | |
Return set("Bind Input " . bind, "Enter the input to bind to Ctrl+" . bind . " (currently """ . bindI[bind] . """):") | |
} | |
setM(bind, num) | |
{ | |
Return set("Bind Multichat " . bind . ":" . num, "Enter the chat or command to bind to Ctrl+Alt+" . bind . ", line " . num . ":") | |
} | |
command(cmd) | |
{ | |
SendInput / | |
Sleep delayStep | |
SendInput %cmd% | |
Sleep delayStep | |
SendInput {Enter} | |
Sleep delayStep | |
} | |
chat(text) | |
{ | |
SendInput t | |
Sleep delayStep | |
SendInput %text% | |
Sleep delayStep | |
SendInput {Enter} | |
Sleep delayStep | |
} | |
input(text) | |
{ | |
SendInput t | |
Sleep delayStep | |
SendInput %text% | |
Sleep delayStep | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment