Fatherless

helperStartup

Dec 18th, 2024 (edited)
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. --[[
  2.  
  3. This is a startup program to help the felling turtlle sort out the collected resources
  4. "top" is the resources collected by the turtle and hoppers
  5. "front" is where the logs go
  6.  
  7. Everything that isn't logs or saplings is trash
  8.  
  9. ]]
  10.  
  11. local top = peripheral.wrap("top")
  12.  
  13. while true do
  14. for i = 1, top.size() do
  15. local data = top.getItemDetail(i)
  16.  
  17. if data == nil then
  18. goto continue
  19. end
  20.  
  21. if data.name ~= "minecraft:spruce_sapling" then
  22. top.pushItems("front", i)
  23. end
  24.  
  25. ::continue::
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment