Advertisement
Guest User

fell.lua

a guest
Feb 20th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. --[[
  2. Slot 1: Fuel
  3. Slot 15: Dirt
  4. Slot 16: Sapling
  5. --]]
  6.  
  7. function plant (curSlot)
  8.     turtle.select(16)
  9.     turtle.place()
  10.    
  11.     turtle.select(curSlot)
  12. end
  13.  
  14. function fell (curSlot)
  15.     -- Climbing
  16.     while turtle.detect() do
  17.         turtle.digUp()
  18.         turtle.up()
  19.     end
  20.    
  21.     turtle.forward()
  22.    
  23.     -- Digging
  24.     turtle.select(15)
  25.     while not turtle.compareDown() do
  26.         turtle.digDown()
  27.         turtle.down()
  28.     end
  29. end
  30.  
  31. function storage ()
  32.     -- Making sure to contact ground
  33.     while not turtle.detectDown() do
  34.         turtle.down()
  35.     end
  36.    
  37.     turtle.turnRight()
  38.     turtle.turnRight()
  39.    
  40.     for slot=2,14 do
  41.         turtle.select(slot)
  42.         turtle.drop()
  43.     end
  44.    
  45.     turtle.turnRight()
  46.     turtle.turnRight()
  47. end
  48.  
  49. function fuelManage (curSlot)
  50.     if turtle.getFuelLevel() < 3 then
  51.         turtle.select(1)
  52.         turtle.refuel()
  53.         turtle.select(curSlot)
  54.     end
  55. end
  56.  
  57. function getSapling ()
  58.     --Boundary: 5
  59. end
  60.  
  61. function main ()
  62.     fell()
  63.     storage()
  64.     plant()    
  65. end
  66.  
  67. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement