Advertisement
Cardwell

Dragedraptest

Apr 2nd, 2021 (edited)
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 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.  
  28. pw = read()
  29.  
  30. if pw == dragedrap then
  31. term.clear()
  32. term.setCursorPos(1,1)
  33. print("Starter reset")
  34. rs.setOutput(reset, true)
  35. sleep(1)
  36. rs.setOutput(reset, false)
  37. term.clear()
  38. print("Venter på laser..")
  39. os.pullEvent("redstone")
  40. laserstatus = 1
  41. rs.setOutput(laserbryter, true)
  42. if
  43. rs.getInput("right") then
  44. term.clear()
  45. print("Laser klar!")
  46. sleep(1)
  47. term.clear()
  48. term.setCursorPos(1,1)
  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. rs.setOutput(redspawner, true)
  60. sleep(spawner)
  61. rs.setOutput(redspawner, false)
  62. rs.setOutput(redlaser, true)
  63. sleep(laser)
  64. rs.setOutput(redlaser, false)
  65. term.clear()
  66. end
  67. end
  68.  
  69. if pw == ladlaser then
  70. laserstatus = 1
  71. rs.setOutput(laserbryter, true)
  72. end
  73. if pw == uladlaser then
  74. laserstatus = 0
  75. rs.setOutput(laserbryter, false)
  76. end
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement