Guest User

Untitled

a guest
Jun 27th, 2013
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. function FindTree() -- Forgot parenthesis
  2.   turtle.select(1)
  3.   if turtle.compare() == true then
  4.         return true
  5.   else
  6.         return false
  7.   end
  8. end
  9.  
  10. function cut() -- Forgot parenthesis
  11.   while turtle.detectUp() do
  12.     turtle.digUp()
  13.     turtle.up()
  14.   end
  15.   while not turtle.detectDown() do
  16.     turtle.down()
  17.   end -- Forgot end
  18. end
  19.  
  20. function plant()
  21.   turtle.select(16)
  22.   turtle.place()
  23. end
  24.  
  25. function fuel()
  26.   if turtle.getFuelLevel <10 then
  27.     turtle.select(15)
  28.     turtle.refuel(1)
  29.   end -- Forgot end
  30. end
  31.  
  32. fuel()
  33. plant()
  34. fuel()
  35. if findTree() == false then
  36.   cut()
  37. else
  38.   print ("error")
  39. end -- Forgot end
Advertisement
Add Comment
Please, Sign In to add comment