Advertisement
rachidelaid

dig_length.lua

Nov 28th, 2024
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local length = 0
  2. local items_to_drop = {
  3.     "minecraft:dirt",
  4.     "minecraft:stone",
  5.     "minecraft:cobblestone",
  6.     "minecraft:gravel",
  7.     "minecraft:sand",
  8.     "minecraft:deepslate",
  9. }
  10.  
  11. if arg[1] ~= nil then length = tonumber(arg[1]) end
  12.  
  13. function go_back(length)
  14.     if length == 0 then
  15.         return 0
  16.     end
  17.     turtle.back()
  18.     go_back(length - 1)
  19. end
  20.  
  21. function start_dig(length)
  22.     if length == 0 then
  23.         go_back(length)
  24.     end
  25.  
  26.     turtle.select(1)
  27.     turtle.refuel()
  28.     turtle.dig()
  29.     turtle.forward()
  30.     start_dig(length - 1)
  31. end
  32.  
  33. start_dig(length)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement