------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- UserToBotDescription by Nickolya aka AУA™
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Конфиг бота:
tUserToBot = {
["Бот"] = {
["sDescription"] = "",
["sNeedClient"] = "",
["sNeedVersion"] = "",
["sNeedConnection"] = "",
["sNeedHubs"] = "",
["sIP"] = "",
["sMode"] = "",
["sEmail"] = "",
["iShare"] = 80,
},
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function OnStartup()
tNeedToSendAll = {}
DoNeedDescription()
SendFakeDescription()
TmrMan.AddTimer(1000, "OnTimer1")
end
function GetNickListArrival(curUser,sData)
tNeedToSendAll[curUser.sNick] = 1
end
function OnTimer1()
for sName in pairs(tNeedToSendAll) do
local tNeedUser = Core.GetUser(sName)
if tNeedUser and Core.GetUserValue(tNeedUser, 9) then
SendFakeDescription(tNeedUser)
tNeedToSendAll[sName] = nil
end
end
collectgarbage("collect")
end
function SendFakeDescription(curUser)
for i, v in pairs(tUserToBot) do
local sNewMyINFO = v.sMyINFO
local sIPInfo = "$UserIP "..i.." "..v["sIP"]
if not curUser then
Core.SendToAll(sNewMyINFO)
Core.SendToAll(sIPInfo)
else
Core.SendToUser(curUser, sNewMyINFO)
Core.SendToUser(curUser, sIPInfo)
end
end
end
function DoNeedDescription()
for i, v in pairs(tUserToBot) do
tUserToBot[i].sMyINFO = "$MyINFO $ALL "..i.." "..v.sDescription.."<"..(v["sNeedClient"] or "Bot'sDC++").." V:"..(v["sNeedVersion"] or "1.00")..",M:"..(v.sMode or "A")..",H:"..(v["sNeedHubs"] or "0/0/1")..",S:"..(v.iSlots or 0)..">$ $"..(v["sNeedConnection"] or "BOT").."$"..(v.sEmail or "").."$"..(v["iShare"] or 0).."$"
end
end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------