Hello PPL
i need a banip To my script...plz help me
QuoteOriginally posted by Themaster
Hello PPL
i need a banip To my script...plz help me
isn't ptokax inbuilt BanIP enough?
yes but i can't get it to work
then get a new version of ptokaX!!! ... because, if banip doesnt work, then there is no telling if any banIp script would work
i just wan't it to work..
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
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']
Hmm..what can i do to get my banip to work...
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
i have try it did not work
there has been a thread like this before
Have a look here (http://board.univ-angers.fr/thread.php?threadid=1891&boardid=11&sid=ea1e7e11d0e0bdff58c5f6de28e5a23c)
My solution - get a new version of PtokaX
Themaster
check my range fucker maybe you can find ideas... http://www.plop.nl/ptokaxbots/bastya_elvtars/rangefucker.lua