Last active
August 29, 2015 14:10
-
-
Save ProgrammerDan/5f8815adba78c3c38f93 to your computer and use it in GitHub Desktop.
Cactus Farm Generation
This file contains 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
$${ | |
// Before getting started, I recommend the following | |
// hotbar config: | |
// 1) Stack of cactus | |
// 2) Stack of sand | |
// 3) Stack of signs | |
// 4) Stack of cobble | |
// 5) Diamond pickaxe | |
// Put 4 stacks of cactus and sand, 8 stacks | |
// of signs, 8 stacks of cobble in your general | |
// inventory. This script will autofill the hotbar | |
// from your general inventory. | |
// You should definitely be able to get a full | |
// vertical from this setup. | |
// Finally, do your best to be in the exact middle | |
// of the starting block before you trigger the | |
// script. Bind it to a key in Macromod -- | |
// $$<cactusfarm-sign.txt> -- for instance. | |
// Enjoy! | |
if(autocactusfarm); | |
log("&2[Macro] &fAutoCactusFarm has stopped"); | |
unset(autocactusfarm); | |
keyup(sneak); | |
stop(); | |
else; | |
log("&2[Macro] &fAutoCactusFarm has started"); | |
set(autocactusfarm); | |
set(#startx, %XPOS%); | |
set(#startz, %ZPOS%); | |
keydown(sneak); | |
//LOOP | |
DO($$?); | |
Gui(inventory); | |
FOR(#slott,9,35); | |
slotclick(%#slott%,l,true) | |
NEXT; | |
Gui(); | |
wait(250ms); | |
keydown(sneak); | |
LOOK(180,90, .5); | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
// CENTER COLUMN | |
wait(250ms); | |
LOOK(180,90, .5); | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
// NORTH CONNECTOR | |
LOOK(180,80, .5); | |
wait(250ms); | |
keydown(back); | |
wait(1250ms); | |
keyup(back); | |
key(use); | |
// PANEL NW | |
LOOK(90,80, .5); | |
wait(250ms); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
key(use); | |
// PANEL NE | |
LOOK(270,80, .5); | |
wait(250ms); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
key(use); | |
// RETURN TO CENTER | |
LOOK(225,80, .5); | |
do(); | |
keydown(forward); | |
wait(250ms); | |
until(%XPOS% = %#startx%); | |
wait(250ms); | |
keyup(forward); | |
LOOK(0,70, .5); | |
// PREP FOR REMOVAL | |
pick(diamond_pickaxe); | |
set(#btime, 10) | |
if(%ITEM% != "diamond_pickaxe"); | |
pick(iron_pickaxe); | |
set(#btime, 12) | |
if(%ITEM% != "iron_pickaxe"); | |
pick(gold_pickaxe); | |
set(#btime, 8) | |
if(%ITEM% != "gold_pickaxe"); | |
pick(stone_pickaxe); | |
set(#btime, 18) | |
if(%ITEM% != "stone_pickaxe"); | |
unset(autocactusfarm); | |
log("&2[Macro] &fNo pickaxe found, failure!"); | |
stop(); | |
endif; | |
endif; | |
endif; | |
endif; | |
// REMOVE CONNECTOR | |
do(%#btime%); | |
key(attack); | |
loop; | |
// SOUTH CONNECTOR | |
pick(cobblestone); | |
LOOK(0,80, .5); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
key(use); | |
// PANEL SW | |
LOOK(90,80, .5); | |
wait(350ms); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
key(use); | |
// PANEL SE | |
LOOK(270,80, .5); | |
wait(350ms); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
key(use); | |
// RETURN TO CENTER | |
LOOK(315,80, .5); | |
do(); | |
keydown(forward); | |
wait(250ms); | |
until(%XPOS% = %#startx%); | |
wait(250ms); | |
keyup(forward); | |
LOOK(180,70, .5); | |
// PREP FOR REMOVAL | |
pick(diamond_pickaxe); | |
set(#btime, 10) | |
if(%ITEM% != "diamond_pickaxe"); | |
pick(iron_pickaxe); | |
set(#btime, 12) | |
if(%ITEM% != "iron_pickaxe"); | |
pick(gold_pickaxe); | |
set(#btime, 8) | |
if(%ITEM% != "gold_pickaxe"); | |
pick(stone_pickaxe); | |
set(#btime, 18) | |
if(%ITEM% != "stone_pickaxe"); | |
unset(autocactusfarm); | |
log("&2[Macro] &fNo pickaxe found, failure!"); | |
stop(); | |
endif; | |
endif; | |
endif; | |
endif; | |
// REMOVE CONNECTOR | |
do(%#btime%); | |
key(attack); | |
loop; | |
// ONE STEP UP | |
LOOK(180,90, .5); | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
wait(250ms); | |
// PLACE NW SAND | |
LOOK(315,61, .5); | |
pick(sand); | |
wait(350ms); | |
key(use); | |
// PLACE NE SAND | |
LOOK(45, 61, .5); | |
wait(350ms); | |
key(use); | |
// PLACE SE SAND | |
LOOK(135,61, .5); | |
wait(350ms); | |
key(use); | |
// PLACE SW SAND | |
LOOK(225,61, .5); | |
wait(350ms); | |
key(use); | |
// ONE STEP UP | |
LOOK(180,90, .5); | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
wait(250ms); | |
// ONE STEP UP | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
wait(250ms); | |
// PLACE NW CACTUS | |
LOOK(315,61, .5); | |
pick(cactus); | |
wait(350ms); | |
key(use); | |
// PLACE NE CACTUS | |
LOOK(45, 61, .5); | |
wait(350ms); | |
key(use); | |
// PLACE N sign | |
LOOK(180,80, .5); | |
wait(250ms); | |
keydown(back); | |
wait(1250ms); | |
keyup(back); | |
pick(sign); | |
wait(1000ms); | |
Placesign(,,,,false); | |
wait(1000ms); | |
keydown(forward); | |
wait(200ms); | |
keyup(forward); | |
keyup(sneak); | |
keydown(sneak); | |
// PLACE SE CACTUS | |
LOOK(135,65, .5); | |
pick(cobblestone); | |
wait(1000ms); | |
key(use); | |
pick(cactus); | |
wait(750ms); | |
key(use); | |
// PLACE SW CACTUS | |
LOOK(225,65, .5); | |
wait(350ms); | |
key(use); | |
// PLACE S sign | |
LOOK(0,81, .5); | |
wait(250ms); | |
keyup(sneak); | |
keydown(sneak); | |
pick(cobblestone); | |
keydown(back); | |
wait(1500ms); | |
keyup(back); | |
pick(sign); | |
wait(250ms); | |
Placesign(,,,,false); | |
wait(1000ms); | |
keydown(forward); | |
wait(100ms); | |
keyup(forward); | |
wait(500ms); | |
keyup(sneak); | |
keydown(sneak); | |
// ONE STEP UP | |
LOOK(180,90, .5); | |
pick(cobblestone); | |
press(space); | |
wait(350ms); | |
key(use); | |
wait(350ms); | |
LOOP; | |
unset(autocactusfarm); | |
keyup(sneak); | |
stop(); | |
endif; | |
}$$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lines 251-253 and 284-288 are all BS lines to overcome a server limitation where the first blocks placed after sign placement are prevented by the server. On other servers or on single player, comment out these lines.