HI
I need help plz
plz convert this script for ptokax 0.3.5.2
--=[ Nome dos Bots ]=-
BotName = "??ec?rit?-??t?"
--=[ Comandos ]=-
Files = {
["!regras"] = "SD/regras.txt",
["!rules"] = "SD/regras.txt",
["!regras2"] = "SD/regras2.txt",
}
--=[ C?digo ]=-
function ChatArrival(user, data)
s,e,msg = string.find(data, "%b<> ([ -z]*)")
for key, value in Files do
if( string.find( string.lower(msg), key) ) then
txtToShow, x = string.gsub(value, "%b[]", user.sName)
SendToAll(BotName, teste)
Show(user, TheFile)
SendToAll(BotName, teste)
return 1
end
end
end
function Show(user, TheFile)
local file = io.input(txtToShow)
local line = io.read("*a")
msg = msg.."\r\n"..line.."\r\n"
user:SendPM(BotName, msg)
file:read()
file:close()
end
You don't need a conversion on this script. Just enable the textfile support.
HINT: Examine the GUI of PtokaX search around, you'll find it ;)
Hihihihihihihi
Tankx
--convert to LUA 5.1
--=[ Nome dos Bots ]=-
BotName = "??ec?rit?-??t?"
--=[ Comandos ]=-
Files = {
["!regras"] = "SD/regras.txt",
["!rules"] = "SD/regras.txt",
["!regras2"] = "SD/regras2.txt",
}
--=[ C?digo ]=-
function ChatArrival(user, data)
s,e,msg = string.find(data, "%b<> ([ -z]*)")
for key, value in pairs(Files) do
if( string.find( string.lower(msg), key) ) then
txtToShow, x = string.gsub(value, "%b[]", user.sName)
SendToAll(BotName, teste)
Show(user, TheFile)
SendToAll(BotName, teste)
return 1
end
end
end
function Show(user, TheFile)
local file = io.input(txtToShow)
local line = io.read("*a")
msg = msg.."\r\n"..line.."\r\n"
user:SendPM(BotName, msg)
file:read()
file:close()
end