Advertisement
babulm

Untitled

Aug 25th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. statuss = "status"
  2. local status
  3.  
  4.  
  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 torauf()
  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. end
  25.  
  26. function torzu()
  27. for i = 1,4 do
  28. rs.setBundledOutput("left", colours.magenta)
  29. sleep(1)
  30. rs.setBundledOutput("left", colours.cyan)
  31. sleep(1)
  32. end
  33. end
  34. function abfrage()
  35. if rs.testBundledInput("right", colours.green) then
  36. if status == zu then
  37. torauf()
  38. status = offen
  39. else
  40. torzu()
  41. status = zu
  42. end
  43. end
  44. end
  45. local status = read()
  46. while true do
  47. speichern()
  48. laden()
  49. abfrage()
  50. speichern()
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement