Advertisement
MrTurtle

minetunnel

May 24th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.57 KB | None | 0 0
  1. print("Loading Robust Turtle API...")
  2. local load = os.loadAPI("t")
  3. if load then
  4.   print("Robust Turtle API loaded.")
  5. else
  6.  print("Robust Turtle API not found in the root directory with filename t")
  7.  print("Attempting to download as t from pastebin...")
  8.  os.sleep(2)
  9.  local response = http.get("http://pastebin.com/raw.php?i= e0UksEtT")
  10.  if response then
  11.     print( "Success." )    
  12.     local sResponse = response.readAll()
  13.     response.close()
  14.     local file = fs.open( "t", "w" )
  15.     file.write( sResponse )
  16.     file.close()
  17.     print( "Downloaded as t")
  18.     load = os.loadAPI("t")
  19.     if load then
  20.      print("Robust Turtle API installed & loaded.")
  21.     end
  22.  else
  23.     print( "Download Failed. Please Install Manually." )
  24.     return
  25.  end
  26. end
  27.  
  28.  
  29. --tunnel mining turtle
  30. --Places Cobblestone when it does not detect blocks beneath it,
  31. --creating bridges through caverns.  Use any frequently occurring
  32. --block. Cobblestone not required, just a block that doesn't fall
  33. --that your turtle will be mining plenty of.
  34. print("place torches in slot 1 and cobblestone in slot 2")
  35. print("dig in how far?")
  36. local dist = t.readNum()
  37. write("turtle fuel level is ")
  38. write(turtle.getFuelLevel())
  39. print(", ok?")
  40. read()
  41. local torch =0
  42. for i=1, dist do
  43.  t.forward()
  44.  t.digUp()
  45.  t.digDown()
  46.  torch = torch+1
  47.  if torch == 6 then
  48.   t.right()
  49.   if not turtle.detect() then
  50.    t.place(2)
  51.   end
  52.   t.up()
  53.   t.place(1)
  54.   t.left()
  55.   t.down()
  56.   torch = 0
  57.  end
  58. end
  59. t.down()
  60. for i=1, dist do
  61.  turtle.back()
  62.  if not turtle.detectDown() then
  63.   t.placeDown(2)
  64.  end
  65. end
  66. t.up()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement