PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: enema on 19 November, 2004, 10:05:24

Title: IP spam blocker
Post by: enema on 19 November, 2004, 10:05:24
As you probably noticed, In past few days Ive been searching for ways, how to block spammers who posts IP addresses... I didnt found any script, that could do the job, so I created my own... Only problem is,that this creation of mine eats f*ckin lot of memory (almost as much as RoboCop)... If there are soul in this forum, that could fix that and keep or even upgrade bots efficiency, please do it!

this is my creation (http://www.punk.eclub.lv/spam.rar)
Title:
Post by: blackwings on 19 November, 2004, 14:43:46
well, I tried and failed making the idea that I had to make you script faster.

Why not modify a IP range blocker and mix it together with your script. then you can simple add that it should look for =
0.0.0.0-255.255.255.255
Title:
Post by: enema on 19 November, 2004, 14:57:48
havent thoght about that. what I tried to do looks something like this:
trigs =  { "..a.."."..b.."}

a = "60.","61.", etc...
b = "1", "2", "3"

also i tried to make script read triggers from file, but it disconnected me every time when I posted "1" in chat instead of real IP

Maybe you can use one of my ideas? Thing is, that I dont really know lua... when I make a script, its usually is a remake of another scripts.... I look and I learn, thats what I say... Too bad its not so simple as it sounds...

One of main reason, why I want this script is because many ppl in my country doesnt even know how to create an own domain, but they still think, that they could be better hub owners than anyone else...
Title:
Post by: blackwings on 19 November, 2004, 16:09:08
I don't think this work(yes I'm a huge lua newbie and I have amazingly allot more to learn >_< ),
but maybe it will give someone else a idea how to solve this = botname = "blocker"

a=(%d)
b=(%d)
c=(%d)
d=(%d)

iprange = ..a.."."..b.."."..c.."."..d..

function DataArrival(user, data)
if not user.bOperator then
if( strfind(data, iprange,1,1)) then
if (a >= 0) and (a <= 255)
if (b >= 0) and (b <= 255)
if (c >= 0) and (c <= 255)
if (c >= 0) and (c <= 255)
SendPmToOps(botname, user.sName.." has been kicked because of advertising. His IP was "..user.sIP.." and he has been kicked because of word '"..key.."'")
SendToAll(botname, user.sName.." has been kicked because of Advertising.")
user:TempBan()
end
end
end
end
end
end
end