Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- imports
- local rS = require("returnSupplies")
- local cl = require("collect")
- local dR = require("doRefuel")
- -- definition
- local function tryDown()
- if not dR.doRefuel() then
- print("Not enough Fuel")
- rS.returnSupplies()
- end
- while not turtle.down() do
- if turtle.detectDown() then
- if turtle.digDown() then
- if not cl.collect() then
- rS.returnSupplies()
- end
- else
- return false
- end
- elseif turtle.attackDown() then
- if not cl.collect() then
- rS.returnSupplies()
- end
- else
- sleep(0.5)
- end
- end
- depth = depth + 1
- if math.fmod(depth, 10) == 0 then
- print("Descended " .. depth .. " metres.")
- end
- return true
- end
- -- export
- return { tryDown = tryDown }
Add Comment
Please, Sign In to add comment