Problem in the script
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Problem in the script

Started by ?[-?Genius?-]?, 12 September, 2005, 22:01:45

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

?[-?Genius?-]?

Hi ppl

I have one big problema in this script


 --## Iniciu do Script LUA 5 ##--
--## Script adaptado DvdRip.sytes.net por [NT]Genius ##--

sBot = "--=(?DvdRip?)=--"

sOpChatName = "--=(?Opchat?)=--"


--## Configura??o ##--

-- Put in this table the Prefixes you want the users to have
 
sPrefix = { "[CV]" ,}

-- Insere nesta tabe?a as rangs dos Users que t?m que uzar o prefixo

arrIP = {
   ["10.6.0.0"] = "10.6.0.30",
   ["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
}
--## Fim da Configura??o ##--

function Main()
   frmHub:RegBot(sBot)
end

function NewUserConnected(user)
   if (CheckUserPrefix(user) == nil) and not (isGoodIP(user.sIP) == nil) then
      user:SendPM(sBot, "\r\n\r\n        ---={}=-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- --={}=---\r\n\r\n                       DvdRip.sytes.net:411\r\n\r\n                       Boas caro utilizador.\r\n                       Vimos por este meio informar que foram postam novas regras em vigor no Hub.\r\n                       Ter?s que acrescentar o prefixo [CV] no teu nickname para puderes efectuar downloads no Hub.\r\n\r\n                          Ex: [CV]user\r\n\r\n                       Estar?s a perguntar a ti mesmo porque temos tal regras no hub. Mas eu explico.\r\n                       Todos sabemos que temos uns fornecedores de Internet [ ISP?s ] muito fatelas, \r\n                      pagamos servi?os que n?o uzamos entre outras injusti?as.\r\n                       No caso do Fornecedor SAPO Adsl ? bastante grave porque todos os downloads que eles fazem\r\n                      dos utilizadores CaboVis?o ou Telepac contam como internacional.\r\n                       Dai existir tal regra. Se todos os Utilizadores usarem uma TAG a mencionar o Fornecedor \r\n                      de Internet [ ISP ] que utiliza, os users podem gerir os seus downloads e tb ter certezas\r\n                      da fonte dos mesmos.\r\n\r\n                       Esta regra ? para ser aplicada. Aviza-mos que quem n?o a cumprir ser? Banido do Hub.\r\n\r\n                       Colaborem n?o custa nada.\r\n\r\n                       DvdRip.sytes.net  -? N?o somos melhores nem piores. Apenas difer?ntes ?-\r\n\r\n                       ---={}=--  Bons Downloads  --={}=---\r\n\r\n        ---={}=-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- --={}=---\r\n")
      SendPmToOps(sOpChatName, "   --=( O utilizador "..user.sName.." foi requisitado para usar o prefixo [CV] )=--")
   end
end

OpConnected = NewUserConnected

function ConnectToMeArrival(user,data)
   if (CheckUserPrefix(user) == nil) and not (isGoodIP(user.sIP) == nil) then
      user:SendData(sBot, "\r\n\r\n        ---={}=-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- --={}=---\r\n\r\n                       DvdRip.sytes.net:411\r\n\r\n                       Boas caro utilizador.\r\n                       Vimos por este meio informar que foram postam novas regras em vigor no Hub.\r\n                       Ter?s que acrescentar o prefixo [CV] no teu nickname para puderes efectuar downloads no Hub.\r\n\r\n                          Ex: [CV]user\r\n\r\n                       Enquanto n?o o fizeres, ficas impossibilitado de efectuar downloads no Hub.\r\n\r\n        ---={}=-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- --={}=---.")
      return 1
   end
end

RevConnectToMeArrival = ConnectToMeArrival

function CheckUserPrefix(user)
   for key,pre in sPrefix do
      if string.find(string.lower(user.sName), string.lower(pre),1,1) then
         return 1
      end
   end
end

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

--## Fim do Script LUA 5 ##--

Users no receive message and downloads are not blok :S

Please change the script for me

Sory about my bad inglish

SMF spam blocked by CleanTalk