SHOW:
|
|
- or go back to the newest paste.
| 1 | blocksmined=0 | |
| 2 | repeat | |
| 3 | - | turtle.dig() |
| 3 | + | |
| 4 | - | turtle.suck() |
| 4 | + | |
| 5 | - | -- check slot 2 of turtle |
| 5 | + | -- is there a block in front of us |
| 6 | - | -- if an item is in it then |
| 6 | + | if turtle.detect() then |
| 7 | - | -- overflow has occurred |
| 7 | + | |
| 8 | - | -- trigger the turtle to take |
| 8 | + | if turtle.getFuelLevel() <= 0 then |
| 9 | - | -- a dump er leave one. |
| 9 | + | print("Out of fuel, please give fuel")
|
| 10 | - | if turtle.getItemCount(2)>0 then |
| 10 | + | print("Press a key when fuel has been given")
|
| 11 | - | while true do |
| 11 | + | os.pullEvent("key")
|
| 12 | - | for slot=1,16 do |
| 12 | + | for i=1,16 do |
| 13 | - | turtle.select(slot) |
| 13 | + | turtle.select(i) |
| 14 | - | turtle.dropDown() |
| 14 | + | turtle.refuel() |
| 15 | - | end |
| 15 | + | end |
| 16 | - | end |
| 16 | + | end |
| 17 | - | end |
| 17 | + | |
| 18 | -- increment blocksmined | |
| 19 | blocksmined=blocksmined+1 | |
| 20 | turtle.dig() | |
| 21 | turtle.suck() | |
| 22 | ||
| 23 | -- check slot 2 of turtle | |
| 24 | -- if an item is in it then | |
| 25 | -- overflow has occurred | |
| 26 | -- trigger the turtle to take | |
| 27 | -- a dump er leave one. | |
| 28 | if turtle.getItemCount(2)>0 then | |
| 29 | for slot=1,16 do | |
| 30 | turtle.select(slot) | |
| 31 | turtle.dropDown() | |
| 32 | end | |
| 33 | end | |
| 34 | ||
| 35 | end | |
| 36 | ||
| 37 | else | |
| 38 | break | |
| 39 | end | |
| 40 | term.clear() | |
| 41 | print("Blocksmined")
| |
| 42 | print(blocksmined) | |
| 43 | until x == 1 |