Advertisement
ChicagoFire3

Digging

Jun 17th, 2023
802
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.00 KB | Gaming | 0 0
  1. require("Libraries/Inventory")
  2. require("Libraries/Tables")
  3. require("Libraries/Fuel")
  4.  
  5. function DigUp(h)
  6.     print("DigUp")
  7.     local count = 0
  8.     local s, b = turtle.inspectUp()
  9.     while count < h and s do
  10.         turtle.digUp()
  11.         turtle.up()
  12.         s, b = turtle.inspectUp()
  13.         count = count + 1
  14.     end
  15.     while count > 0 do
  16.         turtle.digDown()
  17.         turtle.down()
  18.         count = count - 1
  19.     end
  20. end    
  21.  
  22. function DigTree() do
  23.     print("Digging Tree")
  24.     local count = 0
  25.     local s = true
  26.     turtle.dig()
  27.     turtle.forward()
  28.     turtle.digDown()
  29.     turtle.select(2)
  30.     turtle.placeDown()
  31.     while s do
  32.         s, b = turtle.inspectUp()
  33.         if (s and (b.name == "minecraft:oak_log")) then
  34.             turtle.digUp()
  35.             turtle.up()
  36.             count = count+1
  37.         else
  38.             s = false
  39.         end
  40.     end
  41.     while count > 0 do
  42.         turtle.digDown()
  43.         turtle.down()
  44.         count = count-1
  45.     end
  46. end
  47.  
  48. end
  49.  
Tags: minecraft lua
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement