worked on mining room app. But isn't finished yet

This commit is contained in:
Sascha Martens 2020-11-21 22:25:41 +01:00
parent 69e0a4555a
commit a1a3673536
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,50 @@
os.loadAPI("modules.lua")
print("How long should I dig?")
local length = read()
print("How wide should I dig?")
local width = read()
print("How high should I dig?")
local height = read()
local front = true
for i = 1, width do
for j = 1, height do
for k = 1, length do
modules.check_fuel()
turtle.dig()
turtle.forward()
end
if j ~= height do
modules.check_fuel()
turtle.digUp()
turtle.up()
end
turtle.turnLeft()
turtle.turnLeft()
front = not front
end
for tdown = 1, height do
modules.check_fuel()
turtle.down()
end
turtle.turnLeft()
turtle.turnLeft()
if not front then
for tfront = 1, length do
modules.check_fuel()
turtle.forward()
end
end
turtle.turnRight()
for twidth = 1, width -1 do
turtle.forward()
end
turtle.turnLeft()
modules.puke()
turtle.turnLeft()
for twidth = 1, width do
turtle.forward()
end
turtle.turnLeft()
end

View File

@ -220,3 +220,4 @@ function check_fuel()
refueled = true
end
end
end