worked on mining room app. But isn't finished yet
This commit is contained in:
parent
69e0a4555a
commit
a1a3673536
50
Mining_Things/mining_room.lua
Normal file
50
Mining_Things/mining_room.lua
Normal 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
|
@ -220,3 +220,4 @@ function check_fuel()
|
||||
refueled = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user