Advertisement
Proaxel

Untitled

May 24th, 2020
1,487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. args = {...}
  2. dist = args[1]
  3. run = true
  4. torchDistance = 0
  5. print("Starting mine")
  6.  
  7. while run do
  8.     turtle.turnRight()
  9.     if not turtle.detect() then
  10.         turtle.turnLeft()
  11.     end
  12.     turtle.dig()
  13.     turtle.forward()
  14.     torchDistance = torchDistance + 1
  15.     turtle.digUp()
  16.     turtle.digDown()
  17.     if turtle.getItemCount(15) > 0 then
  18.         if torchDistance >= 5 then
  19.             print("Setting Torch")
  20.             turtle.select(15)
  21.             turtle.dropDown()
  22.             turtle.select(1)
  23.             torchDistance = 0
  24.         end
  25.     end
  26.     if turtle.getItemCount(13) > 0 then
  27.         print("nearly full, chest dumping")
  28.         turtle.select(16)
  29.         turtle.placeDown()
  30.         for a = 1, 14 do
  31.             turtle.select(a)
  32.             turtle.dropDown()
  33.         end
  34.         if turtle.getItemCount(16) < 0 then
  35.             run = false
  36.             print("Out of chests! Stopping")
  37.         end
  38.         turtle.select(1)
  39.         end
  40.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement