Hi,
does exist Bot, that send to user in PM message which is more longer than 20 lines? I have text also in txt file. PtokaX/scripts/txt/rules.txt.
Can anyone help me?
Sending MOTD in PM? :-)
No, I mean, I hve some actuality and I want send it in PM. I send MOTD in main chat but simetimes i will need send some notice to every connected user.
I'll hack one together for you later, if noone else does.
Hi JaPaja,
have you checked out cron?
http://forum.ptokax.org/index.php?topic=6441#msg63238 (http://forum.ptokax.org/index.php?topic=6441#msg63238)
I mean something like this:
Bot = "[BOT]Keli?ov?"
function NewUserConnected(user)
SendPM(???????????????????)
end
But i dont know how should i write that i want send textfile "pravidla.txt" that are stored in PtokaX/scripts/txt/pravidla.txt . Bot is storet in PtokaX/scripts/
D U understand me?
Quote from: JaPaja on 27 November, 2006, 20:56:05
I mean something like this:
Bot = "[BOT]Keli?ov?"
function NewUserConnected(user)
SendPM(???????????????????)
end
But i dont know how should i write that i want send textfile "pravidla.txt" that are stored in PtokaX/scripts/txt/pravidla.txt . Bot is storet in PtokaX/scripts/
D U understand me?
I think I understand... is this what you are asking for?
Bot = "[BOT]Keli?ov?"
function NewUserConnected(user)
local xStr = ""
local hxFile,sErr = io.open("txt/pravidla.txt","r")
if hxFile then
xStr = hxFile:read("*a")
hxFile:close(xFile)
io.flush()
else
xStr = sErr
end
SendPM(Bot,xStr)
end
Maybe check this (http://forum.ptokax.org/index.php?topic=6313.0) too.
stone-db, why not:
Bot = "[BOT]Kelišov?"
function NewUserConnected(user)
local xStr = ""
local hxFile,sErr = io.open("txt/pravidla.txt","r")
if hxFile then
xStr = string.gsub(hxFile:read("*a"),string.char(10), "\r\n")
hxFile:close(xFile)
io.flush()
else
SendToOpChat("Error in onjoin-file-show script: "..sErr)
end
user:SendPM(Bot,xStr)
end
Quote from: Hungarista on 27 November, 2006, 22:35:10
Maybe check this (http://forum.ptokax.org/index.php?topic=6313.0) too.
stone-db, why not:
[ snip ]
Even better ;D