Cardwell

Drageded

Apr 2nd, 2021 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 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 laserbryter = "bottom"
  7. local laserstatus = ""
  8. local spawner = 5
  9. local laser = 1
  10.  
  11. local dragedrap = "1"
  12. local ladlaser = "2"
  13. local uladlaser = "3"
  14.  
  15. while true do
  16. term.clear()
  17. term.setCursorPos(1,1)
  18. print("Programmer:")
  19. print("1. Drep drage")
  20. print("2. Skru på laser lading")
  21. print("3. Skru av laser lading")
  22. term.setCursorPos(1,6)
  23. write("Laserstatus: ")
  24. write(laserstatus)
  25. term.setCursorPos(1,8)
  26. write("Kjør program:")
  27. input = redstone.getInput("right")
  28.  
  29. pw = read()
  30.  
  31. if pw == dragedrap then
  32. term.clear()
  33. term.setCursorPos(1,1)
  34. -- print("Starter reset")
  35. -- rs.setOutput(reset, true)
  36. -- sleep(1)
  37. --rs.setOutput(reset, false)
  38. term.clear()
  39. print("Venter på laser..")
  40. --os.pullEvent("redstone")
  41.  
  42. laserstatus = 1
  43. rs.setOutput(laserbryter, true)
  44. if
  45. if input == true then
  46. --rs.getInput("right") then
  47. term.clear()
  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. rs.setOutput(redspawner, true)
  63. sleep(spawner)
  64. rs.setOutput(redspawner, false)
  65. rs.setOutput(redlaser, true)
  66. sleep(laser)
  67. rs.setOutput(redlaser, false)
  68. term.clear()
  69. end
  70. end
  71. if input == false then
  72. print("venter på laser..")
  73.  
  74. if pw == ladlaser then
  75. laserstatus = 1
  76. rs.setOutput(laserbryter, true)
  77. end
  78. if pw == uladlaser then
  79. laserstatus = 0
  80. rs.setOutput(laserbryter, false)
  81. end
  82. end
  83. end
Add Comment
Please, Sign In to add comment