Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local mon = peripheral.wrap("left")
  2. term.redirect(mon)
  3. local status = {"<Enter Card>","<Rejected>","<Granted>"}
  4. local current = 1
  5. local combo = "974631"
  6. local lastTimer
  7. while true do
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. print("Bienvenue")
  11. print(status[current])
  12. local event,arg1,arg2,arg3 = os.pullEvent()
  13. if event == "timer" and arg1 == lastTimer then
  14. current = 1
  15. lastTimer = nil
  16. rs.setOutput("right",false)
  17. elseif event == "mag_swipe" then
  18. if arg1 == combo then
  19. lastTimer = os.startTimer(3)
  20. current = 3
  21. rs.setOutput("right",true)
  22. else
  23. lastTimer = os.startTimer(3)
  24. current = 2
  25. end
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement