Hello,
Could someone make a script that searches *ALL* connected users founded in a specified IPrange?
Example: !checkiprange 213.140.0.1-213.140.255.255 it will shows all connected users in that IPrange.
Thank you
This can be heavy in big hubs.
--////////////////////////////////////////////
--// IP-RANGE SEARCHER
--// Requested by: -SkA-
--// Programmed by: NightLitch (2007)
--////////////////////////////////////////////
sCommand = "!iprangesearch"
--////////////////////////////////////////////
ChatArrival = function(user,data)
data = string.sub(data,1,string.len(data)-1)
local ok,_,cmd,arg = string.find(data, "%b<>%s(%S+)%s*(.*)")
if ok then
if cmd == sCommand and user.bOperator then
local _,_,r1,r2 = string.find(arg, "(%d+%.%d+%.%d+%.%d+)%-(%d+%.%d+%.%d+%.%d+)")
if r1 and r2 then
local users = GetUsersInsideRange(ComputeIP(r1),ComputeIP(r2))
local s = "*** Users inside "..r1.." - "..r2..": "
s = s .. "\r\n"
for i,nick in ipairs(users) do
if i < 10 then
s = s .. "\r\n\t "..i..". "..nick
else
s = s .. "\r\n\t "..i..". "..nick
end
end
s = s .. "\r\n"
user:SendData(frmHub:GetHubBotName(), s)
else
user:SendData(frmHub:GetHubBotName(), "*** Invalid IP Range")
end
return 1
end
end
end
ComputeIP = function(ip)
local _,_,a,b,c,d = string.find(ip, "(%d+).(%d+).(%d+).(%d+)")
return a*16777216 + b*65536 + c*256 + d
end
GetUsersInsideRange = function(from,to)
local tmp = {}
for _,user in pairs(frmHub:GetOnlineUsers()) do
local cip = ComputeIP(user.sIP)
if cip >= from and cip <= to then
table.insert(tmp, user.sName)
end
end
return tmp
end
NightLitch go go LoL
Thank you NL but it doesn't works ;D
[20:47:47] <??k®??> !iprangesearch 213.140.0.1-213.140.255.255
and no script errors
EDIT: now it works great, thank you very much :)