mistamadd001

Untitled

Feb 16th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.89 KB | None | 0 0
  1. local data
  2. local fuelSlot = 1
  3. local turnCount = 0
  4. local treeHeight = 1
  5. local fuelLevel = turtle.getFuelLevel()
  6. local woodSlot = 2
  7. local rootSlot = 3
  8. local barkSlot = 4
  9. local slotCount = 0
  10. local moveHeight = 0
  11. local moveCount = 0
  12.  
  13. while treeHeight < 250 do
  14.     if fuelLevel < turtle.getFuelLimit() then
  15.         turtle.turnLeft()
  16.         while fuelLevel < turtle.getFuelLimit() do
  17.             turtle.select(fuelSlot)
  18.             slotCount = turtle.getItemCount()
  19.             turtle.suck(math.floor(64-slotCount))
  20.             turtle.refuel()
  21.             fuelLevel = turtle.getFuelLevel()
  22.         end
  23.     end
  24.     turtle.suck(math.floor(64-slotCount))
  25.     turtle.select(woodSlot)
  26.     if turtle.getItemCount() == 0 then
  27.         print('Please insert wood into slot 2')
  28.         treeHeight = 250
  29.     end
  30.     if turtle.compare() == true then
  31.         turtle.dig()
  32.         turtle.forward()
  33.         moveCount = 0
  34.         moveHeight = 0
  35.     elseif turtle.compare() == false then
  36.         if moveCount < 10 then
  37.             turtle.select(rootSlot)
  38.             if turtle.getItemCount() == 0 then
  39.                 print('Please insert roots or wood into slot 3')
  40.                 treeHeight = 250
  41.             end
  42.             if turtle.compare() == true then
  43.                 turtle.dig()
  44.                 turtle.forward()
  45.                 moveCount = 0
  46.                 moveHeight = 0
  47.             elseif turtle.compare() == false then
  48.                 turtle.select(barkSlot)
  49.                 if turtle.getItemCount() == 0 then
  50.                     print('Please insert roots, wood or bark into slot 4')
  51.                     treeHeight = 250
  52.                 end
  53.                 if turtle.compare() == true then
  54.                     turtle.dig()
  55.                     turtle.forward()
  56.                     moveCount = 0
  57.                     moveHeight = 0
  58.                 elseif turtle.compare() == false then
  59.                     if turnCount < 4 then
  60.                         turtle.turnRight()
  61.                         turnCount = turnCount + 1
  62.                     elseif moveCount == 10 then
  63.                         if turtle.up() then
  64.                             if moveHeight == 5 then
  65.                                 treeHeight = 250
  66.                             else
  67.                                 turtle.turnRight()
  68.                                 turtle.turnRight()
  69.                                 turnCount = 0
  70.                                 treeHeight = treeHeight + 1
  71.                                 moveHeight = moveHeight + 1
  72.                             end
  73.                         else
  74.                             turtle.digUp()
  75.                         end
  76.                     else
  77.                         turtle.forward()
  78.                         moveCount = moveCount + 1
  79.                     end
  80.                 end
  81.             end
  82.         else
  83.             turtle.digUp()
  84.         end
  85.     end
  86. end
Advertisement
Add Comment
Please, Sign In to add comment