Advertisement
gravityio

vertimine.lua

Jan 15th, 2021
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. local tUtils = require("lib/turtleutils")
  2.  
  3. -- if nil then it will not mine forward else mine forward
  4. local mineForward = ...
  5.  
  6. local function Dig()
  7.     local digCount = 0
  8.     while true do
  9.         local success, info = turtle.digDown()
  10.         if not success and info == "Unbreakable block detected" then break end
  11.         turtle.down()
  12.         if mineForward ~= nil then turtle.dig() end
  13.         digCount = digCount + 1
  14.     end
  15.     return digCount
  16. end
  17.  
  18. local function Return(upTimes)
  19.     for i = 1, upTimes do
  20.         turtle.up()
  21.     end
  22. end
  23.  
  24. local function Main()
  25.     tUtils.Refuel()
  26.     local digCount = Dig()
  27.     Return(digCount)
  28. end
  29.  
  30. Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement