Cardwell

FusjonReaktor

Apr 11th, 2021 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. --Alle variabler
  2. local redspawner = "left"
  3. local input = "right"
  4. local laserstatus = ""
  5. local laser = 1
  6.  
  7. local startlasersekvens = "1"
  8. local ladlaser = "2"
  9. local uladlaser = "3"
  10. local triggerlaser = "4"
  11. local laser_on = "5"
  12. local laser_off = "6"
  13.  
  14. rednet.open("top")
  15. while true do
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. print("Programmer:")
  19. print("1. Start lasersekvens")
  20. print("2. Skru på laser lading")
  21. print("3. Skru av laser lading")
  22. print("4. Åpne laserport")
  23. print("5. Lukk laserport")
  24. term.setCursorPos(1,9)
  25. write("Status laser: ")
  26. write(laserstatus)
  27. term.setCursorPos(1,11)
  28. write("Kjør program:")
  29.  
  30. pw = read()
  31.  
  32. if pw == startlasersekvens then
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. term.clear()
  36. print("Venter på laser..")
  37. laserstatus = 1
  38. rednet.broadcast("ladlaser")
  39. if
  40. os.pullEvent("redstone") then
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. print("Laser klar!")
  44. sleep(1)
  45. term.clear()
  46. term.setCursorPos(1,1)
  47. print("Starter alarm..")
  48. rednet.broadcast("ALARM_ON")
  49. print("Aktiverer om...")
  50. print("3")
  51. sleep(1)
  52. print("2")
  53. sleep(1)
  54. print("1")
  55. sleep(1)
  56. term.clear()
  57. term.setCursorPos(1,1)
  58. print("Aktiv!")
  59. rednet.broadcast("redlaseron")
  60. print("Laser på")
  61. sleep(laser)
  62. rednet.broadcast("redlaseroff")
  63. print("Laser av")
  64. sleep(1)
  65. print("Alarm av")
  66. rednet.broadcast("ALARM_OFF")
  67. term.clear()
  68. end
  69. end
  70. if pw == ladlaser then
  71. laserstatus = 1
  72. rednet.broadcast("ladlaser")
  73. end
  74. if pw == uladlaser then
  75. laserstatus = 0
  76. rednet.broadcast("uladlaser")
  77. end
  78. if pw == laser_on then
  79. laserstatus = 1
  80. rednet.broadcast("redlaseron")
  81. rednet.broadcast("ladlaser")
  82. end
  83. if pw == laser_off then
  84. laserstatus = 0
  85. rednet.broadcast("redlaseroff")
  86. rednet.broadcast("uladlaser")
  87. end
  88. end
Add Comment
Please, Sign In to add comment