PtokaX forum

Archive => Archived 4.0 boards => Request for Lua 4 scripts => Topic started by: nErBoS on 21 October, 2003, 13:51:55

Title: Double IP-Blocker
Post by: nErBoS on 21 October, 2003, 13:51:55
Hi all,

Need a double IP-blocker please !!

Best regrads, nErBoS
Title:
Post by: [NL]Pur on 21 October, 2003, 13:55:26
don't know who wrote this:
but here you go


botname = "DoubleKick"
ip={}
oAllow={}

function Main()
oAllow["127.0.0.1"]=1 --Just an example;)
end

function NewUserConnected(user)
theIP=user.sIP
local a,b,c,d=splittip(theIP)
if ip[user.sIP] == nil then
ip[user.sIP]=user.sIP
elseif ((oAllow[a]==1)or(oAllow[b]==1)or(oAllow[c]==1)or(oAllow[d]==1)) then
else
user:Kick("No doubles allowed!!!")
end
end

function UserDisconnected(user)
ip[user.sIP]=nil
end

function splittip(IP)
r,g,a,b,c,d = strfind(IP, "(%d*).(%d*).(%d*).(%d*)")
d=a.."."..b.."."..c.."."..d
c=a.."."..b.."."..c..".*"
b=a.."."..b..".*"
a=a..".*"
return a,b,c,d
end
 
Title:
Post by: Ron_Doe on 21 October, 2003, 16:34:02
Dont know how this script  works    but  there is some ppl  who got 2 computers on the same ip    so it would be smart to also check the share together with the ip.


Ron