Advertisement
Kevlaris

dial_v2-1

Apr 13th, 2020
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local c = require("component")
  2. local event = require("event")
  3. local serialization = require("serialization")
  4. local modem = c.modem
  5. local port = 123
  6. local os = require("os")
  7.  
  8. local address
  9.  
  10. print("SGC Dialing program v2.1 /by Kevlaris")
  11. print("")
  12. print("How many symbols do you want to dial?(7/8/9)")
  13. num = io.read()
  14. print()
  15. if num == "7" then
  16.     print("The program will require 6 symbols from you (7th symbol is automatic). Start typing now.")
  17.     chev1 = io.read()
  18.     chev2 = io.read()
  19.     chev3 = io.read()
  20.     chev4 = io.read()
  21.     chev5 = io.read()
  22.     chev6 = io.read()
  23.     chev7 = "Point of Origin"
  24.         if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev2 == chev3 or chev2 == chev4 or chev2 == chev6 or chev2 == chev7 or chev3 == chev4 or chev3 == chev5 or chev3 == chev6 or chev3 == chev7 or chev4 == chev5 or chev4 == chev6 or chev4 == chev7 or chev5 == chev6 or chev5 == chev7 or chev6 == chev7 then
  25.             print("ERROR: Two symbols are the same")
  26.         else
  27.    
  28.     address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7}
  29.     print()
  30.     print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 .." (y/n)")
  31.     local answer = io.read()
  32.     if answer == "y" then
  33.         address = serialization.serialize(address_raw)
  34.         modem.broadcast(port, "dial", address)
  35.         print("Address sent to gate computer.")
  36.     end
  37.     end
  38. elseif num == "8" then
  39.     print("The program will require 7 symbols from you (8th symbol is automatic). Write the symbols' full names.")
  40.     chev1 = io.read()
  41.     chev2 = io.read()
  42.     chev3 = io.read()
  43.     chev4 = io.read()
  44.     chev5 = io.read()
  45.     chev6 = io.read()
  46.     chev7 = io.read()
  47.     chev8 = "Point of Origin"
  48.     if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev1 == chev8 or chev2 == chev3 or chev2 == chev4 or chev2 == chev6 or chev2 == chev7 or chev2 == chev8 or chev3 == chev4 or chev3 == chev5 or chev3 == chev6 or chev3 == chev7 or chev3 == chev8 or chev4 == chev5 or chev4 == chev6 or chev4 == chev7 or chev4 == chev8 or chev5 == chev6 or chev5 == chev7 or chev5 == chev8 or chev6 == chev7 or chev6 == chev8 or chev7 == chev8 then
  49.             print("ERROR: Two symbols are the same")
  50.         else
  51.    
  52.     address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7, chev8}
  53.     print()
  54.     print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 ..", ".. chev8 .." (y/n)")
  55.     local answer = io.read()
  56.     if answer == "y" then
  57.         address = serialization.serialize(address_raw)
  58.         modem.broadcast(port, "dial", address)
  59.         print("Address sent to gate computer.")
  60.     end
  61.     end
  62. elseif num == "9" then
  63.     print("The program will require 8 symbols from you (9th symbol is automatic). Start typing now.")
  64.     chev1 = io.read()
  65.     chev2 = io.read()
  66.     chev3 = io.read()
  67.     chev4 = io.read()
  68.     chev5 = io.read()
  69.     chev6 = io.read()
  70.     chev7 = io.read()
  71.     chev8 = io.read()
  72.     chev9 = "Point of Origin"
  73.         if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev1 == chev8 or chev1 == chev9 or chev2 == chev3 or chev2 == chev4 or chev2 == chev6 or chev2 == chev7 or chev2 == chev8 or chev2 == chev9 or chev3 == chev4 or chev3 == chev5 or chev3 == chev6 or chev3 == chev7 or chev3 == chev8 or chev3 == chev9 or chev4 == chev5 or chev4 == chev6 or chev4 == chev7 or chev4 == chev8 or chev4 == chev9 or chev5 == chev6 or chev5 == chev7 or chev5 == chev8 or chev5 == chev9 or chev6 == chev7 or chev6 == chev8 or chev6 == chev9 or chev7 == chev8 or chev7 == chev9 or chev8 == chev9 then
  74.             print("ERROR: Two symbols are the same")
  75.         else
  76.    
  77.     address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7, chev8, chev9}
  78.     print()
  79.     print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 ..", ".. chev8 ..", ".. chev9 .." (y/n)")
  80.     local answer = io.read()
  81.     if answer == "y" then
  82.         address = serialization.serialize(address_raw)
  83.         modem.broadcast(port, "dial", address, 9)
  84.         print("Address sent to gate computer.")
  85.     end
  86.     end
  87. elseif num ~= "9" or num ~= "8" or num ~= "7" then
  88. print("ERROR: number is not 7 or 8")
  89. else
  90. print("UNKNOWN ERROR")
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement