Advertisement
MrTurtle

canyonmaker

May 24th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 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. --canyonmaker turtle.  moves up then forward 6 spaces, drops TNT in a line every 4 spaces and returns.
  30.  
  31.  
  32.  
  33. function bomb(x)
  34.  for i = 1, x do
  35.   turtle.placeDown(t.restack(1,8))
  36.   redstone.setOutput("bottom", true )
  37.   os.sleep(0.15)
  38.   redstone.setOutput("bottom", false )
  39.  end
  40. end
  41.  
  42. term.clear() -- Clears the screen
  43. term.setCursorPos(1,1) -- Fixes the cursor position
  44. write("turtle fuel level is ")
  45. print(turtle.getFuelLevel())
  46. print("place explosives starting in slot 1")
  47. print("The more bombs, the deeper the canyon. how many bombs per drop??")
  48. local bombs = t.readNum()
  49. print("how long will the canyon be?")
  50. local range = t.readNum()
  51. print("drop height?")
  52. local drop = t.readNum()
  53. local breadcrumbs = 6
  54.  
  55. t.up(drop)
  56. t.forward(6)
  57. for i=1, range, 4 do
  58. t.forward(5)
  59. breadcrumbs=breadcrumbs+4
  60. bomb(bombs)
  61. end
  62. t.back(breadcrumbs)
  63. t.down(drop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement