ComputerCraft/Mining_Things/mining_room.lua

51 lines
964 B
Lua

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