wbennet997

tube

Jun 29th, 2022 (edited)
741
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None
  1. local distance = 0
  2. local rings = 80
  3.  
  4. local function placeitup()
  5.     turtle.dig()
  6.     turtle.place()
  7.     turtle.digUp()
  8.     turtle.up()
  9. end
  10.  
  11. local function roofit()
  12.     turtle.dig()
  13.     turtle.place()
  14.     turtle.turnLeft()
  15.     turtle.dig()
  16.     turtle.forward()
  17.     turtle.turnRight()
  18. end
  19.  
  20. local function placeitdown()
  21.     turtle.dig()
  22.     turtle.place()
  23.     turtle.digDown()
  24.     turtle.down()
  25. end
  26.  
  27. local function floorit()
  28.     turtle.dig()
  29.     turtle.place()
  30.     turtle.turnRight()
  31.     turtle.dig()
  32.     turtle.forward()
  33.     turtle.turnLeft()
  34. end
  35.  
  36. local function next_ring()
  37.  
  38.     for i = 1,2 do turtle.turnRight() end
  39.     turtle.dig()
  40.     for i = 1,2 do turtle.turnRight() end
  41.     turtle.back()
  42.  
  43. end
  44.  
  45. local function manage_inventory()
  46.  
  47.     slot = turtle.getSelectedSlot()
  48.     inv_ = turtle.getItemCount(slot)
  49.     if inv_ > 1 then
  50.         turtle.select(slot)
  51.     else
  52.         slot = slot + 1
  53.         turtle.select(slot)
  54.     end
  55.  
  56. end
  57.  
  58. local counter = 0
  59. slot = 1
  60.  
  61. while distance < rings do
  62.  
  63.  
  64.     manage_inventory()
  65.  
  66.     for i = 1,5 do placeitup(); counter = counter + 1 end
  67.     for i = 1,3 do roofit(); counter = counter + 1 end
  68.     for i = 1,5 do placeitdown(); counter = counter + 1 end
  69.     for i = 1,3 do floorit() ; counter = counter + 1 end
  70.  
  71.  
  72.     next_ring()
  73.  
  74.     distance = distance + 1
  75.  
  76.     -- manage inventory some how
  77.  
  78. end
RAW Paste Data Copied