Help
 

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

Help

Started by Markitos, 24 April, 2005, 00:02:29

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Markitos

Can someone convert this script to lua 5?

--## Warn Bot 
--## Pedido por ?
--## Feito por nErBoS 

sBot = "!'U?????h??le'!?" 

--## Tabela com as palavras a ser avisadas ##-- 
arrWord = { 
   "a", "e", "i", "o", "u", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", 
} 

function Main() 
   frmHub:RegBot(katbot) 
end 

function DataArrival(user, data) 
   if (strsub(data,1,1) == "<" and not user.bOperator) then 
      data = strsub(data,1,strlen(data)-1) 
      for i=1, getn(arrWord) do 
         if (strfind(data, arrWord[i])) then 
            local s,e,talk = strfind(data, "%b<>%s+(.+)") 
            SendPmToOps(sBot, "<"..user.sName.."> ("..user.sIP..") disse no Main: "..talk) 
            return 0 
         end 
      end 
   end 
   if (strsub(data,1,5) == "$To: " and not user.bOperator) then 
      data = strsub(data,1,strlen(data)-1) 
      for i=1, getn(arrWord) do 
         if (strfind(data, arrWord[i])) then 
            local s,e,to = strfind(data, "$To:%s+(%S+)") 
            local s,e,talk = strfind(data, "%b<>%s+(.+)") 
            SendPmToOps(sBot, "<"..user.sName.."> ("..user.sIP..") disse em PVT ao utilizador "..to.." o seguinte: "..talk) 
            return 0 
         end 
      end 
   end 
end

Dessamator

--## Warn Bot 
--## Pedido por ?
--## Feito por nErBoS 

sBot = "!'U?????h??le'!?" 

--## Tabela com as palavras a ser avisadas ##-- 
arrWord = { 
   "a", "e", "i", "o", "u", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", 
} 

function Main() 
   frmHub:RegBot(katbot) 
end 

function ChatArrival(user, data) 
   if not(user.bOperator) then 
      data = string.sub(data,1,-2) 
      for i=1, table.getn(arrWord) do 
         if (string.find(data, arrWord[i])) then 
            local s,e,talk = string.find(data, "%b<>%s+(.+)") 
            SendPmToOps(sBot, "<"..user.sName.."> ("..user.sIP..") disse no Main: "..talk) 
            return 0 
         end 
      end 
   end 
end

function ToArrival(user, data) 
 if not (user.bOperator) then 
      data = string.sub(data,1,-2) 
      for i=1, table.getn(arrWord) do 
         if (string.find(data, arrWord[i])) then 
            local s,e,to = string.find(data, "$To:%s+(%S+)") 
            local s,e,talk = string.find(data, "%b<>%s+(.+)") 
            SendPmToOps(sBot, "<"..user.sName.."> ("..user.sIP..") disse em PVT ao utilizador "..to.." o seguinte: "..talk) 
            return 0 
         end 
      end 
   end 
end

done !!,

quick conversion untested, :D
Ignorance is Bliss.

Markitos

It worked great thnks!!!

Dessamator

QuoteOriginally posted by Markitos
It worked great thnks!!!

yw , :)
Ignorance is Bliss.

SMF spam blocked by CleanTalk