Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- blocksmined=0
- repeat
- if redstone.getInput("top")then
- -- is there a block in front of us
- if turtle.detect() then
- if turtle.getFuelLevel() <= 0 then
- print("Out of fuel, please give fuel")
- print("Press a key when fuel has been given")
- os.pullEvent("key")
- for i=1,16 do
- turtle.select(i)
- turtle.refuel()
- end
- end
- -- increment blocksmined
- blocksmined=blocksmined+1
- turtle.dig()
- turtle.suck()
- -- check slot 2 of turtle
- -- if an item is in it then
- -- overflow has occurred
- -- trigger the turtle to take
- -- a dump er leave one.
- if turtle.getItemCount(2)>0 then
- for slot=1,16 do
- turtle.select(slot)
- turtle.dropDown()
- end
- end
- end
- else
- break
- end
- term.clear()
- print("Blocksmined")
- print(blocksmined)
- until x == 1
Add Comment
Please, Sign In to add comment