Advertisement
JMANN2400

Tree Farm Creator

Jul 30th, 2017
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1.  
  2. d = 9
  3.  
  4. function placeDirt()
  5.     turtle.select(d)
  6.     if turtle.getItemCount() > 0 then
  7.  
  8.     else
  9.         if d == 16 then
  10.             error()
  11.         else
  12.             d = d + 1
  13.             turtle.select(d)
  14.         end
  15.     end
  16.     turtle.placeDown()
  17.     turtle.back()
  18. end
  19.  
  20. function placeTree()
  21.     turtle.select(5)
  22.     if turtle.getItemCount() > 0 then
  23.         turtle.place()
  24.     else
  25.         error()
  26.     end
  27. end
  28.  
  29.  
  30.  
  31. print("+-------------------------------------+")
  32. print("| Auto Tree Farm Creator              |")
  33. print("+-------------------------------------+")
  34. print("| Slot 1: Fuel                        |")
  35. print("| Slot 5: Saplings                    |")
  36. print("| Slot 9-16: Dirt/Grass               |")
  37. print("+-------------------------------------+")
  38. print("| Place turtle facing away from       |")
  39. print("| desired direction. Insert items.    |")
  40. print("| Press enter to start.               |")
  41. print("+-------------------------------------+")
  42. print("")
  43. read()
  44. turtle.select(1)
  45. turtle.refuel()
  46. turtle.up()
  47. while true do
  48.     placeDirt()
  49.     placeDirt()
  50.     placeDirt()
  51.     placeDirt()
  52.     placeDirt()
  53.     placeDirt()
  54.     placeTree()
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement