Advertisement
Guest User

treefarm

a guest
May 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. --[[Attempt at tree harvesting on a circuit--]]
  2. os.loadAPI('pond')
  3.  
  4. local rowlength=1
  5. local blockspace=1
  6. local treecounter=1
  7. treecounter = tonumber(treecounter)
  8.  
  9. print('How many tree plots in a row?') --Queries the user
  10. rowlength = io.read()
  11. rowlength = tonumber(rowlength)
  12. print('How many blocks between trees?') --Queries the user
  13. blockspace = io.read()
  14. blockspace = tonumber(blockspace)
  15.  
  16. --Move forward until something stops the turtle
  17. while not turtle.detect() do
  18.  turtle.forward()
  19. end
  20.  
  21. --Position turtle to start lumberjill
  22. turtle.turnLeft()
  23. turtle.forward()
  24. turtle.turnRight()
  25. turtle.forward()
  26. turtle.turnRight()
  27.  
  28.  while pond.selectEmptySlot() do
  29.   while treecounter < rowlength do
  30.    if not turtle.detect() then pond.selectItem('minecraft:sapling')
  31.     turtle.place() --Plant sapling
  32.    else shell.run('lumberjill')
  33.   end
  34.    turtle.turnLeft()
  35.    for i = 1, blockspace do
  36.     turtle.forward()
  37.    end -- end of forward movement
  38.  end
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement