ok been learning whilst making a script, so here is RangeMaster v1, i know i have not updated it yet so please w8, i am working on loading into table etc, maybe and cleaning up to make abit faster ;)
Bot = "RangeMaster"
function Main()
end
function NewUserConnected(user)
Blocked(user)
end
function OpConnected(user,data)
Blocked(user)
end
function Blocked(user)
local s,e,range1,range2,range3,range4 = strfind(user.sIP,"(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,range1.." found to "..range2.." then to "..range3.." and finally "..range4)
local handle = openfile("RangeMaster/Range.dat","r")
line = read(handle)
while line do
if (line == nil) then
break
elseif strfind(line, "$"..range1.."$",1,1) then
--SendToAll(Bot,line.." was found with nick: "..user.sName)
local s,e,rangerS,therest = strfind(line,"(%S+)$(.*)")
--SendToAll(Bot,rangerS.." then "..therest)
local s,e,ipa1,ipb1,ipc1,ipd1,ipa2,ipb2,ipc2,ipd2 = strfind(line,"(%d+).(%d+).(%d+).(%d+)|(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,ipa1..ipb1..ipc1..ipd1..ipa2..ipb2..ipc2..ipd2)
if range1 < ipa1 then
return 0
elseif range1 > ipa2 then
return 0
elseif range1 > ipa1 and range1 < ipa2 then
SendToAll(Bot,"Banning: "..user.sName.." for bad ip: "..user.sIP)
user:Ban()
else
if range2 < ipb1 then
return 0
elseif range2 > ipb2 then
return 0
elseif range2 > ipb1 and range1 <= ipb2 then
SendToAll(Bot,"Banning: "..user.sName.." for bad ip: "..user.sIP)
user:Ban()
else
if range3 < ipc1 then
return 0
elseif range3 > ipc2 then
return 0
elseif range3 > ipc1 and range1 < ipc2 then
SendToAll(Bot,"Banning: "..user.sName.." for bad ip: "..user.sIP)
user:Ban()
else
if range4 < ipd1 then
return 0
elseif range4 > ipd2 then
return 0
elseif range4 > ipd1 and range4 < ipd2 then
SendToAll(Bot,"Banning: "..user.sName.." for bad ip: "..user.sIP)
user:Ban()
else
return 0
end
end
end
end
end
line = read(handle)
end
end
i have added some ips to files
but i will add download link once i actually finish this project,
to add an ip
example a
$127$|127.0.0.0|127.0.0.2 --will ban 127.0.0.1
emaple b
$127$128$129$|127.0.0.1|129.0.0.1 --will ban whatever is in between ;)
^^^im going to be working on this now, so if anyone has tips give me some time first see if i can figure them out, im enjoying working on this ;)
so and ip is
$range$anotherrange$|ipfrom|toip
you can add as many ranges as you wish
just look at examples and ask if you want an answer ;)
NOTE: Make a folder and file in scripts dir named RangeMaster/Range.dat
pHaTz,,
Nice Phatty.
QuoteOriginally posted by NightLitch
Nice Phatty.
yep thx, but i think ive made a big mistake, i must have been tired when i wrote this too, i will be releasing a fixed version asap...........
well fixed this, and also added many ips to range, all bad ips, so i will update the script more and then upload it to a server with a auto compile so you can compile it urserf and make faster ;)
--//RangeMaster v1 fixed by Phatty
--//Much more todo
Bot = "RangeMaster"
function Main()
end
function NewUserConnected(user)
Blocked(user)
end
function OpConnected(user,data)
Blocked(user)
end
function Blocked(user)
local s,e,range1,range2,range3,range4 = strfind(user.sIP,"(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,range1.." found to "..range2.." then to "..range3.." and finally "..range4)
local handle = openfile("RangeMaster/Range.dat","r")
line = read(handle)
while line do
if (line == nil) then
break
elseif strfind(line, "$"..range1.."$",1,1) then
--SendToAll(Bot,line.." was found with nick: "..user.sName)
local s,e,rangerS,therest = strfind(line,"(%S+)$(.*)")
--SendToAll(Bot,rangerS.." then "..therest)
local s,e,ipa1,ipb1,ipc1,ipd1,ipa2,ipb2,ipc2,ipd2 = strfind(line,"(%d+).(%d+).(%d+).(%d+)|(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,ipa1..ipb1..ipc1..ipd1..ipa2..ipb2..ipc2..ipd2)
if range1 < ipa1 or range1 > ipa2 then
return 0
else
if range2 < ipb1 or range2 > ipb2 then
return 0
else
if range3 < ipc1 or range3 > ipc2 then
return 0
else
if range4 < ipd1 or range4 > ipd2 then
return 0
else
SendToAll(Bot,user.sName.." is being banned for bad ip:"..user.sIP)
user:Ban()
end
end
end
end
return 0
end
line = read(handle)
end
end
enjoy for now until i do some more
ok wasnt sorted properly dont use the last 2 lol
here is the proper working on ;)
--//RangeMaster v1.01 fixed by Phatty
--//Much more todo
--//Ip Keys Written by (uk-kingdom)John
--//Lots of time testing by Chilla, thx mate ;)
Bot = "RangeMaster"
function Main()
end
function NewUserConnected(user)
Blocked(user)
end
function OpConnected(user)
Blocked(user)
end
function Blocked(user)
local s,e,range1,range2,range3,range4 = strfind(user.sIP,"(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,range1.." found to "..range2.." then to "..range3.." and finally "..range4)
local handle = openfile("RangeMaster/Range.dat","r")
line = read(handle)
while line do
--if (line == nil) then
-- break
if strfind(line, "%$"..range1.."%$") then
--SendToAll(Bot,line.." was found with nick: "..user.sName)
local s,e,rangerS,therest = strfind(line,"(%S+)$(.*)")
--SendToAll(Bot,rangerS.." then "..therest)
local s,e,ipa1,ipb1,ipc1,ipd1,ipa2,ipb2,ipc2,ipd2 = strfind(line,"(%d+).(%d+).(%d+).(%d+)|(%d+).(%d+).(%d+).(%d+)")
--SendToAll(Bot,ipa1..ipb1..ipc1..ipd1..ipa2..ipb2..ipc2..ipd2)
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
SendToAll(Bot,user.sName.." is being banned for bad ip:"..user.sIP)
user:Ban()
return 0
end
end
end
end
end
line = read(handle)
end
end
will be back with more
sure mate no problem :)
Hi there,,
Sounds like a very nice & cool script there,... :)
Well done, Phatty,, & keep it up,, ;)
l8tr,,
QuoteOriginally posted by Guibs
Hi there,,
Sounds like a very nice & cool script there,... :)
Well done, Phatty,, & keep it up,, ;)
l8tr,,
thx mate :))
Keep updating .. Good work, TkS
ok rewritten most, its now loaded into memory for effiecency ;)
DOWNLOAD (http://members.lycos.co.uk/garfvader/RB.rar)
--//RangeBlaster v2.00 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function NewUserConnected(user)
if Blocked(user) == 1 then
user:SendPM(Bot, "This hub is private, you will now be disconnected!")
user:SendPM(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Ban()
end
end
OpConnected = NewUserConnected
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,range,ipr1,ipr2 = strfind(line,"$(%S+)$|(%S+)|(%S+)") --range may be used later on in development
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(user)
local s,e,range1,range2,range3,range4 = strfind(user.sIP,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
return 1
end
end
end
end
end
end
127.0.0.1 to 128.0.0.0 is not supported because 0 end is below the 127 end 0, i will add this in later ;)
so each end must be higher per value.....
Convert the text IP into an actual IP. So you read in A.B.C.D but then you create:
iIP = D + C * 256 + B * 65536 + C * 16777216;
This will give you number between 4294967295 and 0 which you can do very simple conditions on.
Did something like this a while back. The next step is to sort your range table so it can intelligently skip several ranges the number can not be in (so sort of binary search would work). After I made the script we all decided it would MUCH faster to use a nice firewall to block IPs faster than any script ever could.
-NotRabidWombat
little update for speed, this bot im setting on 1 range per ban
so 127 - 128 willnot be supported but ive never seena range like that anyways ;)
--//RangeBlaster v2.01 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function NewUserConnected(user)
if Blocked(user.sIP) == 1 then
user:SendPM(Bot, "This hub is private, you will now be disconnected!")
user:SendPM(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Ban()
end
end
OpConnected = NewUserConnected
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,range,ipr1,ipr2 = strfind(line,"$(%S+)$|(%S+)|(%S+)") --range may be used later on in development
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 == ipa1 then
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
return 1
end
end
end
end
end
end
end
even faster now done in datarival meaning less bandwidth no checks for user ;)
--//RangeBlaster v2.02 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
--//Much faster now done in dataarival so less bandiwdth used for bad user ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,range,ipr1,ipr2 = strfind(line,"$(%S+)$|(%S+)|(%S+)") --range may be used later on in development
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 == ipa1 then
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
return 1
end
end
end
end
end
end
end
function DataArrival(user,data)
if strsub(data, 1, 8) == "$Version" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Ban()
end
end
end
bbl
optionally you can make it little faster by validatenick but it means u dont actually reiceve the nick so its unknown, i prefere version so u see nick but upto you
--//RangeBlaster v2.02 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
--//Much faster now done in dataarival so less bandiwdth used for bad user ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,range,ipr1,ipr2 = strfind(line,"$(%S+)$|(%S+)|(%S+)") --range may be used later on in development
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 == ipa1 then
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
return 1
end
end
end
end
end
end
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Ban()
end
end
end
Well your script is getting better & better AND intresting.
Keep up the work, and I hope I can "borrow" a line or two if I
intend rewriting my ip-script someday.
Have a nice day. / NL
QuoteOriginally posted by NightLitch
Well your script is getting better & better AND intresting.
Keep up the work, and I hope I can "borrow" a line or two if I
intend rewriting my ip-script someday.
Have a nice day. / NL
thanks bro,
here 2.03 ;)
--//RangeBlaster v2.03 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
--//Thanks to RabidWombat for an idea :)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,range,ipr1,ipr2 = strfind(line,"$(%S+)$|(%S+)|(%S+)") --range may be used later on in development
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
ranger1 = ipa1..ipb1..ipc1..ipd1
ranger2 = ipa2..ipb2..ipc2..ipd2
ranged1 = range1..range2..range3..range4
if range1 == ipa1 then
if ranged1 < ranger1 or ranged1 > ranger2 then
else
return 1
end
end
end
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Ban()
end
end
end
nice idea got off rabids way thx ;)
only thing i woudnt use last method i wud still use one of the older because if an ip such as
217.23.23.23
and
217.3.333.23 just as example
then pfff
QuoteOriginally posted by Phatty
only thing i woudnt use last method i wud still use one of the older because if an ip such as
217.23.23.23
and
217.3.333.23 just as example
then pfff
Well bro :-) 333 is not an valid number in ranges anyway, max 255 :-), mean not to be a pain in the ass now.. :-D
you could limit the numbers maybe all over 255 is not a valid number and under 0 or 023 example is not valid. Just some ideas.
/NL
Quoting myself: under 0
hehe
there can't be under 0 I mean 034 hehe...
Must be really dizzy... :-p
loooool
81.-0.1-234 :P ghehehe ;)
hahaha lool
I think that will indeed WORK really good.
I mean -0.1-234 that is so my range. :-D
nah didnt like other way inaccurate so
--//RangeBlaster v2.05 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
Ranges[ipr1] = ipr2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 == ipa1 then
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
collectgarbage()
flush()
return 1
end
end
end
end
end
end
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Disconnect()
end
end
end
i will upload a package with 1224 ip ranges very soon, i have more to add
so far with those ranges bot using 146/293
--//RangeBlaster v2.05 by Phatty
--//Ip Keys Written by (uk-kingdom)John
--//Memory based, will be tweaking soon, to make faster ;)
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local tmp = 0
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
tmp = tmp + 1
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
if ipr2 == nil then
SendToAll(Bot,"Error on line "..line)
end
Ranges[ipr1] = ipr2
line = read(handle)
end
SendToAll(Bot,"Successfully loaded "..tmp)
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
for i,p in Ranges do
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(i, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(p, "(%d*).(%d*).(%d*).(%d*)")
if range1 == ipa1 then
if range1 < ipa1 or range1 > ipa2 then
else
if range2 < ipb1 or range2 > ipb2 then
else
if range3 < ipc1 or range3 > ipc2 then
else
if range4 < ipd1 or range4 > ipd2 then
else
collectgarbage()
flush()
return 1
end
end
end
end
end
end
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Disconnect()
end
end
end
pHaTz,,
The problem with:
ranger1 = ipa1..ipb1..ipc1..ipd1
Is you are still using strings. And a string of an IP address is much different than the number it is supposed to be as you found with:
217.23.23.23
and
217.3.333.23
Try making the IPs in integers like so.
iIP = D + C * 256 + B * 65536 + C * 16777216;
You may have to call tonumber(...) on a some of the strings.
-NotRabidWombat
hmm im not so god with all that sort of things, but hey, i have time to learn thx, ill look into it :))
thnx phatty
btw is it logging the kicked users ?
if not could you make it so it logs the ip and username in a txt file?
i dont see the point of using resources for doing that
my intention is to save hdd life by using memory so writing to a text file when it disconnects someone it pretty pointless and resource using, so i think i give that a miss...........
but maybe i will write a seperate version for you
Why not doing it like me with on/off switches ???
But everyone of us have their own way creating. :-)
This script does take a good shape.
Just brake the computing some more and then I'm gonna mod & use it for my own. And of course I will post that version then.
Keep up the really good work.
/NL
i gonna be adding more but heres v2.07 ;)
--//RangeBlaster v2.07 by Phatty
--//IP Keys written by John, and Phatty
Bot = "RangeBlaster"
Ranges = {}
function Main()
frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local tmp = 0
local handle = openfile("RangeBlaster/Ranges.dat","r")
line = read(handle)
while line do
tmp = tmp + 1
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
if ipr2 == nil then
SendToAll(Bot,"Error on line "..line)
end
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(ipr1, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(ipr2, "(%d*).(%d*).(%d*).(%d*)")
si1 = CheckNumber(ipa1)..CheckNumber(ipb1)..CheckNumber(ipc1)..CheckNumber(ipd1)
si2 = CheckNumber(ipa2)..CheckNumber(ipb2)..CheckNumber(ipc2)..CheckNumber(ipd2)
Ranges[si1] = si2
line = read(handle)
end
SendToAll(Bot,"Successfully loaded "..tmp)
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
checker = CheckNumber(range1)..CheckNumber(range2)..CheckNumber(range3)..CheckNumber(range4)
--SendToAll(Bot,"IP-Test..."..checker)
for i,p in Ranges do
local s,e,xstart = strfind(i, "(%d*)")
local s,e,xend = strfind(p, "(%d*)")
if checker > xstart and checker < xend then
collectgarbage()
flush()
return 1
else
end
end
end
function CheckNumber(number)
numbera = tonumber(number)
if numbera < 10 then
numbera = "00"..number
elseif numbera < 100 then
numbera = "0"..number
else
numbera = number
end
return numbera
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "This hub is private, you will now be disconnected!")
user:SendData(Bot, "Disconnecting...")
SendPmToOps(Bot, user.sName.." - "..user.sIP.." has been blasted by "..Bot.."!")
user:Disconnect()
end
end
end
later,,
Nice going Phatty.
QuoteOriginally posted by NightLitch
Nice going Phatty.
thanks,, i still have some more plans ahead if i get time :)
QuoteOriginally posted by (uk-kingdom)pH?tt?
i will upload a package with 1224 ip ranges very soon, i
Hi m8 , is the package done yett.. :D
QuoteOriginally posted by acethecase
QuoteOriginally posted by (uk-kingdom)pH?tt?
i will upload a package with 1224 ip ranges very soon, i
Hi m8 , is the package done yett.. :D
oops not had time ill upload asap ;)
hehe np I thought I missed it 8)
Nice job btw..
is it going to be posible to download update list on
frobidden IP?s from p2p guardian homep.
it would be nice to have 394966323 IPs from 3406 diffren media profiles.
QuoteOriginally posted by acethecase
hehe np I thought I missed it 8)
hmmm well if u dwnload the new gekko package it is included in there just take the Ranges.dat and use that ;)
hehe fast replay---
oki m8 Ill do so :)
QuoteOriginally posted by acethecase
hehe fast replay---
oki m8 Ill do so :)
eheh did u get it sorted?
lol Im a bit late hehe but yepp m8 I got it,
I hade it tested and its working tnx for ur help m8ty ---
keep up the good work
QuoteOriginally posted by acethecase
lol Im a bit late hehe but yepp m8 I got it,
I hade it tested and its working tnx for ur help m8ty ---
keep up the good work
np ;)
Hi Phatty, having something strange here.. i'm getting the OP MSG from the kicked user without the username :\ returning did i messed something ?
--//RangeBlaster v2.07 by Phatty
--//IP Keys written by John, and Phatty
Bot = "[operserv]"
Ranges = {}
function Main()
--frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local tmp = 0
local handle = openfile("txt/ranges.dat","r")
line = read(handle)
while line do
tmp = tmp + 1
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
if ipr2 == nil then
SendToAll(Bot,"Error on line "..line)
end
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(ipr1, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(ipr2, "(%d*).(%d*).(%d*).(%d*)")
si1 = CheckNumber(ipa1)..CheckNumber(ipb1)..CheckNumber(ipc1)..CheckNumber(ipd1)
si2 = CheckNumber(ipa2)..CheckNumber(ipb2)..CheckNumber(ipc2)..CheckNumber(ipd2)
Ranges[si1] = si2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
checker = CheckNumber(range1)..CheckNumber(range2)..CheckNumber(range3)..CheckNumber(range4)
--SendToAll(Bot,"IP-Test..."..checker)
for i,p in Ranges do
local s,e,xstart = strfind(i, "(%d*)")
local s,e,xend = strfind(p, "(%d*)")
if checker > xstart and checker < xend then
collectgarbage()
flush()
return 1
else
end
end
end
function CheckNumber(number)
numbera = tonumber(number)
if numbera < 10 then
numbera = "00"..number
elseif numbera < 100 then
numbera = "0"..number
else
numbera = number
end
return numbera
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:SendData(Bot, "D?vidas, informe ? [EMAIL]lusobrasil@netcabo.pt[/EMAIL] ? [URL]www.lusobrasil.site.vu[/URL] ?")
SendToOps(Bot, "? OP MSG ? Usu?rio: "..user.sName..", com o IP: ["..user.sIP.."], foi desconectado do Hub por: "..Bot.." - Motivo: IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:TempBan()
user:Disconnect()
end
end
end
TkS in advance
sorry my mistake yup
--//RangeBlaster v2.07 by Phatty
--//IP Keys written by John, and Phatty
Bot = "[operserv]"
Ranges = {}
function Main()
--frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local tmp = 0
local handle = openfile("txt/ranges.dat","r")
line = read(handle)
while line do
tmp = tmp + 1
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
if ipr2 == nil then
SendToAll(Bot,"Error on line "..line)
end
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(ipr1, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(ipr2, "(%d*).(%d*).(%d*).(%d*)")
si1 = CheckNumber(ipa1)..CheckNumber(ipb1)..CheckNumber(ipc1)..CheckNumber(ipd1)
si2 = CheckNumber(ipa2)..CheckNumber(ipb2)..CheckNumber(ipc2)..CheckNumber(ipd2)
Ranges[si1] = si2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
checker = CheckNumber(range1)..CheckNumber(range2)..CheckNumber(range3)..CheckNumber(range4)
--SendToAll(Bot,"IP-Test..."..checker)
for i,p in Ranges do
local s,e,xstart = strfind(i, "(%d*)")
local s,e,xend = strfind(p, "(%d*)")
if checker > xstart and checker < xend then
collectgarbage()
flush()
return 1
else
end
end
end
function CheckNumber(number)
numbera = tonumber(number)
if numbera < 10 then
numbera = "00"..number
elseif numbera < 100 then
numbera = "0"..number
else
numbera = number
end
return numbera
end
function DataArrival(user,data)
if strsub(data, 1, 13) == "$ValidateNick" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:SendData(Bot, "D?vidas, informe ? [EMAIL]lusobrasil@netcabo.pt[/EMAIL] ? [URL]www.lusobrasil.site.vu[/URL] ?")
SendToOps(Bot, "? OP MSG ? Usu?rio: "..data..", com o IP: ["..user.sIP.."], foi desconectado do Hub por: "..Bot.." - Motivo: IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:TempBan()
user:Disconnect()
end
end
end
validatenick ;)
later,,
Hi Phatty, i still get this on SendToOps MSG
? OP MSG ? User: $ValidateNick [PT]user1
, with IP: [xxx.xxx.xxx.xxx], was disconnected from Hub by: [BOT]
And stay on Ptokax TempBan as
Hehe..
well if
function DataArrival(user,data)
if strsub(data, 1, 14) == "$ValidateNick " then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:SendData(Bot, "D?vidas, informe ? [EMAIL]lusobrasil@netcabo.pt[/EMAIL] ? [URL]www.lusobrasil.site.vu[/URL] ?")
SendToOps(Bot, "? OP MSG ? Usu?rio: "..data..", com o IP: ["..user.sIP.."], foi desconectado do Hub por: "..Bot.." - Motivo: IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:TempBan()
user:Disconnect()
end
end
end
dont work then try
function DataArrival(user,data)
if strsub(data, 1, 8) == "$Version" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:SendData(Bot, "D?vidas, informe ? [EMAIL]lusobrasil@netcabo.pt[/EMAIL] ? [URL]www.lusobrasil.site.vu[/URL] ?")
SendToOps(Bot, "? OP MSG ? Usu?rio: "..user.sName..", com o IP: ["..user.sIP.."], foi desconectado do Hub por: "..Bot.." - Motivo: IP - Range tempor?riamente banido no LusoBrasil Hub.")
user:TempBan()
user:Disconnect()
end
end
end
later
Oh Yeah !! running 100% now :)
--//RangeBlaster v2.07 by Phatty
--//IP Keys written by John, and Phatty
Bot = "RangeBlaster"
Ranges = {}
function Main()
--frmHub:RegBot(Bot)
LoadIps()
end
function LoadIps()
local tmp = 0
local handle = openfile("ranges.dat","r")
line = read(handle)
while line do
tmp = tmp + 1
local s,e,ipr1,ipr2 = strfind(line,"(%S+)|(%S+)")
if ipr2 == nil then
SendToAll(Bot,"Error on line "..line)
end
local s,e,ipa1,ipb1,ipc1,ipd1 = strfind(ipr1, "(%d*).(%d*).(%d*).(%d*)")
local s,e,ipa2,ipb2,ipc2,ipd2 = strfind(ipr2, "(%d*).(%d*).(%d*).(%d*)")
si1 = CheckNumber(ipa1)..CheckNumber(ipb1)..CheckNumber(ipc1)..CheckNumber(ipd1)
si2 = CheckNumber(ipa2)..CheckNumber(ipb2)..CheckNumber(ipc2)..CheckNumber(ipd2)
Ranges[si1] = si2
line = read(handle)
end
end
function Blocked(userip)
local s,e,range1,range2,range3,range4 = strfind(userip,"(%d+).(%d+).(%d+).(%d+)")
checker = CheckNumber(range1)..CheckNumber(range2)..CheckNumber(range3)..CheckNumber(range4)
--SendToAll(Bot,"IP-Test..."..checker)
for i,p in Ranges do
local s,e,xstart = strfind(i, "(%d*)")
local s,e,xend = strfind(p, "(%d*)")
if checker > xstart and checker < xend then
collectgarbage()
flush()
return 1
else
end
end
end
function CheckNumber(number)
numbera = tonumber(number)
if numbera < 10 then
numbera = "00"..number
elseif numbera < 100 then
numbera = "0"..number
else
numbera = number
end
return numbera
end
function DataArrival(user,data)
if strsub(data, 1, 8) == "$Version" then
if Blocked(user.sIP) == 1 then
user:SendData(Bot, "You have been banned")
SendToOps(Bot, "User: "..user.sName..", with IP: ["..user.sIP.."] was disconnected from Hub by "..bot..".")
user:TempBan()
user:Disconnect()
end
end
end