Advertisement
MrTurtle

minestairs

May 24th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.62 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. --Mineshaft Digging Turtle. Places Torches every 6 blocks.
  29. --Places Cobblestone when it does not detect blocks beneath it,
  30. --creating bridges through caverns.  Use any frequently occurring
  31. --block. Cobblestone not required, just a block that doesn't fall
  32. --that your turtle will be mining plenty of.
  33.  
  34. print("place torches in slot 1 and cobblestone in slot 2")
  35. print("dig down how far?")
  36. local dist = t.readNum()
  37. print("turtle fuel level is "..turtle.getFuelLevel()..", ok?")
  38. read()
  39.  
  40. local torch =0
  41. for i=1, dist do
  42.  t.forward()
  43.  t.digUp()
  44.  t.down()
  45.  if not turtle.detectDown() then
  46.   t.placeDown(2)
  47.  end
  48.  torch = torch+1
  49.  if torch == 6 then
  50.   t.right()
  51.   if not turtle.detect() then
  52.    turtle.place(2)
  53.   end
  54.   turtle.up()
  55.   t.place(1)
  56.   t.left()
  57.   t.down()
  58.   torch = 0
  59.  end
  60. end
  61. turtle.down()
  62. for i=1, dist do
  63.  turtle.back()
  64.  t.up()
  65. end
  66. turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement