SHARE
TWEET

Untitled

OpposingGeek Apr 21st, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. password = "pie"
  2.  
  3. function getUsers()
  4.     prox = peripheral.wrap("top")
  5.     targets = prox.getTargets()
  6.     for k,v in pairs(targets) do
  7.         if v.Name == "Player" then
  8.           details = prox.getTargetDetails(k)
  9.           return details.Username
  10.         end
  11.     end
  12. end
  13.  
  14. rednet.open("left")
  15. while true do
  16.     id, msg, prot = rednet.receive()
  17.     if prot == "pass" then
  18.         if msg == password then
  19.             rednet.send(id, "granted", "pass")
  20.         else
  21.             rednet.send(id, "denied", "pass")
  22.         end
  23.     end
  24.     if prot == "getUser" then
  25.         rednet.send(id, getUsers(), "getUser")
  26.     end
  27. end
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top