right, as ull probably notice i CANT write lua very well.
What im after is summin that will paste the following message into main chat every 20minutes, without someone typin !banner or whatever the command was
-------------------------(?`?._.?[URBAN FM]?._.???)-------------------------
????`????LoCk On To ThE OfFiCiAL URBAN FM RaDiO????`????
.???`?-> http://www.urbantingz.com/listen.rm <-???`?.ReAl AmP
.???`?-> http://www.urbantingz.com/listen.m3u <-???`?.WiN AmP
.???`?-> http://www.urbantingz.com/listen.asx <-???`?.WiN MeDiA
www.uRBANTINGz.com/forum <-- Make sure ur regged. PASS THIS ON
????`????LoCk On To ThE OfFiCiAL URBAN FM RaDiO????`????
Cheers
Sammy P
there's a script called timedmess that can do that for you (at least close to)
So far I havent managed to alter it enough to get it so not show timestamps... originaly it sent bot name on everi line as well, but that was a fairly easy edit.... if you search on the board I'm sure you can find it, if not send me a pm or some and I'll send it over to you (havent got a place to host it so cant get you a dl link)
already solved, he only opened the topic twice ;)
btw timestamps are clientside - users have to disable it manuallly.
if you for instance look at robocops hub add, there arent timestamps for each row.... neither is it if I send a banner through !banner command..
and also if I type a message in main thats more then 1 row i dont get a timestamp on each row... this message I have in timedmess shows timestamp for everyrow in the actual message.. it would be nice if the timestamp only was shown at the first row as it is when typing in the message...
my script does that...
:) ok
where can I get a hold of your script then?
When adding the message to the timer script, rather than....
SendToAll (bot, "message line 1")
SendToAll (bot, "message line 2")
SendToAll (bot, "message line 3")
try
mess = ""
mess = mess.."\r\n\t\n"
mess = mess.."message line 1"
mess = mess.."message line 2"
mess = mess.."message line 3"
SendToAll (bot,..mess)
can use \r\n to add a new line too :o)
the script I have uses a separate file for the actual message... So I guess it would require a bit more of a change to get it working without showing timestamp for each line
QuoteOriginally posted by Anna
the script I have uses a separate file for the actual message... So I guess it would require a bit more of a change to get it working without showing timestamp for each line
post it here. i will see what i can do.
OK here it comes, the txt file is just plain text as it is now and the script kind of ignore blank lines as well
CODE
-------------------------------------------------------------------
botname = "?????_ThaSwing_?????"
minutes = 60
file = "MsgAll.txt"
function Main()
SetTimer(minutes*60000)
StartTimer()
end
function OnTimer()
MessageToAll()
end
function MessageToAll()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
SendToAll(botname,line)
line = read(handle)
while line do
SendToAll(line)
line = read(handle)
end
closefile(handle)
end
end
-----------------------------------------------------
END
hope ya can do some :D
sure...
-- by dunno who
-- remade by bastya_elvtars
botname = "??^(o)??_ThaSwing_??^(o)??"
minutes = 60
file = "MsgAll.txt"
function Main()
SetTimer(minutes*60000)
StartTimer()
end
function OnTimer()
MessageToAll()
end
function MessageToAll()
local msg=""
readfrom(file)
while 1 do
local line=read()
if not line then
readfrom()
break
end
msg=msg.."\r\n"..line
end
readfrom()
SendToAll(botname,msg)
end
thanx for the help, but somewhere something dont work right, I got this when the message should be sent
Syntax error: bad argument #1 to `readfrom' (string expected, got nil)
stack traceback:
1: function `readfrom' [C]
2: function `MessageToAll' at line 19 [file `...:\Program\hubbar\PlayWerx\scripts\timedmess.lua']
3: function `OnTimer' at line 14 [file `...:\Program\hubbar\PlayWerx\scripts\timedmess.lua']
sry. edited above.
:D works fine now, except it dont tell who sends it... but thats not importent really
check now.
btw gnite :)
:) just perfect
night and thanx for the help
ok, i am putting an old thread up to live again.. did a search, but didnt find this script working in lua5... maybe I just missed it..
in any case if it already exists please point me in the right direction, if not please help me update it, found a use for it once again
-- by dunno who
-- remade by bastya_elvtars
-- lua5 version by bastya_elvtars
botname = "??^(o)??_ThaSwing_??^(o)??"
minutes = 60
file = "MsgAll.txt"
function Main()
SetTimer(minutes*60000)
StartTimer()
end
function OnTimer()
MessageToAll()
end
function MessageToAll()
local msg=""
local f=io.open(file)
if f then
for line in f:lines() do
msg=msg.."\r\n"..line
end
f:close()
end
SendToAll(botname,msg)
end
thanx :D preciate it