charlesthepenguin

startmessage

Jul 26th, 2020
9
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local c = require("component")
  2. local term = require("term")
  3. local component = require("component")
  4. local event = require("event")
  5. local serialization = require("serialization")
  6. local gpu = component.gpu
  7. local w, h = gpu.getResolution()
  8. gpu.fill(1, 1, w, h, " ")
  9. local modem = c.modem
  10. local asd = 1
  11. local port = 123
  12. local os = require("os")
  13.  
  14. local address
  15. repeat
  16. term.clear(true)
  17. print("SGC Dialing Computer")
  18. print("")
  19. print("Which Gate do you want to connect to? (Number only)")
  20. print("1. Spawn")
  21. print("2. Neather")
  22. print("3. SHUTDOWN GATE!")
  23. print("4. I want to type my adress manually")
  24. num = io.read()
  25. print()
  26. if num == "1" then
  27. print("Dialing Spawn.")
  28. modem.broadcast(port, "dial1")
  29. print("Address sent to gate computer.")
  30. os.sleep(5)
  31.  
  32.  
  33.  
  34. elseif num == "2" then
  35. print("Dialing Neather.")
  36. modem.broadcast(port, "dial2", address, 9)
  37. print("Address sent to gate computer.")
  38. os.sleep(5)
  39.  
  40.  
  41. elseif num == "3" then
  42. print("Gate Shutdown Issued!")
  43. modem.broadcast(port, "sd", address, 9)
  44. print("Shutdown command sent.")
  45. os.sleep(5)
  46.  
  47. elseif num == "4" then
  48. print("How many symbols do you want to dial?(7/8/9)")
  49. num = io.read()
  50. print()
  51. if num == "7" then
  52. print("The program will require 6 symbols from you (7th symbol is automatic). Start typing now.")
  53. chev1 = io.read()
  54. chev2 = io.read()
  55. chev3 = io.read()
  56. chev4 = io.read()
  57. chev5 = io.read()
  58. chev6 = io.read()
  59. chev7 = "Point of Origin"
  60. if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev2 == chev3 or chev2 == chev4 or
  61. chev2 == chev6 or chev2 == chev7 or chev3 == chev4 or chev3 == chev5 or chev3 == chev6 or chev3 == chev7 or chev4 == chev5 or chev4 == chev6
  62. or chev4 == chev7 or chev5 == chev6 or chev5 == chev7 or chev6 == chev7 then
  63. print("ERROR: Two symbols are the same")
  64. else
  65. address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7}
  66. print()
  67. print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 .." (y/n)")
  68. local answer = io.read()
  69. if answer == "y" then
  70. address = serialization.serialize(address_raw)
  71. modem.broadcast(port, "manual", address)
  72. print("Address sent to gate computer.")
  73. end
  74. end
  75. elseif num == "8" then
  76. print("The program will require 7 symbols from you (8th symbol is automatic). Write the symbols' full names.")
  77. chev1 = io.read()
  78. chev2 = io.read()
  79. chev3 = io.read()
  80. chev4 = io.read()
  81. chev5 = io.read()
  82. chev6 = io.read()
  83. chev7 = io.read()
  84. chev8 = "Point of Origin"
  85. if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev1 == chev8 or chev2 == chev3 or chev2 ==
  86. chev4 or chev2 == chev6 or chev2 == chev7 or chev2 == chev8 or chev3 == chev4 or chev3 == chev5 or chev3 == chev6 or chev3 == chev7 or chev3
  87. == chev8 or chev4 == chev5 or chev4 == chev6 or chev4 == chev7 or chev4 == chev8 or chev5 == chev6 or chev5 == chev7 or chev5 == chev8 or
  88. chev6 == chev7 or chev6 == chev8 or chev7 == chev8 then
  89. print("ERROR: Two symbols are the same")
  90. else
  91. address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7, chev8}
  92. print()
  93. print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 ..", ".. chev8 .." (y/n)")
  94. local answer = io.read()
  95. if answer == "y" then
  96. address = serialization.serialize(address_raw)
  97. modem.broadcast(port, "manual", address)
  98. print("Address sent to gate computer.")
  99. end
  100. end
  101. elseif num == "9" then
  102. print("The program will require 8 symbols from you (9th symbol is automatic). Start typing now.")
  103. chev1 = io.read()
  104. chev2 = io.read()
  105. chev3 = io.read()
  106. chev4 = io.read()
  107. chev5 = io.read()
  108. chev6 = io.read()
  109. chev7 = io.read()
  110. chev8 = io.read()
  111. chev9 = "Point of Origin"
  112. if chev1 == chev2 or chev1 == chev3 or chev1 == chev4 or chev1 == chev6 or chev1 == chev7 or chev1 == chev8 or chev1 == chev9 or
  113. chev2 == chev3 or chev2 == chev4 or chev2 == chev6 or chev2 == chev7 or chev2 == chev8 or chev2 == chev9 or chev3 == chev4 or chev3 == chev5
  114. or chev3 == chev6 or chev3 == chev7 or chev3 == chev8 or chev3 == chev9 or chev4 == chev5 or chev4 == chev6 or chev4 == chev7 or chev4 ==
  115. chev8 or chev4 == chev9 or chev5 == chev6 or chev5 == chev7 or chev5 == chev8 or chev5 == chev9 or chev6 == chev7 or chev6 == chev8 or chev6
  116. == chev9 or chev7 == chev8 or chev7 == chev9 or chev8 == chev9 then
  117. print("ERROR: Two symbols are the same")
  118. else
  119.  
  120. address_raw = {chev1, chev2, chev3, chev4, chev5, chev6, chev7, chev8, chev9}
  121. print()
  122. print("Confirm address: ".. chev1 ..", ".. chev2 ..", ".. chev3 ..", ".. chev4 ..", ".. chev5 ..", ".. chev6 ..", ".. chev7 ..", "..
  123. chev8 ..", ".. chev9 .." (y/n)")
  124. local answer = io.read()
  125. if answer == "y" then
  126. address = serialization.serialize(address_raw)
  127. modem.broadcast(port, "manual", address, 9)
  128. print("Address sent to gate computer.")
  129. end
  130. end
  131. elseif num ~= "9" or num ~= "8" or num ~= "7" then
  132. print("ERROR: number is not 7 or 8")
  133. else
  134. print("UNKNOWN ERROR")
  135. end
  136.  
  137.  
  138.  
  139. os.sleep(5)
  140.  
  141. elseif num ~= "1" or num ~= "2" or num ~= "3" or num ~= "4" then
  142. print("ERROR: Wrong number typed!")
  143. os.sleep(5)
  144.  
  145. else
  146. print("UNKNOWN ERROR")
  147. os.sleep(5)
  148. end
  149. until asd == 2
RAW Paste Data