Advertisement
babulm

Untitled

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