PtokaX forum

Archive => Archived 5.1 boards => Help with scripts => Topic started by: zung on 11 July, 2006, 06:16:04

Title: txt file timer translation to 5.1.x
Post by: zung on 11 July, 2006, 06:16:04
Ok...

I only use 2 scripts at my hub .. with antiadvertising 6Marilyn6Manson6 and UwV
saved me : )

I'm sorry to ask again but with the translation of this one i promise to not bother again : )))
before script
file = "txt/textfile.txt" 
used to be inside scripts folder and i dont know it it's only a case
on how new ptokax handle paths.. sorry for my stupidity
here it is :
bot = "texttimer"
mins = 1
file = "txt/textfile.txt"

function Main()
SetTimer(mins*60000)
StartTimer()
end

function OnTimer()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
SendToAll(bot,line)
line = read(handle)
end
closefile(handle)
end
end
Title: Re: txt file timer translation to 5.1.x
Post by: Markitos on 11 July, 2006, 07:27:55
Quote from: zung on 11 July, 2006, 06:16:04
Ok...

I only use 2 scripts at my hub .. with antiadvertising 6Marilyn6Manson6 and UwV
saved me : )

I'm sorry to ask again but with the translation of this one i promise to not bother again : )))
before script
file = "txt/textfile.txt" 
used to be inside scripts folder and i dont know it it's only a case
on how new ptokax handle paths.. sorry for my stupidity
here it is :

bot = "texttimer"
mins = 1
file = "txt/textfile.txt"

function Main()
SetTimer(mins*60000)
StartTimer()
end

function OnTimer()
local handle = openfile(file, "r")
if (handle ~= nil) then
local line = read(handle)
while line do
SendToAll(bot,line)
line = read(handle)
end
closefile(handle)
end
end



Search for it...there are many
Title: Re: txt file timer translation to 5.1.x
Post by: zung on 11 July, 2006, 17:37:47
Sure and all of these 'many" under 5.1.x are small , simple, fast and do "only" and exactly what this one does .

please help.. I'm blond ... not a programer genious : )))
Title: Re: txt file timer translation to 5.1.x
Post by: jiten on 11 July, 2006, 17:44:16
Quote from: zung on 11 July, 2006, 17:37:47
Sure and all of these 'many" under 5.1.x are small , simple, fast and do "only" and exactly what this one does .

please help.. I'm blond ... not a programer genious : )))

Search the forum for "rotating message" or "txt show".

I'm sure that one of those will fill your request.
Title: Re: txt file timer translation to 5.1.x
Post by: zung on 13 July, 2006, 06:05:37
Thanks Mutor : )
Your translation made me understand a bit more on how scripts work with txt files .
Even a blonde  ??? and if I have time to study , maybe someday I can help with this comunity as well
as your will to help me  ;)


xoxo

Vanessa