Advertisement
babulm

Untitled

Aug 25th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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. sleep(3)
  25. end
  26.  
  27. function torzu()
  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 == zu then
  39. torzu()
  40. status = offen
  41. else
  42. torauf()
  43. status = zu
  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