Advertisement
CodeCrafter

Mag-Reader

Dec 28th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. local status = {"<Enter Card>","<ERROR>","<Succes>"}
  2. local current = 1
  3. local combo = "#AdminCart"
  4. local lastTimer
  5. while true do
  6. term.clear()
  7. term.setCursorPos(1,1)
  8. print("Login to acces the computer")
  9. print(status[current])
  10. local event,arg1,arg2,arg3 = os.pullEvent()
  11. if event == "timer" and arg1 == lastTimer then
  12.   current = 1
  13.   lastTimer = nil
  14.   os.reboot()
  15. elseif event == "mag_swipe" then
  16.   if arg1 == combo then
  17.    lastTimer = os.startTimer(3)
  18.    current = 3
  19.    shell.run("Menu")
  20.   else
  21.    lastTimer = os.startTimer(3)
  22.    current = 2
  23.   end
  24. end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement