Guest User

FTB - Redwood planter/harvester

a guest
Jan 23rd, 2013
1,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. function plant() do
  2.  
  3.   turtle.up()
  4.   turtle.forward()
  5.   turtle.select(16)
  6.   turtle.placeDown()
  7.   turtle.forward()
  8.   turtle.placeDown()
  9.   turtle.turnRight()
  10.   turtle.forward()
  11.   turtle.placeDown()
  12.   turtle.turnRight()
  13.   turtle.forward()
  14.   turtle.placeDown()
  15.   turtle.forward()
  16.   turtle.turnRight()
  17.   turtle.forward()
  18.   turtle.turnRight()
  19.  
  20. end
  21. end
  22.  
  23.  
  24. function chop() do
  25.  
  26.   local height = 0
  27.  
  28.   turtle.dig()
  29.   turtle.forward()
  30.   turtle.dig()
  31.  
  32.   while turtle.digUp() do
  33.     turtle.up()
  34.     turtle.dig()
  35.     height = height + 1
  36.   end
  37.  
  38.   turtle.turnRight()
  39.   turtle.dig()
  40.   turtle.forward()
  41.   turtle.turnLeft()
  42.   turtle.dig()
  43.  
  44.   while height > 0 do
  45.     turtle.digDown()
  46.     turtle.down()
  47.     turtle.dig()
  48.     height = height - 1
  49.   end
  50.  
  51.   turtle.turnLeft()
  52.   turtle.forward()
  53.   turtle.suck(100)
  54.   turtle.turnLeft()
  55.   turtle.forward()
  56.   turtle.turnLeft()
  57.   turtle.turnLeft()
  58.   turtle.select(1)
  59.   turtle.refuel(63)
  60.  
  61. end
  62. end
  63.  
  64.  
  65. function dump() do
  66.  
  67.   turtle.select(2)
  68.   turtle.dropDown()
  69.   turtle.select(3)
  70.   turtle.dropDown()
  71.   turtle.select(4)
  72.   turtle.dropDown()
  73.   turtle.select(5)
  74.   turtle.dropDown()
  75.   turtle.select(6)
  76.   turtle.dropDown()
  77.   turtle.select(7)
  78.   turtle.dropDown()
  79.   turtle.select(8)
  80.   turtle.dropDown()
  81.   turtle.select(9)
  82.   turtle.dropDown()
  83.   turtle.select(10)
  84.   turtle.dropDown()
  85.   turtle.select(11)
  86.   turtle.dropDown()
  87.   turtle.select(12)
  88.   turtle.dropDown()
  89.   turtle.select(13)
  90.   turtle.dropDown()
  91.   turtle.select(14)
  92.   turtle.dropDown()
  93.   turtle.select(15)
  94.   turtle.dropDown()
  95.  
  96. end
  97. end
  98.  
  99.  
  100.  
  101. plant()
  102. turtle.down()
  103. turtle.select(1)
  104.  
  105. while true do
  106.   if turtle.compare() then
  107.     chop()
  108.     dump()
  109.     shell.reboot()
  110.   else
  111.     sleep(2)
  112.   end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment