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
--## 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
It worked great thnks!!!
QuoteOriginally posted by Markitos
It worked great thnks!!!
yw , :)