Advertisement
psychedelixx

Minecraft Turtle: Fir Chopper

May 22nd, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[
  2.     2013 (c) psychedelixx
  3.     Minecraft Turtle: Fir Chopper
  4.     2013-05-22
  5.  
  6.     Chops a whole fir tree and returns to the ground. It should work on every other 1x1 tree as well.
  7.  
  8.     Usage:
  9.     - Place the turtle on the ground in front of the fir tree
  10.         - use turtle and type "label set <name>"
  11.           (to give your turtle an unique name so it remembers its programs)
  12.         - type "pastebin get X3TfSMR2 fir"
  13.     - type "fir"
  14. --]]
  15.  
  16. if turtle.getFuelLevel() == 0 then
  17.     turtle.refuel()
  18. end
  19.  
  20. if turtle.getFuelLevel() == 0 then
  21.     print("I need fuel!")
  22. else
  23.     print("======== 2013 (c) psychedelixx ========")
  24.     print("Let's go!")
  25.     h=0
  26.     turtle.dig()
  27.     turtle.forward()
  28.     repeat
  29.         print("Fuel: " .. turtle.getFuelLevel())
  30.         turtle.digUp()
  31.         turtle.up()
  32.         h = h+1
  33.        
  34.         if turtle.getFuelLevel() < 2 then
  35.             turtle.refuel()
  36.         end
  37.     until not turtle.detectUp()
  38.     while h>0 do
  39.         print("Fuel: " .. turtle.getFuelLevel())
  40.         turtle.down()
  41.         h = h-1
  42.        
  43.         if turtle.getFuelLevel() < 2 then
  44.             turtle.refuel()
  45.         end
  46.     end
  47. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement