Advertisement
aregrubb

Simples Birch Farm

Nov 20th, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. function refuel()
  2.         if turtle.getFuelLevel() ~= "unlimited" and turtle.getFuelLevel() < 1 then
  3.                     repeat
  4.                             turtle.select(1)
  5.                             if turtle.getItemCount( turtle.getSelectedSlot() ) == 0 then
  6.                                 print("Out of fuel! Put fuel in first slot.")
  7.                                 print("Press any key to continue")
  8.                                 os.pullEvent("key")
  9.                             else
  10.                             end
  11.                     until turtle.getItemCount( turtle.getSelectedSlot() ) > 0
  12.                     print("refueling")
  13.                     turtle.refuel()        
  14.         end
  15. end
  16.  
  17. function sucker()
  18.             c = 4
  19.         for c = 4,1,-1 do
  20.             turtle.suck()
  21.             turtle.turnRight()
  22.         end
  23. end
  24.  
  25. a = 0
  26.  
  27. while true do
  28.     local success, ifgravel = turtle.inspect()
  29.     if ifgravel.name == "minecraft:log" then
  30.             turtle.dig()
  31.             turtle.digUp()
  32.             turtle.up()
  33.             a = a +1
  34.             x=2
  35.     else
  36.         for b = a,1,-1 do
  37.             turtle.down()
  38.         end
  39.         turtle.select(2)
  40.         turtle.place()
  41.         if x == 2 then
  42.                 turtle.turnRight()
  43.                 for T = 1,4,1 do
  44.                         sucker()
  45.                         turtle.forward()
  46.                         sucker()
  47.                         turtle.turnLeft()
  48.                         turtle.forward()
  49.                 end
  50.                 turtle.turnLeft()
  51.         end
  52.         x = 1
  53.         a = 0
  54.         turtle.select(3)
  55.         turtle.place()
  56.        
  57.         turtle.select(4)
  58.         os.sleep(1)
  59.     end
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement