could anyone convert this script, to lua 5 plz:
--Made By: nerbos
sBot ="?M?X-H???R??"
sAddy ="lolol" -- Colocar aqui o endere?o para redirecionar os estranjas
ipallowed = {
"192.168.1.0-192.168.1.255",
"127.0.0.0-127.0.0.1",
"195.245.234.0-195.245.234.255", --BPN
"193.221.96.0-193.221.111.255", --ITM-PORTUGAL
"195.138.0.0-195.138.31.255", --SIBS
"194.145.121.0-194.145.121.255", --ESDI
"81.84.0.0-81.84.255.255", --TVCABO
"83.132.0.0-83.132.255.255", --TVCABO
"85.138.0.0-85.139.255.255", --TVCABO
"212.113.160.0-212.113.191.255", --TVCABO
"213.22.0.0-213.22.255.255", --TVCABO
"193.53.22.0-193.53.22.255", --SERVIBANCA
"193.194.155.0-193.194.155.255", --SHOPPING DIRECT
"213.129.128.0-213.129.159.255", --netway
"193.236.127.0-193.236.127.255", --Sistema de Mail para Todos do MCT
"146.193.0.0-146.193.31.255", --INESC
"146.193.32.0-146.193.63.255", --INESC
"146.193.64.0-146.193.127.255", --INESC
"146.193.128.0-146.193.255.255", --INESC
"192.12.232.0-192.12.232.255", --INESC
"192.35.246.0-192.35.246.255", --INESC
"192.135.129.0-192.135.129.255", --INESC
"192.136.49.0-192.136.49.255", --INESC
"194.117.24.0-194.117.31.255", --INESC
"194.117.32.0-194.117.35.255", --INESC
"213.63.0.0-213.63.127.255", --Jazztel Portugal
"213.63.128.0-213.63.255.255", --Jazztel Portugal
"213.141.0.0-213.141.31.255", --Jazztel Portugal
"194.153.132.0-194.153.132.255", --BPI, SA
"195.85.221.0-195.85.221.255", --BPI, SA
"83.223.160.0-83.223.191.255", --CABOTVM.PT
"213.190.192.0-213.190.223.255", --CABOTVM.PT
"213.138.224.0-213.138.255.255", --CABOTVM.PT
"62.229.64.0-62.229.95.255", --GLOBAL-ONE-PORTUGAL
"194.235.128.0-194.235.135.255", --GLOBAL-ONE-PORTUGAL
"194.235.136.0-194.235.139.255", --GLOBAL-ONE-PORTUGAL
"195.61.64.0-195.61.95.255", --GLOBAL-ONE-PORTUGAL
"193.41.114.0-193.41.115.255", --YASP
"212.48.64.0-212.48.95.255", --HLC
"212.54.128.0-212.54.159.255", --ITNET-Network
"212.54.144.0-212.54.159.255", --ITNET-Network
"194.145.59.0-194.145.59.255", --Siemens
"194.145.60.0-194.145.60.255", --Siemens
"194.145.61.0-194.145.61.255", --Siemens
"194.145.62.0-194.145.62.255", --Siemens
"192.67.76.0-192.67.76.255", --Centro de Calculo da Faculdade de Ciencias de Lisboa
"192.104.37.0-192.104.37.255", --Edinet
"195.95.236.0-195.95.237.255", --Edinet
"195.245.128.0-195.245.191.255", --Edinet
"213.58.0.0-213.58.255.255", --Edinet
"217.70.64.0-217.70.71.255", --Edinet
"217.70.72.0-217.70.79.255", --Edinet
"80.172.0.0-80.172.255.255", --VIA NET.WORKS Portugal
"194.8.30.0-194.8.30.255", --VIA NET.WORKS Portugal
"194.130.254.0-194.130.255.255", --VIA NET.WORKS Portugal
"195.22.0.0-195.22.31.255", --VIA NET.WORKS Portugal
"62.48.128.0-62.48.255.255", --PT Prime
"83.240.128.0-83.240.255.255", --PT Prime
"158.162.120.0-158.162.127.255", --PT Prime
"193.176.0.0-193.176.0.255", --PT Prime
"195.35.66.0-195.35.66.255", --PT Prime
"139.83.0.0-139.83.255.255", --RCCN-NET
"158.162.0.0-158.162.63.255", --RCCN-NET
"158.162.64.0-158.162.95.255", --RCCN-NET
"158.162.96.0-158.162.111.255", --RCCN-NET
"158.162.112.0-158.162.119.255", --RCCN-NET
"158.162.128.0-158.162.191.255", --RCCN-NET
"158.162.192.0-158.162.255.255", --RCCN-NET
"192.88.99.0-192.88.99.255", --RCCN-NET
"193.136.0.0-193.137.255.255", --RCCN-NET
"194.117.0.0-194.117.15.255", --RCCN-NET
"194.117.16.0-194.117.23.255", --RCCN-NET
"194.117.40.0-194.117.43.255", --RCCN-NET
"194.210.0.0-194.210.255.255", --RCCN-NET
"82.140.192.0-82.140.207.255", --KPNQwest
"193.126.0.0-193.126.255.255", --KPNQwest
"193.192.1.0-193.192.1.255", --KPNQwest
"193.192.2.0-193.192.2.255", --KPNQwest
"193.192.3.0-193.192.3.255", --KPNQwest
"81.193.0.0-81.193.255.255", --Telepac
"82.154.0.0-82.155.255.255", --Telepac
"85.240.0.0-85.247.255.255", --Telepac
"192.92.150.0-192.92.150.255", --Telepac
"194.65.0.0-194.65.255.255", --Telepac
"212.55.128.0-212.55.191.255", --Telepac
"213.13.0.0-213.13.255.255", --Telepac
"192.188.10.0-192.188.10.255", --Novis
"192.199.16.0-192.199.31.255", --Novis
"193.236.120.0-193.236.120.255", --Novis
"193.236.121.0-193.236.121.255", --Novis
"193.236.122.0-193.236.122.255", --Novis
"193.236.123.0-193.236.123.255", --Novis
"194.79.64.0-194.79.95.255", --Novis
"194.117.36.0-194.117.39.255", --Novis
"195.23.0.0-195.23.255.255", --Novis
"195.225.220.0-195.225.223.255", --Novis
"212.0.160.0-212.0.167.255", --Novis
"213.205.64.0-213.205.95.255", --Novis
"194.38.128.0-194.38.159.255", --COMNEXO, SA
"213.146.192.0-213.146.223.255", --COMNEXO, SA
"193.219.96.0-193.219.103.255", --IP Global
"81.20.240.0-81.20.255.255", --CPRM
"195.8.0.0-195.8.31.255", --CPRM
"217.168.112.0-217.168.127.255", --CPRM
"83.174.0.0-83.174.63.255", --Vodafone
"212.18.160.0-212.18.191.255", --Vodafone
"213.30.0.0-213.30.127.255", --Vodafone
"212.16.128.0-212.16.159.255", --Teleweb
"212.251.128.0-212.251.255.255", --Teleweb
"212.13.32.0-212.13.63.255", --NorteNet
"84.90.0.0-84.91.255.255", --Cabovisao,SA
"213.228.128.0-213.228.191.255", --Cabovisao,SA
"217.129.0.0-217.129.255.255", --Cabovisao,SA
"212.113.128.0-212.113.159.255", --MaxitelCom, SA
"80.90.192.0-80.90.223.255", --Oni Way
"195.245.197.0-195.245.197.255", --Inst Informatica e Estat da Solidariedade
"217.23.0.0-217.23.15.255", --Cofina.com
"80.79.0.0-80.79.15.255", --Guiao, S.A.
"193.111.42.0-193.111.42.255", --Finibanco, SA
"193.192.4.0-193.192.7.255", --INE
"193.192.8.0-193.192.11.255", --INE
"81.92.192.0-81.92.223.255", --NFSi-Solucoes Internet Lda.
"82.102.0.0-82.102.63.255", --NFSi-Solucoes Internet Lda.
"195.234.134.0-195.234.134.255", --CAIXANET
"62.169.64.0-62.169.95.255", --Optimus
"192.35.96.0-192.35.96.63", --BanifServ
"195.35.96.0-195.35.96.255", --BanifServ
"195.60.162.0-195.60.163.255", --Instituto Superior de Linguas e Administra??o
"217.70.72.0-217.70.79.255", --Bragatel
"80.251.161.128-80.251.161.143", --PHC
"217.112.192.0-217.112.195.255", --WTS
"217.112.196.0-217.112.196.255", --WTS
"62.249.8.176-62.249.8.191", --DATABOX-PT
"80.251.160.0-80.251.175.255", --COLT
"80.91.80.0-80.91.83.255", --LNCES
"83.144.128.0-83.144.191.255", --Pluricanal, SA
"193.17.0.0-193.17.0.255", --Imprensa Nacional
}
function NewUserConnected(user, data)
if (IspChecker(user.sIP) == 0) then
user:SendData(sBot,"O Teu IP n?o ? permitido neste Hub.")
user:SendData("$ForceMove"..sAddy.."|")
end
end
OpConnected = NewUserConnected
function IspChecker(IP)
local accept = 0
local s,e,ip1,ip2,ip3,ip4 = strfind(IP,"(%d+)%.(%d+)%.(%d+)%.(%d+)")
local userIP = Addzero(ip1)..Addzero(ip2)..Addzero(ip3)..Addzero(ip4)
userIP = tonumber(userIP)
for i=1, getn(ipallowed) do
local s,e,a1,a2,a3,a4,b1,b2,b3,b4 = strfind(ipallowed,"(%d+)%.(%d+)%.(%d+)%.(%d+)-(%d+)%.(%d+)%.(%d+)%.(%d+)")
local aIP = Addzero(a1)..Addzero(a2)..Addzero(a3)..Addzero(a4)
aIP = tonumber(aIP)
local bIP = Addzero(b1)..Addzero(b2)..Addzero(b3)..Addzero(b4)
bIP = tonumber(bIP)
if (userIP >= aIP and userIP <= bIP) then
accept = 1
break
end
end
return accept
end
function Addzero(number)
iAux = tonumber(number)
if (iAux < 10) then
number ="00"..number
elseif (iAux < 100) then
number ="0"..number
else
number = number
end
return number
end
tks!!!
respectfully,
Re@SoN
Try search the forum for "IP Bot".
Best regards,
jiten
i search and found one, but my dought is how do i put correctly the ip ranges... the ranges i have are in this way:
"192.168.1.0-192.168.1.255",
"127.0.0.0-127.0.0.1",
"195.245.234.0-195.245.234.255", --BPN
"193.221.96.0-193.221.111.255", --ITM-PORTUGAL
and in script are in this way:
["192.168.0.1"] = "192.168.255.255", -- A RANGE
["127.0.0.1"] = "127.0.0.1", -- AN IP
so, if i understand well, i should put the ranges like this?
["192.168.1.0"] = "192.168.1.255", -- A RANGE
["127.0.0.0"] = "127.0.0.1",
["195.245.234.0"] = "195.245.234.255",
and so on, correct?
respectfully,
Re@SoN
QuoteOriginally posted by Re@SoN
i search and found one, but my dought is how do i put correctly the ip ranges... the ranges i have are in this way:
"192.168.1.0-192.168.1.255",
"127.0.0.0-127.0.0.1",
"195.245.234.0-195.245.234.255", --BPN
"193.221.96.0-193.221.111.255", --ITM-PORTUGAL
and in script are in this way:
["192.168.0.1"] = "192.168.255.255", -- A RANGE
["127.0.0.1"] = "127.0.0.1", -- AN IP
so, if i understand well, i should put the ranges like this?
["192.168.1.0"] = "192.168.1.255", -- A RANGE
["127.0.0.0"] = "127.0.0.1",
["195.245.234.0"] = "195.245.234.255",
and so on, correct?
respectfully,
Re@SoN
Indeed ;)
tks very much jiten for the help! ! !
now i learned how to do it :)
respectfully,
Re@SoN