BanIP
 

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

BanIP

Started by Themaster, 09 December, 2004, 17:30:17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Themaster

Hello PPL

i need a banip To my script...plz help me
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

bastya_elvtars

QuoteOriginally posted by Themaster
Hello PPL

i need a banip To my script...plz help me

isn't ptokax inbuilt BanIP enough?
Everything could have been anything else and it would have just as much meaning.

Themaster

yes but i can't get it to work
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

enema

then get a new version of ptokaX!!!  ... because, if banip doesnt work, then there is no telling if any banIp script would work

Themaster

i just wan't it to work..
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

enema

Maybe you can use IP range blaster instead?

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

Themaster

#6
Nope it do not work...And i just wan't to ban IP...

Syntax error: bad argument #1 to `read' (string expected, got nil)
stack traceback:
   1:  function `read' [C]
   2:  function `LoadIps' at line 186 [file `...ettings\scripts\Blade1.1.lua']
   3:  function `Main' at line 47 [file `...ettings\scripts\Blade1.1.lua']
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Themaster

Hmm..what can i do to get my banip to work...
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

Herodes

I think you need a file named "ranges.dat" in your scripts folder ...

the ip ranges in there should be in the following form

xxx.xxx.xxx.0|xxx.xxx.xxx.xxx

for single ips I suppose you'll need to do this :

xxx.xxx.xxx.yyy|xxx.xxx.xxx.yyy

Themaster

i have try it did not work
peace out...and love to your all scripter..that do the hard work  :D And all thx to your all there are here 2 help!!! :]

blade.lir.dk

enema

there has been a thread like this before

Have a look here

My solution - get a new version of PtokaX

bastya_elvtars

Themaster

check my range fucker maybe you can find ideas... http://www.plop.nl/ptokaxbots/bastya_elvtars/rangefucker.lua
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk