Advertisement
Guest User

startup

a guest
May 20th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. monitor = peripheral.wrap("top")
  2. modem = peripheral.wrap("back")
  3.  
  4. modem.open(697)
  5.  
  6. function Launch()
  7.   print("Which silo would you like to launch? 1-5 or all")
  8.   local input = io.read()
  9.   if 5 >= tonumber(input) >= 1 then
  10.     input = input + 6
  11.     modem.transmit(697,697,input)
  12.     print("Launching missile ", input)
  13.   elseif tostring(input) == "all" then
  14.     modem.transmit(697,697,12)
  15.     print("Launching All Missiles")
  16.   else
  17.     print("Incorrect Input. Rebooting.")
  18.   end
  19. end
  20.  
  21. function Open()
  22.   print("Which door would you like to open? 1-5 or all")
  23.   local input = io.read()
  24.   if 5 >= tonumber(input) >= 1 then
  25.     modem.transmit(697,697,input)
  26.     print("Opening Silo ", input)
  27.   elseif tostring(input) == "all" then
  28.     modem.transmit(697,697,6)
  29.     print("Opening All Silos")
  30.   else
  31.     print("Incorrect Input. Rebooting.")
  32.   end
  33. end
  34.  
  35. Launch()
  36. Open()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement