Advertisement
CaptainSpaceCat

Automatic Vertical Digger

May 30th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. local rf = 5000000
  2. local rfItem, digitem = "blockCapBank", "blockMiner"
  3.  
  4. function getInvoItem(str)
  5.   for i = 1, 16 do
  6.     turtle.select(i)
  7.     local d = turtle.getItemDetail()
  8.     if d and string.find(d.name, str) then
  9.       return true
  10.     end
  11.   end
  12.   return false
  13. end
  14.  
  15. local distance = 0
  16.  
  17. while rf >= 1500 do
  18.   for i = 1, 5 do
  19.     turtle.forward()
  20.     distance = distance + 1
  21.   end
  22.   getInvoItem(digItem)
  23.   turtle.place()
  24.   turtle.up()
  25.   getInvoItem(rfItem)
  26.   turtle.place()
  27.   turtle.down()
  28.   local c = 100
  29.   while c > 0 do
  30.     if turtle.suck(1) then
  31.       c = 100
  32.       rf = rf - 1500
  33.     else
  34.       c = c - 1
  35.     end
  36.     sleep(.5)
  37.   end
  38.   turtle.dig()
  39.   turtle.up()
  40.   turtle.dig()
  41.   turtle.down()
  42. end
  43.  
  44. turtle.turnLeft()
  45. turtle.turnLeft()
  46. while distance > 0 do
  47.   turtle.forward()
  48.   distance = distance - 1
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement