Cardwell

test

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