SHOW:
|
|
- or go back to the newest paste.
| 1 | - | ----Quarry Bot Redux---- |
| 1 | + | --Miner by Block Change-- |
| 2 | ||
| 3 | - | --Variables-- |
| 3 | + | --Global Var-- |
| 4 | t = turtle | |
| 5 | base = t.inspect() | |
| 6 | ||
| 7 | --Functions-- | |
| 8 | function mine() | |
| 9 | - | function f() |
| 9 | + | if not (t.inspect() == base) then |
| 10 | - | if t.detect() then |
| 10 | + | |
| 11 | return true | |
| 12 | - | t.forward() |
| 12 | + | |
| 13 | return false | |
| 14 | - | t.forward() |
| 14 | + | |
| 15 | end | |
| 16 | ||
| 17 | - | function d() |
| 17 | + | |
| 18 | - | if t.detectDown() then |
| 18 | + | --select and place chest- |
| 19 | - | t.digDown() |
| 19 | + | t.select(1) |
| 20 | - | t.down() |
| 20 | + | |
| 21 | --store all besides first 2 slots-- | |
| 22 | - | t.down() |
| 22 | + | for i=16,3,-1 do |
| 23 | t.select(i) | |
| 24 | t.dropUp() | |
| 25 | end | |
| 26 | - | function refuel() |
| 26 | + | --select chest slot, get chest-- |
| 27 | - | if t.getFuelLevel() == 0 then |
| 27 | + | t.select(1) |
| 28 | - | pleaseRefuel() |
| 28 | + | |
| 29 | - | end |
| 29 | + | |
| 30 | function replace() | |
| 31 | --select and place chest-- | |
| 32 | - | if t.getItemCount(16) > 0 then |
| 32 | + | |
| 33 | - | pleaseStore() |
| 33 | + | |
| 34 | --select item slot and get item-- | |
| 35 | t.select(3) | |
| 36 | t.suckUp(1) | |
| 37 | - | function pleaseRefuel() |
| 37 | + | --replace item-- |
| 38 | - | t.select(1) |
| 38 | + | t.place() |
| 39 | --select chest slot-- | |
| 40 | t.select(2) | |
| 41 | - | t.suckUp() |
| 41 | + | --get chest-- |
| 42 | - | t.refuel() |
| 42 | + | |
| 43 | end | |
| 44 | ||
| 45 | - | function pleaseStore() |
| 45 | + | function cycle() |
| 46 | if mine() then | |
| 47 | store() | |
| 48 | replace() | |
| 49 | - | num = 3 |
| 49 | + | |
| 50 | - | while num < 17 do |
| 50 | + | |
| 51 | - | t.select(num) |
| 51 | + | |
| 52 | --Main-- | |
| 53 | - | num = num + 1 |
| 53 | + | function main() |
| 54 | while true do | |
| 55 | cycle() | |
| 56 | end | |
| 57 | end | |
| 58 | ||
| 59 | - | function checkers() |
| 59 | + | main() |