RangeMaster by Phatty - Page 2
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

RangeMaster by Phatty

Started by pHaTTy, 31 January, 2004, 18:01:49

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

[NL]trucker

#25
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?
Owner of FunnyHub
 
Funyhub.no-ip.info
       Forum Master of


pHaTTy

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
Resistance is futile!

NightLitch

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
//NL

pHaTTy

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,,
Resistance is futile!

NightLitch

Nice going Phatty.
//NL

pHaTTy

QuoteOriginally posted by NightLitch
Nice going Phatty.

thanks,, i still have some more plans ahead if i get time :)
Resistance is futile!

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

pHaTTy

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 ;)
Resistance is futile!

acethecase

#33
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.

pHaTTy

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 ;)
Resistance is futile!

acethecase

hehe fast replay---
oki m8 Ill do so :)

pHaTTy

QuoteOriginally posted by acethecase
hehe fast replay---
oki m8 Ill do so :)

eheh did u get it sorted?
Resistance is futile!

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

pHaTTy

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 ;)
Resistance is futile!

nEgativE

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

pHaTTy

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,,
Resistance is futile!

nEgativE

#41
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..

pHaTTy

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
Resistance is futile!

nEgativE

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

SMF spam blocked by CleanTalk