Script that prints who joined
So if someone joins the room you see the join message in chat.
Someone asked me to do this, and I think I got it working.
I'm not sure why would you need this, maybe to work with a black shader which makes queue list unreadable.
Anyways , usage:
- download the script
- put it into data/script folder
- type /ls join_msg.lua
- enjoy
lua code:
-- user join msg
local players = {}
local function mergeArrs(first_table, second_table)
local result = {}
for k,v in pairs(first_table) do
table.insert(result, v)
end
for k,v in pairs(second_table) do
table.insert(result, v)
end
return result
end
local function tableContains(table, val)
for k, v in pairs(table) do
if v == val then
return true
end
end
return false
end
local function checkNewUsers()
local queue = mergeArrs(get_spectators(), get_bouts())
for i, player in pairs(queue) do
if false == tableContains(players, player) then
echo("[+] " .. player)
table.insert(players, player)
end
end
end
add_hook("bout_update", "", checkNewUsers)
players = mergeArrs(get_spectators(), get_bouts())
echo("join_msg.lua loaded")
Last edited by 0xdead; Jul 30, 2023 at 07:39 PM.
Reason: added attachment