Advertisement
Guest User

fence

a guest
Sep 22nd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. blocks = 0
  2. fuel = turtle.getFuelLevel()
  3. fences = turtle.getItemCount(1)
  4.  
  5. function refuel()
  6.   turtle.select(15)
  7.   turtle.place()
  8.   turtle.select(14)
  9.   turtle.suck()
  10.   turtle.refuel()
  11.   turtle.select(15)
  12.   turtle.dig()
  13. end
  14.  
  15. function refill()
  16.   turtle.select(16)
  17.   turtle.place()
  18.   turtle.select(1)
  19.   turtle.suck()
  20.   turtle.select(16)
  21.   turtle.dig()
  22. end
  23.  
  24. function chunks()
  25.   blocks = 0
  26.   turtle.turnLeft()
  27.   turtle.dig()
  28.   turtle.select(12)
  29.   turtle.place()
  30.   turtle.turnLeft()
  31.   for i = 1, 16 do
  32.     turtle.forward()
  33.   end
  34.   turtle.turnRight()
  35.   turtle.dig()
  36.   turtle.turnRight()
  37.   for i = 1, 16 do
  38.     turtle.forward()
  39.   end
  40. end
  41.  
  42. function place()
  43.   fuel = turtle.getFuelLevel()
  44.   fences = turtle.getItemCount(1)
  45.   if fuel<1000 then
  46.     refuel()
  47.   end
  48.   if fences<1 then
  49.     refill()
  50.   end
  51.   turtle.select(1)
  52.   turtle.dig()
  53.   turtle.digDown()
  54.   turtle.placeDown()
  55.   turtle.forward()
  56.   blocks = blocks + 1
  57.   if blocks==16 then
  58.     chunks()
  59.   end
  60. end
  61.  
  62. for i=1,4 do
  63.   for i=1,63 do
  64.     place()
  65.   end
  66.   turtle.turnRight()
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement