Hi peeps
I have a kick part, how do i ad to string.find when a user is kicked with client so that the kick is added in temporary kicked.log?
if (cmd == "!kick") then
local _,_,To,From,Msg = string.find(data, "$to:%s+(%S+)%s+from:%s+(%S+)%s+%S+%s+(.+)|")
if (GetItemByName(extra) == nil) then
curUser:SendData(Bot, extra..""..line161.."")
else
local BadUser = GetItemByName(extra)
if BadUser.iProfile ~= 0 then
if (kicked[BadUser.sName] == nil) then
kicked[BadUser.sName] = 1
else
kicked[BadUser.sName] = kicked[BadUser.sName] + 1
end
if (kicked[BadUser.sName] == MaxKicks) then
SendToOps(Bot, extra..""..line162..""..curUser.sName..""..line160..""..rest..".")
SendToOps(Bot, ""..line159..""..extra.."'s "..MaxKicks.." kick, so is now banned.")
BadUser:SendPM(Bot, ""..line163..""..curUser.sName..""..line160..""..rest..".")
BadUser:SendPM(Bot, ""..line164..""..MaxKicks..""..line165.."")
BadUser:Ban()
kicked[BadUser.sName] = nil
SaveToFile("Guardian/data/kicked.log", kicked, "kicked")
else
BadUser:SendPM(Bot, ""..line163..""..curUser.sName..""..line160..""..rest..".")
BadUser:SendPM(Bot, ""..line166..""..kicked[BadUser.sName].."" ..line167..""..MaxKicks..""..line168.."")
SendToOps(Bot, extra..""..line162..""..curUser.sName..""..line160..""..rest..".")
BadUser:TempBan()
SaveToFile("Guardian/data/kicked.log", kicked, "kicked")
end
else
BadUser:SendPM(Bot, curUser.sName..""..line169.."")
curUser:SendData(Bot, BadUser.sName..""..line170.."")
end
end
return 1
end -- kick
Here is something that may help you:
KickArrival = function(user,data)
local s,e,sVictim = string.find(data,"^$Kick%s(%S+)|$")
if sVictim then
-- Your code
end
end
ChatArrival = function(user,data)
if string.find(data,"^%b<>%s+is%skicking%s%S+%sbecause:%s.*|$") then
-- Your code
end
end
ToArrival = function(user,data)
local s,e,to = string.find(data,"^$To:%s(%S+)%s+From:")
if to and GetItemByName(to) then
local s,e,msg = string.find(data,to.."%s+%S+%s-%$%b<>%s+(.*)|$")
if msg and string.find(msg,"^You%sare%sbeing%skicked%sbecause:%s.*$") then
-- Your code
end
end
end
Thnx jiten, gonna try