PtokaX forum

Archive => Archived 5.1 boards => Request for scripts => Topic started by: dodgeviper on 16 August, 2007, 15:39:41

Title: Selected IP only
Post by: dodgeviper on 16 August, 2007, 15:39:41
Can anyone please make a script that enables me to restrict a hub for a selected set of ip's like 10.100.97.*   
i have a lan connected we have ip range from 10.100.89.* till 10.100.99.*..
i want to make a hub only for 10.100.97.* users....
also for selecting which ip to allow...the script must ask me the range...and it should accept '*' format..instead of allowing all the ips

i shall be grateful to u...
also even if the master is of different range of ip then he can bypass the ip check and enter the hub...it will be better if it comes in right click command feature for the master only...
Title: Re: Selected IP only
Post by: Cêñoßy†ê on 16 August, 2007, 16:33:35
Something to start with ;)



--[[
Allow 1 range by C??o?y?? 16/08/2007
]]--

Bypass = { -- allow profile to enter from other range 1/yes  0/no
[0] = 1,
[1] = 0,
[2] = 0,
[3] = 0,
[-1] = 0,
}

OpConnected = function(user)
if Bypass[user.iProfile] == 0 then
if not user.sIP:find("10%.100%.97%.") then
user:SendData(frmHub:GetHubBotName(),"Sorry but this is private hub !")
user:Disconnect()
end
end
end

NewUserConnected = OpConnected
Title: Re: Selected IP only
Post by: dodgeviper on 16 August, 2007, 17:38:51
thanks a lot man....u r god...
Title: Re: Selected IP only
Post by: burningstar on 15 October, 2007, 23:46:56
What do i have to change, if i want more than one ip range in my hub. For example 10.10.1.* 10.10.2.* and 10.10.3.*  but no other ips?
Title: Re: Selected IP only
Post by: burningstar on 16 October, 2007, 11:06:40
Thank you for the quick response.
But...
If i try to run this script on my hub it says: [02:04] Syntax ....1_2487_R2R\DiXBoT_v1.1_2487_R2R\scripts\IPRange.lua:13: attempt to index global 'SetMan' (a nil value)
Title: Re: Selected IP only
Post by: burningstar on 16 October, 2007, 20:39:06
Thanks a lot, now its working.
I?m not sure which version i got.. i?m using the latest dixbot r2r version with ptokax and i?m still trying to understand what all this LUA and API stuff means.