Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pside = "top"
- local perList = peripheral.wrap("top")
- perList.clear()
- for k,v in pairs(perList) do
- print(k)
- end
- --MudkipTheEpic
- local bdg=perList
- rednet.open("left")
- rednet.broadcast("getWhitelist")
- local _,w=rednet.receive(5)
- assert(type(w)=="table")
- local whitelist = {}
- for k,v in pairs(w) do
- whitelist[v]=true
- end
- local connectedUsers={}
- local function updateList()
- while true do
- local _,user=os.pullEvent("registered_player_join")
- if whitelist[user] then os.queueEvent("user_add",user) end
- end
- end
- local function draw(urface)
- while true do
- local tEvent={os.pullEvent()}
- if tEvent[1]=="draw" then
- surface.addBox(0,0,10,10,0xFF) --Just for testing
- end
- end
- end
- local function manage()
- while true do
- local tEvent={os.pullEvent()}
- if tEvent[1]=="user_add" then
- manager:addCo(draw,connectedUsers[tEvent[2]])
- os.queueEvent("draw")
- end
- end
- end
- manager:addCo(manage)
- manager:addCo(updateList)
- --perList.getStringWidth(" 00")
- --perList.addBox(1, 60, 20, 30, 0xFFFFFF, 0.05)
Advertisement
Add Comment
Please, Sign In to add comment