Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- Breaks blocks in front of turtle
- -- S= start , e=end
- --Dig message screem pos. S=start, e=end
- local checkFullInterval = 10
- local checkFullI = 1
- local digC = {start= {x=1,y=1}, ends={x=1,y=1}}
- local pushDirection = "back"
- function resetCursor()
- term.setCursorPos(digC.start.y,digC.ends.y)
- end
- slotsFull = 0
- function turtle.attemptPush()
- if checkFullI == checkFullInterval then
- checkFullI = 1
- slotsFull = 0
- for i=1, 16 do
- turtle.select(i)
- if turtle.getItemCount() > 0 then
- slotsFull = slotsFull + 1
- end
- end
- turtle.select(1)
- else
- end
- checkFullI = checkFullI+1
- if slotsFull > 15 then
- return false
- else
- return true
- end
- end
- function turtle.attemptDig()
- if turtle.detect() then
- turtle.dig()
- return true
- else
- return false
- end
- end
- function term.clearLines(firstLine,lastLine)
- for i=firstLine,lastLine do
- term.clearLine(i)
- end
- end
- while true do
- while not turtle.attemptDig() do
- resetCursor()
- print("nothing to dig")
- print("time: "..tostring(os.time()))
- --resetCursor()
- --sleep(0.1)
- end
- term.clear()
- --term.clearLines(digC.start.y,digC.ends.y+1 )
- --resetCursor()
- while not turtle.attemptPush() do
- print("not enough room")
- end
- end
Add Comment
Please, Sign In to add comment