Advertisement
Guest User

tunnelPlus

a guest
Mar 7th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.11 KB | None | 0 0
  1. args = {args}
  2. print("Make sure you've got a chest in my 16th slot! VERY IMPORTANT!")
  3. dist = tonumber(args[1])
  4. function ask4Chest()
  5.     write("Do you have a chest in the 16th slot? y/n")
  6.     local i = read()
  7.     if i == "y" then
  8.         tunnel("go")
  9.     else
  10.         tunnel("no")
  11.     end
  12. end
  13.  
  14. function tunnel(action)
  15.     local x = 0
  16.     if action == "go" then
  17.         print("I receive you loud and clear, I will tunnel "..tostring(dist).." blocks and then come back!")
  18.         for i = tonumber(dist) do
  19.             print "Mining."
  20.             turtle.dig()
  21.             turtle.forward()
  22.             turtle.digUp()
  23.             turtle.turnLeft()
  24.             turtle.dig()
  25.             turtle.up()
  26.             turtle.dig()
  27.             turtle.turnRight()
  28.             turtle.dig()
  29.             turtle.down()
  30.             turtle.dig()
  31.             turtle.turnLeft()
  32.             x = x+1
  33.             if x == 45 then
  34.                 turtle.select(16)
  35.                 turtle.turnRight()
  36.                 turtle.turnRight()
  37.                 turtle.place()
  38.                 for x = 15 do
  39.                     turtle.select(x)
  40.                     turtle.drop(turtle.getItemCount(x))
  41.                 end
  42.             end
  43.         end
  44.         turtle.turnRight()
  45.         turtle.turnRight()
  46.         for i in dist do
  47.             turtle.forward()
  48.         end
  49.     else
  50.         print("I told you I needed a chest, damnit.")
  51.         ask4Chest()
  52.     end
  53. end
  54.     ask4Chest()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement