is was wondering if theres any way to check slots for passive and active users heres the script.
botName = "seNsi"
tabSlots = {n=0}
tmrSlots = 4
function Main()
frmHub:RegBot(botName)
frmHub:EnableSearchData(1)
end
function DataArrival(user, data)
if strsub(data, 1, 1) == "<" then
local s, e, cmd = strfind(data,"^%b<> %!(%a+)")
if cmd == "slots" then
user:SendPM(botName, "checking..")
tinsert(tabSlots, { user.sName, clock(), {} })
SendToAll("$Search Hub:"..botName.." T?F?0?1?.|")
return 1
end
elseif strsub(data, 1, 3) == "$SR" then
local s, e, free, all = strfind(data, " (%d+)/(%d+)"..strchar(5))
local i = 1
while tabSlots do
local table = tabSlots
if not table[3][user.sName] then
table[3][user.sName] = free.."/"..all
if free ~= "0" then SendPmToNick(table[1], botName, "\t"..user.sName.."\t"..free.."/"..all) end
end
if clock() >= table[2] + tmrSlots then
if getn(table[3]) == 0 then SendPmToNick(table[1], "no users with free slots") end
tremove(tabSlots, i)
else i = i + 1
end
end
end
end
Hi,
The script only checks free slots for active users, because is not possible to get free slots from passive users.
Best regards, nErBoS