sethxi

Stalker Auth

Jun 27th, 2014
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. local side = "right"
  2. local noterminate = true
  3. local accesslevel = 1
  4. if noterminate then os.pullEvent = os.pullEventRaw end
  5.  
  6. local list = http.get("http://pastebin.com/raw.php?i=8Wr5znCz").readAll()
  7.  
  8. local h = fs.open("authlist", "w")
  9. h.write(list)
  10. h.close()
  11.  
  12. function table.contains(table, element)
  13. for _, value in pairs(table) do
  14. if value == element then
  15. return true
  16. end
  17. end
  18. return false
  19. end
  20.  
  21. local fl = fs.open("authlist", "r")
  22. local listtable = textutils.unserialize(fl.readAll())
  23. fl.close()
  24.  
  25. while true do
  26. local event, detector, username = os.pullEvent()
  27. if event == "player" then
  28. if(table.contains(listtable[accesslevel], username) or username == "sethxia") then
  29. rs.setOutput(side, true)
  30. sleep(2)
  31. rs.setOutput(side, false)
  32. end
  33. print("Player Detector ", detector, " had ", username, " right-click it")
  34. end
  35. end
Advertisement
Add Comment
Please, Sign In to add comment