Advertisement
Guest User

gtunnel.lua

a guest
Nov 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.30 KB | None | 0 0
  1. local placeSlot = 1
  2. local torchSlot = 13
  3.  
  4. while true do
  5.     for i=1,7 do
  6.         if turtle.detect() then
  7.             turtle.dig()
  8.         end
  9.         turtle.forward()
  10.         if turtle.detectUp() then
  11.             turtle.digUp()
  12.         end
  13.         turtle.select(placeSlot)
  14.         if turtle.getItemCount() <= 1 then
  15.             while turtle.getItemCount() <= 1 or turtle.getItemDetail().name == "minecraft:torch" do
  16.                 if turtle.getSelectedSlot() < 16 then
  17.                     turtle.select(turtle.getSelectedSlot()+1)
  18.                 else
  19.                     turtle.select(1)
  20.                 end
  21.             end
  22.             placeSlot = turtle.getSelectedSlot()
  23.         end
  24.         if not turtle.detectDown() then
  25.             turtle.select(placeSlot)
  26.             turtle.placeDown()
  27.         end
  28.     end
  29.     turtle.select(torchSlot)
  30.     if turtle.getItemCount() <= 1 then
  31.         while turtle.getItemCount() <= 1 or turtle.getItemDetail().name ~= "minecraft:torch" do
  32.             if turtle.getSelectedSlot() < 16 then
  33.                 turtle.select(turtle.getSelectedSlot()+1)
  34.             else
  35.                 turtle.select(1)
  36.             end
  37.         end
  38.         torchSlot = turtle.getSelectedSlot()
  39.     end
  40.     turtle.select(torchSlot)
  41.     turtle.placeUp()
  42.    
  43.     sleep(2)
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement