Added a mining app which mines a room
This commit is contained in:
parent
8e92de7a16
commit
69e0a4555a
@ -195,3 +195,28 @@ function findBlock(name)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- puke() puke everything that is in the turtles
|
||||||
|
-- inventory out in front of it (hopefully there is
|
||||||
|
-- a chest
|
||||||
|
function puke()
|
||||||
|
for i = 1, 16 do
|
||||||
|
turtle.select(i)
|
||||||
|
turtle.drop()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Check Fuel checks if the turtle has enough fuel.
|
||||||
|
-- if not, it asks for fuel in slot 1 and refuels.
|
||||||
|
function check_fuel()
|
||||||
|
local refueled = false
|
||||||
|
while not refueled do
|
||||||
|
if turtle.getFuelLevel() == 0 then
|
||||||
|
print("Fuel is empty. Please put fuel in slot 1 and press a key.")
|
||||||
|
read()
|
||||||
|
turtle.select(1)
|
||||||
|
turtle.refuel()
|
||||||
|
else
|
||||||
|
refueled = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user