summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cactus.lua47
1 files 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()