I have this bot:
--Anti advertising script by SRJbb99 - 06.01.2003
--A bit modifyed and added that bot sends a PM to all ops on triger and kicks user by piglja - 18/03/03
botname = "SPAM"
trigs = {
["testfddfskdjfkls"]=1,
["xxx.xxx.xxx.xxx"]=2
}
function DataArrival(user, data)
if ( strsub(data, 1, 4) == "$To:" ) then
for key,a in trigs do
if( strfind( strlower(data), key) ) then
SendPmToNick("blablabal",botname, user.sName.." has been advertising. His IP was "..user.sIP.." and he has been said '"..key.."'")
end
end
end
end
what i need to do to add another word, and to allow empty chars....like this ["t e s t 1 0"]=1,???
thanks
Alex
Anyone? :(
Try this one, forks fine for me...
--Botname
botname = "Hub-Security"
--Ban for ... mins
minutes = "5"
trigs = {
["blabla"]=1,
["b l a b l a"]=2,
["b l a b l a"]=3,
}
function Main()
frmHub:RegBot(botname)
end
function DataArrival(user, data)
if (not user.bOperator) then
if (( strsub(data, 1, 1) == "<" ) or ( strsub(data, 1, 4) == "$To:" )) then
for key,a in trigs do
if( strfind( strlower(data), key) ) then
SendToAll( botname, user.sName.." has been kicked because of advertising." )
user:TimeBan(minutes)
user:Disconnect()
end
end
end
end
end
/shipis
iev never seen someone advertise that b4 tho :P
what i need to do if i don't want to kick ...i only want to receibe a message...
Thanks again
try to add a SendToOps
now i have 3 things:
B L A
B L A B L A S
B L A S
the script always say someone is saying B L A ...instead of the other 2 things...
Another thing: is there a way to get all the spammer is saying in this line (in the line he say the forbidden word)?
thankyou again
P.D: I have this bot:
--Anti advertising script by SRJbb99 - 06.01.2003
--A bit modifyed and added that bot sends a PM to all ops on triger and kicks user by piglja - 18/03/03
botname = "SPAM"
trigs = {
["testfddfskdjfkls"]=1,
["xxx.xxx.xxx.xxx"]=2,
}
function DataArrival(user, data)
if ( strsub(data, 1, 4) == "$To:" ) then
for key,a in trigs do
if( strfind( strlower(data), key) ) then
SendPmToNick("blablabal",botname, user.sName.." has been advertising. His IP was "..user.sIP.." and he has been said '"..key.."'")
end
end
end
end
The loop stops at the first it encounted of a key, so "B L A" is the first, I can't really see why you got the other 2 there....
For your question change
SendPmToNick("blablabal",botname, user.sName.." has been advertising. His IP was "..user.sIP.." and he has been said '"..key.."'")
to:
SendPmToNick("blablabal",botname, user.sName.." has been advertising. His IP was "..user.sIP.." and he has been said '"..data)
Don't remember if you need to remove the pipe at the end, but since you are not adding anything to the end of the string it shouldn't matter I think...
PS: Spamming is NOT the same as advertising...
Thanks!!!!javascript:smilie(':D')
javascript:smilie(':D')javascript:smilie(':D')
javascript:smilie(':D')javascript:smilie(':D')
javascript:smilie(':D')javascript:smilie(':D')
javascript:smilie(':D')javascript:smilie(':D')
javascript:smilie(':D')