Advertisement
charlesthepenguin

Untitled

Jul 29th, 2020 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. c = require("component")
  2. local term = require("term")
  3. local component = require("component")
  4. local sides = require("sides")
  5. event = require("event")
  6. os = require("os")
  7. event = require("event")
  8. computer = require("computer")
  9. serialization = require("serialization")
  10. local tun = component.tunnel
  11. local gpu = component.gpu -- get primary gpu component
  12. local w, h = gpu.getResolution()
  13. gpu.fill(1, 1, w, h, " ") -- clears the screen
  14. tun = c.tunnel
  15. red = c.redstone
  16. sg = c.stargate
  17. bm = c.beamer
  18. local asd = 1
  19. print("SGC Gate Computer Program v1.1 /by Kevlaris")
  20. print("--------------------------------------------------------------------------------------------------------------------------------------------------------------")
  21. print()
  22.  
  23. repeat
  24. term.clear(true)
  25. print("Listening for incoming messages and events across dimensions")
  26. print()
  27.  
  28. local _, _, _, _, _, raw, address_raw = event.pull(nil, "modem_message")
  29. print("Message recieved.")
  30. os.sleep(0.5)
  31.  
  32. if raw == "AlphaT" then
  33. print("Engaging IO")
  34. red.setOutput(sides.left, 1)
  35. os.sleep(1)
  36. red.setOutput(sides.left, 0)
  37. os.sleep(1)
  38. elseif raw == "BaseT" then
  39. address = {"Crater", "Monoceros", "Scorpius", "Serpens Caput", "Sculptor", "Aquarius", "Point of Origin"}
  40. os.sleep(0.5)
  41. print("Dialing")
  42. for i,v in ipairs(address) do print(i,v) end
  43. print()
  44. function dialNext(dialed)
  45. glyph = address[dialed + 1]
  46. print("Engaging "..glyph.."... ")
  47. sg.engageSymbol(glyph)
  48. end
  49. eventID = event.listen("stargate_spin_chevron_engaged", function(evname, address, caller, num, lock, glyph)
  50. os.sleep(2)
  51. if lock then
  52. if (event.cancel(eventID)) then
  53. print("Event cancelled successfully")
  54. end
  55. print("Engaging...")
  56. sg.engageGate()
  57. bm.setBeamerRole("transmit")
  58. print("Transmitting")
  59. os.sleep(1)
  60. print("Engaging IO")
  61. red.setOutput(sides.right, 1)
  62. os.sleep(1)
  63. os.sleep(5)
  64. bm.setBeamerRole("disabled")
  65. red.setOutput(sides.right, 0)
  66. doing = false
  67. os.sleep(1)
  68. print("Stargate Shutdown")
  69. sg.disengageGate()
  70. os.sleep(5)
  71. bm.setBeamerRole("receive")
  72. os.sleep(2)
  73. else
  74. dialNext(num)
  75. end
  76. end)
  77.  
  78. dialNext(0)
  79. doing = true
  80. print()
  81. while doing do os.sleep(0.1) end
  82.  
  83. end
  84. until asd == 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement