Advertisement
MrTurtle

bomberturtle

May 24th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 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( "Great 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. --bomb dropper turtle
  29.  
  30.  
  31. function bomb(x)
  32.  for i = 1, x do
  33.   turtle.placeDown(t.restack(1,8))
  34.   redstone.setOutput("bottom", true )
  35.   os.sleep(0.15)
  36.   redstone.setOutput("bottom", false )
  37.  end
  38. end
  39.  
  40. term.clear() -- Clears the screen
  41. term.setCursorPos(1,1) -- Fixes the cursor position
  42. write("turtle fuel level is ")--write does not goto a new line after printing
  43. print(turtle.getFuelLevel())--print does goto a new line
  44. print("place explosives starting in slot 1")
  45. print("Dumber of bombs to drop?")
  46. local bombs = t.readNum()
  47. print("distance to bomb drop site?")
  48. local range = t.readNum()
  49. print("Drop height?")
  50. local height = t.readNum()
  51.  
  52. t.up(height)
  53. t.forward(range)
  54. bomb(bombs)
  55. t.back(range)
  56. t.down(height)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement