Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require"component"
- local gl = component.openperipheral_bridge
- print(1)
- nicks={}
- chat_buffer ={}
- function chatDraw()
- gl.clear()
- for i=1, #chat_buffer do
- gl.addText(3,10*i+20,chat_buffer[i], 0xFFF700)
- end
- gl.sync()
- end
- while true do
- local n = #component.radar.getPlayers(100)
- for j=1,n do
- nicks[j]=component.radar.getPlayers(100)[j].name
- end
- flag = true
- for i=1,n do
- for j=i+1,n do
- if nicks[i]==nicks[j] then
- flag = false
- end
- end
- end
- if flag == true then
- for i = 1, n do
- local nick = nicks[i]
- table.insert(chat_buffer,nick)
- end
- chatDraw()
- end
- if #chat_buffer~=0 then
- for i = 1, #chat_buffer do
- table.remove(chat_buffer,1)
- end
- end
- os.sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement