Advertisement
Guest User

chop.lua

a guest
Aug 18th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. local FL = turtle.getFuelLevel()
  2.  
  3. turtle.refuel(1)
  4. term.setTextColor(colors.lime)
  5. write("Starting Chop Bot\n")
  6. write("Brandstof is " .. FL)
  7.  
  8. function refeul()
  9.  if FL < 10 then
  10.   turtle.select(1)
  11.   turtle.refuel(1)
  12.   local FL = turtle.getFuelLevel()
  13.   write("\nBrandstof gebruikt\n Feul Level: " .. FL)
  14.  end
  15. end
  16.  
  17. function pak()
  18. turtle.select(2)
  19. turtle.suck()
  20. turtle.suckUp()
  21. end
  22.  
  23.  
  24. function chop()
  25. local success, data = turtle.inspect()
  26.  if data.name == "minecraft:log" then
  27.   turtle.select(3)
  28.   term.setTextColor(colors.orange)
  29.   write("\nLog Gevonden")
  30.   term.setTextColor(colors.lime)
  31.   turtle.dig()
  32.   turtle.forward()
  33.  
  34.    
  35.   while turtle.detectUp() == true do
  36.    turtle.digUp()
  37.    turtle.up()
  38.   end
  39.  
  40.   while turtle.detectDown() == false do
  41.    turtle.down()
  42.   end
  43.  
  44.   turtle.back()
  45.   turtle.select(2)
  46.   turtle.place()
  47.   turtle.select(3)
  48.  
  49.  end
  50. end
  51.  
  52. while true do
  53.  chop()
  54.  refeul()
  55.  pak()
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement