Advertisement
fantadada

loll

May 7th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. detecte = false
  2. needsleep = false
  3. reader = peripheral.wrap("top")
  4. while true do
  5. reader.scan()
  6. detecte = false
  7. while true do
  8. event, message = os.pullEvent()
  9. if event == "rfid_detected" then
  10. if message == "aypierre" then
  11. detecte = true
  12. shell.run("start")
  13. needsleep = true
  14. end
  15. elseif event == "rfid_scan_done" then
  16. if detecte == false then
  17. if needsleep == true then
  18. sleep(2)
  19. needsleep = false
  20. end
  21. os.reboot()
  22. end
  23. break
  24. end
  25. end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement