PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: c h i l l a on 02 November, 2003, 19:17:07

Title: Bad IP finder
Post by: c h i l l a on 02 November, 2003, 19:17:07
dunno if anybody needs this, but I wrote it, cause it might help finding bad IP's  since, I think that searchbots usually use the same IP but different names.
I wrote this script whitch will report a IP to a nick if it was used 3 times by different nicks per day.

--sBot-finder-V.1 by chill.

--BotName
bot = "IP-Bot"
--Nick To Report the IP
Nicktosend = "Nick"

IPtoNAME = {}
curday = 1

function NewUserConnected(curUser)
if tonumber(date("%d")) ~= curday then
curday = tonumber(date("%d"))
IPtoNAME = {}
end
if not IPtoNAME[curUser.sIP] then
IPtoNAME[curUser.sIP] = { }
tinsert(IPtoNAME[curUser.sIP], curUser.sName)
elseif IPtoNAME[curUser.sIP] then
for i = 1,getn(IPtoNAME[curUser.sIP]) do
if IPtoNAME[curUser.sIP][i] == curUser.sName then
return 0
end
end
tinsert(IPtoNAME[curUser.sIP], curUser.sName)
if getn(IPtoNAME[curUser.sIP]) == 3 then
SendPmToNick(Nicktosend,bot," **** "..curUser.sIP.." was used by 3 differerent UserNames today.")
for i = 1,getn(IPtoNAME[curUser.sIP]) do
SendPmToNick(Nicktosend,bot," **** Nick "..i.." = "..IPtoNAME[curUser.sIP][i])
end
IPtoNAME[curUser.sIP] = nil
end
end
end
Title:
Post by: dvxjunkie on 31 December, 2003, 00:45:21
great idea Ive been needing this for some time. no shortage of lamers playing the "rotating nicks game" with me.