Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("progressAPI.lua")
- fuelUse = 5
- length = 0
- startFuel = 0
- minReqFuelLevel = 0
- function termClear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function checkFuel()
- if startFuel <= minReqFuelLevel then
- error("Not enough fuel..")
- end
- end
- function startUp()
- termClear()
- print("Enter length of shaft:")
- length = read() - 1
- minReqFuelLevel = length * fuelUse
- turtle.select(1)
- startFuel = turtle.getFuelLevel()
- checkFuel()
- end
- function sendProgress(loop, duration)
- rednet.open("right")
- msg = loop .. ";" .. duration
- rednet.broadcast(msg)
- rednet.close("right")
- end
- function row()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- turtle.back()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digDown()
- turtle.digUp()
- turtle.back()
- turtle.turnLeft()
- end
- startUp()
- for i = 0, length do
- termClear()
- progressAPI.statusBar(i, length)
- sendProgress(i, length)
- row()
- end
Add Comment
Please, Sign In to add comment