Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ╒═══════════════════════════════════════════════════════════════════════════════════════════════════════╕
- │ Configuration │
- ╞══════════════════════════════════════╦════════════════════════════════════════════════════════════════╡
- │; ║ │
- │; ║ # Coordinates of chests to collect iron from │
- │; UnSet(#y[]); ║ │
- │; UnSet(#x[]); ║ │
- │; #x[] = 0; #y[] = 90; ║ │
- │; #x[] = 0; #y[] = 50; ║ │
- │; #x[] = 0; #y[] = 40; ║ │
- │; #x[] = 0; #y[] = 0; ║ │
- │; #x[] = 0; #y[] = 320; ║ │
- │; #x[] = 0; #y[] = 310; ║ │
- │; #x[] = 0; #y[] = 270; ║ │
- │; ║ │
- │; #chest_open_fail_timeout = 60; ║ # Timeout before abort if a chest fails to open │
- │; ║ (in ticks (1/20'th of a second)) │
- │; ║ │
- │; #command_timeout = 60; ║ # Timeout before abort if inventory remains full │
- │; ║ after calling /block and /pv1 (in ticks (1/20 of a second)) │
- │; ║ │
- └──────────────────────────────────────╨────────────────────────────────────────────────────────────────┘
- ╒══════════════════════════════════════════════╕
- │ Toggle guard │
- ╞══════════════════════════════════════════════╡
- │; IF(automine); │
- │; log("&5[Macro] &7AutoBlocker Disabled");│
- │; unset(automine); │
- │; stop; │
- │; ENDIF; │
- │; log("&5[Macro] &7AutoBlocker Enabled"); │
- │; set(automine); │
- └──────────────────────────────────────────────┘
- ╒══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╕
- │ AutoBlocker script │
- ╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
- │ │
- │ ╒══════════════════════════════════════════════════════════════════════════════════════════════════════════════╕ │
- │ │ Iron gathering │ │
- │ ╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════╡ │
- │ │; ForEach(#y[],#y,#i); ;│ │
- │ │; log("&5[Macro] &7AutoBlocker next chest"); ;│ │
- │ │; Look(%#y%,%#x[%#i%]%); ;│ │
- │ │; Wait(2t); ;│ │
- │ │; key(use); ;│ │
- │ │ │ │
- │ │ ╒═══════════════════════════════════════════════════════════════════╕ │ │
- │ │ │ Wait until chest opens or throw error ╳ │ │ │
- │ │ ╞═══════════════════════════════════════════════════════════════════╡ │ │
- │ │ │; Log("&5[Macro] &7AutoBlocker waiting for next chest"); ;│ │ │
- │ │ │; DO(%#chest_open_fail_timeout%);Until(GUI = "GUICHEST"); ;│ │ │
- │ │ │; IF(GUI != "GUICHEST"); ;│ │ │
- │ │ │; Log("&5[Macro] &cAutoBlocker error: Chest was not opened"); ;│ │ │
- │ │ │; UnSet(automine); ;│ │ │
- │ │ │; STOP; ;│ │ │
- │ │ │; ENDIF; ;│ │ │
- │ │ │; ;│ │ │
- │ │ └───────────────────────────────────────────────────────────────────┘ │ │
- │ │; Log("&5[Macro] &7AutoBlocker next chest"); ;│ │
- │ │ │ │
- │ │ ╒════════════════════════════════════════════════════════════════════════════════════════════════════════╕│ │
- │ │ │ Collect iron (crafing if full) ││ │
- │ │ ╞════════════════════════════════════════════════════════════════════════════════════════════════════════╡│ │
- │ │ │; #max = CONTAINERSLOTS - 37; ;││ │
- │ │ │; #marker_slot = CONTAINERSLOTS - 36; ;││ │
- │ │ │; For(#slot,0,%#max%); ;││ │
- │ │ │; GetSlotItem(%#slot%,&item,#amount); ;││ │
- │ │ │; IF( (&item = "iron_ingot") && (#amount = 64) ); ;││ │
- │ │ │; SlotClick(%#slot%,l,true); ;││ │
- │ │ │; ENDIF; ;││ │
- │ │ │; ;││ │
- │ │ │; GetSlotItem(%#marker_slot%,&item,#amount); ;││ │
- │ │ │; IF( (&item = "iron_ingot") && (#amount = 64) ); ;││ │
- │ │ │; ;││ │
- │ │ │ ╒══════════════════════════════════════════════════════════════════════════════════════════════════╕││ │
- │ │ │ │ Craft iron into blocks ╳ │││ │
- │ │ │ ╞══════════════════════════════════════════════════════════════════════════════════════════════════╡││ │
- │ │ │ │; # Sell ;│││ │
- │ │ │ │; Echo(/clear); ;│││ │
- │ │ │ │; Do(3); ;│││ │
- │ │ │ │; Echo(/give %PLAYER% iron_block 64); ;│││ │
- │ │ │ │; Echo(/give %PLAYER% iron_block 64); ;│││ │
- │ │ │ │; Loop; ;│││ │
- │ │ │ │; ;│││ │
- │ │ │ │; # Wait until sold ;│││ │
- │ │ │ │; DO(%#command_timeout%); ;│││ │
- │ │ │ │; GetSlotItem(80,&item); ;│││ │
- │ │ │ │; Until(&item = "air"); ;│││ │
- │ │ │ │; ;│││ │
- │ │ │ │; # On timeout throw error ;│││ │
- │ │ │ │; IF(&item != "air"); ;│││ │
- │ │ │ │; Log("&5[Macro] &cAutoBlocker error: Could not make space in inventory (could not craft?)");;│││ │
- │ │ │ │; UnSet(automine); ;│││ │
- │ │ │ │; STOP; ;│││ │
- │ │ │ │; ENDIF; ;│││ │
- │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘││ │
- │ │ │; ENDIF; ;││ │
- │ │ │; Next; ;││ │
- │ │ └────────────────────────────────────────────────────────────────────────────────────────────────────────┘│ │
- │ │; Gui(); ;│ │
- │ │; Log("&5[Macro] &7AutoBlocker chest done"); ;│ │
- │ │; Next; ;│ │
- │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │
- │ │
- │ │
- │ │
- │ ╒══════════════════════════════════════════════════════════════════════════════════════════════════════════════╕ │
- │ │ Iron depositing │ │
- │ ╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════╡ │
- │ │; look(+0,90); ;│ │
- │ │; key(use); ;│ │
- │ │; Log("&5[Macro] &7AutoBlocker depositing iron, waiting for chest open"); ;│ │
- │ │ ╒═══════════════════════════════════════════════════════════════════╕ │ │
- │ │ │ Wait until chest open or throw error │ │ │
- │ │ ╞═══════════════════════════════════════════════════════════════════╡ │ │
- │ │ │; DO(%#chest_open_fail_timeout%);Until(GUI = "GUICHEST"); ;│ │ │
- │ │ │; IF(GUI != "GUICHEST"); ;│ │ │
- │ │ │; Log("&5[Macro] &cAutoBlocker error: Chest was not opened"); ;│ │ │
- │ │ │; UnSet(automine); ;│ │ │
- │ │ │; STOP; ;│ │ │
- │ │ │; ENDIF; ;│ │ │
- │ │ └───────────────────────────────────────────────────────────────────┘ │ │
- │ │; Log("&5[Macro] &7AutoBlocker chest is open, depositing"); ;│ │
- │ │; DO; ;│ │
- │ │; GetSlot(iron_block,#slot,27); ;│ │
- │ │; IF(#slot = -1); ;│ │
- │ │; Break; ;│ │
- │ │; ELSE; ;│ │
- │ │; SlotClick(%#slot%,l,true); ;│ │
- │ │; ENDIF; ;│ │
- │ │; WHILE(GUI="GUICHEST"); ;│ │
- │ │; Gui() ;│ │
- │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ │
- │ │
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
- ╒═══════════════════════╕
- │ End Guard │
- ╞═══════════════════════╡
- │; unset(automine); ;│
- └───────────────────────┘
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement