PtokaX forum

Archive => Archived 4.0 boards => Help with Lua 4 scripts => Topic started by: Alexandros on 16 October, 2003, 05:13:00

Title: spam bot
Post by: Alexandros on 16 October, 2003, 05:13:00
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
Title:
Post by: Alexandros on 17 October, 2003, 00:09:31
Anyone? :(
Title:
Post by: servaks on 17 October, 2003, 12:19:25
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
Title:
Post by: pHaTTy on 17 October, 2003, 14:41:47
iev never seen someone advertise that b4 tho :P
Title:
Post by: Alexandros on 18 October, 2003, 10:21:34
what i need to do if i don't want to kick ...i only want to receibe a message...

Thanks again
Title:
Post by: [NL]Pur on 18 October, 2003, 12:34:17
try to add a  SendToOps
Title:
Post by: Alexandros on 19 October, 2003, 11:39:51
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
Title:
Post by: klownietklowniet on 20 October, 2003, 02:04:44
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...
Title:
Post by: Alexandros on 20 October, 2003, 15:47:54
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')