Hi ppl
I need this IpBot script converted too Lua 5.1 If is Possible.
Tankx
--=[ DvdRip.sytes.net ]=--
--=[ Script Ip-Bot Por Genius ]=--
--=[ Adaptado e actualizado para DvdRip em Junho 2006 ]=--
--=[ Nome do Bot ]=--
sBot = "![ PT??w?s ]"
OpChatName = "![ PT??w?s ]"
--=[ Exep??es / Deixar entrar um internacional atrav?z do nick ]=--
excepcoes = {
[" xxxx"] = 1,
[" xxxx"] = 2,
[" xxxx"] = 3,
}
--=[ Ranges permitidas no Hub ]=--
arrIP = {
["xxxxxxx"] = "xxxxxx", -- xxxxx
}
--=[ Codigo do script ]=-
function Main()
frmHub:RegBot(sBot)
end
--=[ Mensagem ao user n?o constante na Range ]=-
function NewUserConnected(user)
if (excepcoes[user.sName] == nil) and (isGoodIP(user.sIP) == nil) then
user:SendData(sBot, " --=[ Este Servidor apenas permite Ips Nacionais. Se ?s de Portugal contacta-nos: RicardoFVTavaresHotmail.com [EMAIL]ou abre pvt com [PT]?Genius??, a tua ajuda ? preciosa. ]=-- ")
user:SendData("$ForceMove PtDowns.sytes.net:8888")
user:Disconnect()
end
end
OpConnected = NewUserConnected
function isGoodIP(sIP)
sIP = ipToNumber(sIP)
local iFirst,iLast
for iFirst, iLast in arrIP do
if (sIP >= ipToNumber(iFirst) and sIP <= ipToNumber(iLast)) then
return 1
end
end
return nil
end
function ipToNumber(sIP)
iAux = ""
string.gsub(sIP,"(%d+)", function(w)
w = tonumber(w)
if (w < 10) then
iAux = iAux.."00"..w
elseif (w < 100) then
iAux = iAux.."0"..w
else
iAux = iAux..w
end
end)
return tonumber(iAux)
end
Try this
--=[ DvdRip.sytes.net ]=--
--=[ Script Ip-Bot Por Genius ]=--
--=[ Adaptado e actualizado para DvdRip em Junho 2006 ]=--
--=[ Nome do Bot ]=--
sBot = "![ PT??w?s ]"
OpChatName = "![ PT??w?s ]"
--=[ Exep??es / Deixar entrar um internacional atrav?z do nick ]=--
excepcoes = {
[" xxxx"] = 1,
[" xxxx"] = 2,
[" xxxx"] = 3,
}
--=[ Ranges permitidas no Hub ]=--
arrIP = {
["xxxxxxx"] = "xxxxxx", -- xxxxx
}
--=[ Codigo do script ]=-
function Main()
frmHub:RegBot(sBot)
end
--=[ Mensagem ao user n?o constante na Range ]=-
function NewUserConnected(user)
if (excepcoes[user.sName] == nil) and (isGoodIP(user.sIP) == nil) then
user:SendData(sBot, " --=[ Este Servidor apenas permite Ips Nacionais. Se ?s de Portugal contacta-nos: RicardoFVTavaresHotmail.com [EMAIL]ou abre pvt com [PT]?Genius??, a tua ajuda ? preciosa. ]=-- ")
user:SendData("$ForceMove PtDowns.sytes.net:8888")
user:Disconnect()
end
end
OpConnected = NewUserConnected
function isGoodIP(sIP)
sIP = ipToNumber(sIP)
local iFirst,iLast
for iFirst, iLast in pairs(arrIP) do
if (sIP >= ipToNumber(iFirst) and sIP <= ipToNumber(iLast)) then
return 1
end
end
return nil
end
function ipToNumber(sIP)
iAux = ""
string.gsub(sIP,"(%d+)", function(w)
w = tonumber(w)
if (w < 10) then
iAux = iAux.."00"..w
elseif (w < 100) then
iAux = iAux.."0"..w
else
iAux = iAux..w
end
end)
return tonumber(iAux)
end
tankx men
works fine