This script has been tested and works perfectly so i am releasing it here.
If you are using scripts to do a similar job then there might be conflicts.
Here's the code...
--------------------------------------------------------------------------------
-- IPRangeBan-Adultfinder Bot by ruler
-- This will IP Range ban UNREGISTERED USERS from posting
-- keywords that you have chosen between the "....." you can
-- add more if desired.
--------------------------------------------------------------------------------
antiporn = {
["erotichub"]=1,
["women.ab3"]=2,
["add.another.addy.here"]=2,
}
Bot = frmHub:GetHubBotName()
-----------------------------
function ToArrival(user, data)
AntiAdvertise(user,data)
end
-----------------------------
function ChatArrival(user, data)
AntiAdvertise(user,data)
end
-----------------------------
function AntiAdvertise(user,data)
if user.iProfile == -1 then
for key,a in antiporn do
if( string.find(string.lower(data), key) ) then
user:SendPM(Bot, "Thanks, Your IP-Range Is Now Banned :-D")
SendToAll(Bot, "<"..user.sName.."> has been IP-Range banned for spamming porn site addresses.")
_,_,ak,bk,ck,dk = string.find(user.sIP, "(%d+).(%d+).(%d+).(%d+)")
FIP = ak.."."..bk.."."..ck.."."..0
TIP = ak.."."..bk.."."..ck.."."..255
RangeBan(FIP, TIP, key, Bot, 5)
user:Disconnect()
return 1
end
end
end
end
enjoy
in both Arrivals there no need for the "if string.sub" check ...
hence the making of the splitted Arrivals :) ..
and range banning will make many innocent users suffer also, since the ADF spammer have many ip's all over the world..
and further more D2AF scriopt would immo be better to use since it blocks nearly all the messages the spammer has and timebans/bans based on that..
besides that, it's a nice attempt and also gives users a second choice in d2af scripts ..
Typhoon?
yup thanks for that, its just i have many friendly hub owners and DC user getting tired of those spam bots and decideed to help out a little. i understand what you are saying about having many IPs & innocent users being banned but some hubs are losing good quality users because of these Bots. many of these hub owners work very hard to make a great place to stay and i think its a shame but i might edit that script as it was a little rushed (although it works). i hope its of some use to someone.
thanks