Advertisement
RabaGhast

BerryTurtle_2.0

Nov 2nd, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. height = 5
  2. nap = 2
  3. hibernate = 60
  4. space = 1
  5.  
  6. space = space + 1
  7.  
  8. function harvest()
  9.   print("Harvesting")
  10.   turtle.placeDown()
  11.   sleep(nap)
  12.   turtle.digDown()
  13. end
  14.  
  15. function climb()
  16.   for i = 1,height do
  17.     turtle.up()
  18.     if i % space == 0 then
  19.       harvest()
  20.     end
  21.   end
  22. end
  23.  
  24. function goHome()
  25.   print("Going home")
  26.   for i = 1,height do
  27.     turtle.down()
  28.   end
  29. end
  30.  
  31. function unload()
  32.   turtle.turnRight()
  33.   for i = 1,15 do
  34.     turtle.select(i)
  35.     turtle.drop()
  36.   end
  37.   turtle.select(16)
  38.   turtle.turnLeft()
  39. end
  40.  
  41. --------Main--------
  42. turtle.select(16)
  43. while true do
  44.   climb()
  45.   goHome()
  46.   unload()
  47.   print("Sleeping")
  48.   sleep(hibernate)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement