PtokaX forum

Archive => Archived 5.1 boards => Conversion Requests => Topic started by: ?[-?Genius?-]? on 03 February, 2008, 18:47:22

Title: convert to ptokax 0.3.6.0i
Post by: ?[-?Genius?-]? on 03 February, 2008, 18:47:22
Hi its possible convert this scrpit for ptokax 0.3.6.0 i ? 



--=[ Nome do Bot ]=--
sBot = "[!???] ??vdRip?"

--=[ Nome do OpChat ]=--
OpChatName = "[!???] ?Op Cha??"

--=[ Exep??es / Deixar entrar um internacional atrav?z do nick ]=--
excepcoes = {
["[PT]Sniffer"] = 4,
}

--=[ Ranges permitidas no Hub ]=--

arrIP = {
   ["127.0.0.1"] = "127.0.0.1", -- ? Test
}



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/Hub apenas permite Ips que constem na nossa Base. Voce ir? ser redirecionado para um Servidor/Hub secund?rio para verifica??o de informa??o do seu provedor de Internet. Gratos pela Prefer?ncia.")
SendPmToOps(sBot, "?? Utilizador ["..user.sName.."] reenviado para SuperDvdRip.sytes.net devido a sua IpRange n?o constar na Base de Dados. ")
      user:SendData("$ForceMove SuperDvdRip.sytes.net")
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
Title: Re: convert to ptokax 0.3.6.0i
Post by: ?[-?Genius?-]? on 03 February, 2008, 19:05:37
Nice script. But i want my script. Its because have redirect and exceptions.

Sory my bad inglish
Tankx
Title: Re: convert to ptokax 0.3.6.0i
Post by: ?[-?Genius?-]? on 04 February, 2008, 04:54:31
Script dont work :(
Title: Re: convert to ptokax 0.3.6.0i
Post by: ?[-?Genius?-]? on 04 February, 2008, 13:40:52
I just teste 3rd script you posted and don?t work. but dont send errors.
Today i test scipt 2 and Its working :)

Is not possible change my script for new ptokax?