how i make this working.i dont want disconnect users i want redirect them if ip is not right
function NewUserConnected(curUser)
theIP=curUser.sIP
local a,b,c,d=splittip(theIP)
if ((oAllow[a]==1)or(oAllow==1)or(oAllow[c]==1)or(oAllow[d]==1)) then
else
curUser:SendPM(Bot,"Your IP/ISP isnt allowed here if you have a fast connection go to http:// ....")
curUser:Disconnect()
end
end
any help ?
Hi,
Use this...
addredirect = "1.1.1.1.1"
function NewUserConnected(curUser)
theIP=curUser.sIP
local a,b,c,d=splittip(theIP)
if ((oAllow[a]==1)or(oAllow[b]==1)or(oAllow[c]==1)or(oAllow[d]==1)) then
else
curUser:SendPM(Bot,"Your IP/ISP isnt allowed here if you have a fast connection go to [URL]http://[/URL] ....")
curUser:SendData("$ForceMove "..addredirect)
curUser:SendPM(Bot, "You are been redirected...")
end
end
Best regrads, nErBoS
Syntax Error: attempt to concat global `addredirect' (a nil value)
not working
-- Ipbot lua script by aMutex --
Bot = "IPBot"
oAllow={}
function splittip(IP)
r,g,a,b,c,d = strfind(IP, "(%d*).(%d*).(%d*).(%d*)")
d=a.."."..b.."."..c.."."..d
c=a.."."..b.."."..c..".*"
b=a.."."..b..".*"
a=a..".*"
return a,b,c,d
end
function Main()
frmHub:RegBot(Bot)
oAllow["130.234.*"]=1
oAllow["130.233.*"]=1
end
function NewUserConnected(curUser)
theIP=curUser.sIP
local a,b,c,d=splittip(theIP)
if ((oAllow[a]==1)or(oAllow==1)or(oAllow[c]==1)or(oAllow[d]==1)) then
else
curUser:SendPM(Bot,"Your IP/ISP isnt allowed here if you have a fast connection go to //http:// ....")
curUser:SendData("$ForceMove "..addredirect)
curUser:SendPM(Bot, "You are been redirected...")
end
end
sorry nErBoS and big THANKS to you this is working :))