Advertisement
babulm

Untitled

Aug 25th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. statuss = "status"
  2.  
  3. --true = zu--
  4. --false= offen--
  5. function speichern()
  6. local file = fs.open(statuss, "w")
  7. file.writeLine(status)
  8. file.close()
  9. end
  10.  
  11. function laden()
  12. file = fs.open(statuss, "r")
  13. status = file.readLine()
  14. file.close()
  15. end
  16.  
  17. function torzu()
  18. for i = 1,4 do
  19. rs.setBundledOutput("left", colours.orange)
  20. sleep(1)
  21. rs.setBundledOutput("left", colours.cyan)
  22. sleep(1)
  23. end
  24. sleep(3)
  25. end
  26.  
  27. function torauf()
  28. for i = 1,4 do
  29. rs.setBundledOutput("left", colours.magenta)
  30. sleep(1)
  31. rs.setBundledOutput("left", colours.cyan)
  32. sleep(1)
  33. end
  34. sleep(3)
  35. end
  36. function abfrage()
  37. if rs.testBundledInput("right", colours.green) then
  38. if status then
  39. torauf()
  40. status = false
  41. else
  42. torzu()
  43. status = true
  44. end
  45. end
  46. end
  47. local status = read()
  48. while true do
  49. speichern()
  50. laden()
  51. abfrage()
  52. speichern()
  53. sleep(0,5)
  54. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement