Advertisement
babulm

Untitled

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