LazyNub

MicroLogger .1

May 6th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. --- Micro Logger
  2. --- By: LazyNub
  3. --- First ver. 5-6-13
  4. --- Place a chest with turtle above and 4 saplings on all 4 sides
  5. --- slot one is saplings only slot
  6. --- slot two is fuel only slot
  7.  
  8. t=os.clock()
  9.  
  10. function choptree()
  11.     turtle.dig()
  12.     turtle.forward()
  13.     while turtle.detectUp() do
  14.         for i=1,4 do
  15.             turtle.dig()
  16.             turtle.suck()
  17.             turtle.turnRight()
  18.         end
  19.         turtle.digUp()
  20.         turtle.up()
  21.     end
  22.     while not turtle.detectDown() do
  23.         turtle.down()
  24.     end
  25.     turtle.digDown()
  26.     turtle.down()
  27.     turtle.up()
  28.     turtle.select(1)
  29.     turtle.placeDown()
  30.     turtle.back()
  31. end        
  32.  
  33. function doupkeep()
  34.     for i = 3,16 do  
  35.         turtle.select(i)
  36.         turtle.dropDown()
  37.     end
  38.     while turtle.getFuelLevel() <= 79 do  
  39.         turtle.select(2)
  40.         turtle.refuel(1)   
  41.     end
  42. end
  43.    
  44. --- Program Start
  45. ---
  46. while true do
  47.         while not turtle.detect() do
  48.         turtle.turnRight()
  49.         sleep(0.5)
  50.             turtle.suck()  
  51.             turtle.suckUp()
  52.     end
  53.     choptree()  
  54.     doupkeep()
  55.     print("Time since tree: " .. os.clock()-t )
  56.         t=os.clock()
  57. end
Advertisement
Add Comment
Please, Sign In to add comment