Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local listeners={}
- local function waitForListeners(pass)
- while true do
- event, id,msg=os.pullEvent("rednet_message")
- if msg == pass then
- rednet.send(id, "Granted")
- if not listeners[id] then listeners[id] = true end
- elseif msg == "exit" and listeners[id] == true then
- listeners[id] = nil
- else
- rednet.send(id, "Denied")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment