Advertisement
Cardwell

Test

Apr 3rd, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. --Alle variabler
  2. local redspawner = "left"
  3. local redlaser = "back"
  4. local input = "right"
  5. local reset = "top"
  6. local laserstatus = ""
  7. local viftestatus = ""
  8. local spawner = 5
  9. local laser = 1
  10. local erlaserklar = ""
  11. local mottafra = 16
  12.  
  13. local dragedrap = "1"
  14. local ladlaser = "2"
  15. local uladlaser = "3"
  16.  
  17. rednet.open("left")
  18. while true do
  19. id, msg = rednet.receive()
  20. term.clear()
  21. term.setCursorPos(1,1)
  22. print("Programmer:")
  23. print("1. Drep drage")
  24. print("2. Skru på laser lading")
  25. print("3. Skru av laser lading")
  26. term.setCursorPos(1,6)
  27. write("Lader laser: ")
  28. write(laserstatus)
  29. term.setCursorPos(1,7)
  30. write("Er laser klar: ")
  31. write(erlaserklar)
  32. term.setCursorPos(1,8)
  33. write("Status vifte: ")
  34. write(viftestatus)
  35. term.setCursorPos(1,9)
  36. write("Kjør program:")
  37.  
  38. pw = read()
  39.  
  40. if pw == dragedrap then
  41. term.clear()
  42. term.setCursorPos(1,1)
  43. print("Venter på laser..")
  44. laserstatus = 1
  45. rednet.broadcast("ladlaser")
  46. if
  47. erlaserklar == 1 then
  48. term.clear()
  49. term.setCursorPos(1,1)
  50. print("Laser klar!")
  51. sleep(1)
  52. term.clear()
  53. term.setCursorPos(1,1)
  54. print("Aktiverer om...")
  55. print("3")
  56. sleep(1)
  57. print("2")
  58. sleep(1)
  59. print("1")
  60. sleep(1)
  61. term.clear()
  62. term.setCursorPos(1,1)
  63. print("Aktiv!")
  64. rednet.broadcast("fanon")
  65. viftestatus = 1
  66. rednet.broadcast("spawneron")
  67. sleep(spawner)
  68. rednet.broadcast("spawneroff")
  69. rednet.broadcast("redlaseron")
  70. sleep(laser)
  71. rednet.broadcast("redlaseroff")
  72. rednet.broadcast("fanoff")
  73. viftestatus = 0
  74. term.clear()
  75. end
  76. end
  77. if pw == ladlaser then
  78. laserstatus = 1
  79. rednet.broadcast("ladlaser")
  80. end
  81. if pw == uladlaser then
  82. laserstatus = 0
  83. rednet.broadcast("uladlaser")
  84. end
  85. if pw == fanon then
  86. rednet.broadcast("fanon")
  87. end
  88. if pw == fanoff then
  89. rednet.broadcast("fanoff")
  90. end
  91. if id == mottafra and msg == "laserklar" then
  92. erlaserklar = 1
  93. end
  94. if id == mottafra and msg == "laserikkeklar" then
  95. erlaserklar = 0
  96.  
  97.  
  98. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement