From 535ba14ccee1dae506ee411c1ce1f1c303bb94e6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 4 Apr 2024 02:18:31 +0100 Subject: launch cactus --- cactus.lua | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/cactus.lua b/cactus.lua index d886086..975842b 100644 --- a/cactus.lua +++ b/cactus.lua @@ -118,16 +118,17 @@ local function dump_and_refuel() for i=1,16 do ch.pullItems(self, i) end - if turtle.getFuelLevel() < 10000 then + while turtle.getFuelLevel() < 2000 then for k,v in pairs(ch.list()) do if v.name == "minecraft:lava_bucket" then ch.pushItems(self, k, 1, 1) turtle.select(1) turtle.refuel() ch.pullItems(self, 1) - break + goto nextfuel end end + ::nextfuel:: end end @@ -139,26 +140,28 @@ local function mainloop() dump_and_refuel() - -- repeat - -- repeat - -- do_column() - -- move_linear(1) - -- until POS.z == -1826 - -- do_column() - -- turn_right() - -- move_linear(1) - -- turn_right() - - -- repeat - -- do_column() - -- move_linear(1) - -- until POS.z == datum.z - -- do_column() - -- turn_left() - -- move_linear(1) - -- turn_left() - - -- until POS.x <= -29 + repeat + repeat + do_column() + move_linear(1) + until POS.z == -1826 + do_column() + turn_right() + move_linear(1) + turn_right() + + repeat + do_column() + move_linear(1) + until POS.z == datum.z + do_column() + turn_left() + move_linear(1) + turn_left() + + until POS.x <= -29 + + os.sleep(120) end mainloop() -- cgit v1.2.3