Hi, guys!
Is it possible to write a script that will scroll my hub Name and Topic in left direction? I want it to be shown on the top of DC++ programm in my hub like Hubname and topic.
Thanx a lot! :)
Best regards,
NemeziS
Available, but takes a lot of b/w. I will make it anyway later (or who is the faster lol)
This keeps rebuildinfg the topic banner. :)function Main()
SetTimer(1000)
StartTimer()
char=0
end
function GetBanner()
hubname=frmHub:GetHubName()
topic=frmHub:GetHubTopic()
chartab={}
banner=hubname.." - "..topic
-- leng=string.len(banner)
end
function OnTimer()
GetBanner()
char=char+1
if char < string.len(banner) then
SendToAll("$HubName "..string.sub(banner,1,char))
elseif char > string.len(banner) and char < string.len(banner)*2 then
SendToAll("$HubName "..string.sub(banner,-(string.len(banner)-char)))
else
SendToAll("$HubName "..banner)
end
end
its not working here ..
is this for latest version of ptokax ???
cause if it is can it be made for the old one to cause i liked that idea ..
or is it for in DC client wich supports lua scripting ??
didn't looked that much to it but is it possible to set the speed ??
so it is going 1 letter every 10 sec or every 1 hour for example ...
greetings Johan
Syntax error: attempt to call field `GetHubTopic' (a nil value)
stack traceback:
1: function `GetBanner' at line 9 [file `...ER.000\Bureaublad\2gb minshare\scripts\test.lua']
2: function `OnTimer' at line 16 [file `...ER.000\Bureaublad\2gb minshare\scripts\test.lua']
thats the error i get ...
but there is a topic ...
Another version:
-- set refresh time (speed) here. decimals are allowed.
secs=1
function Main()
SetTimer(secs*1000)
StartTimer()
char=0
end
function GetBanner()
hubname=frmHub:GetHubName()
topic=frmHub:GetHubTopic()
chartab={}
banner=hubname.." - "..topic
-- leng=string.len(banner)
end
function OnTimer()
GetBanner()
char=char+1
if char < string.len(banner) then
SendToAll("$HubName "..string.sub(banner,char,string.len(banner)))
elseif char > string.len(banner) and char < string.len(banner)*2 then
SendToAll("$HubName "..string.sub(banner,-(string.len(banner)-char)))
else
char=0
end
end
These are for ptokax 16.05.
Syntax error: attempt to call field `GetHubTopic' (a nil value)
stack traceback:
1: function `GetBanner' at line 16 [file `...ER.000\Bureaublad\2gb minshare\scripts\test.lua']
2: function `OnTimer' at line 23 [file `...ER.000\Bureaublad\2gb minshare\scripts\test.lua']
again that error ...
i guess its not working on 0.3.3.0-15.18(don't ask me why i use that version i don't now ... have 5 versions now =-p ill test the newest version in a short time but i think most of my scrtipts wont work .....)
QuoteOriginally posted by bastya_elvtars
These are for ptokax 16.05.
* commits a suicide soon, as post last till the start of the next one *
Thanx, bastya_elvtars! I just modified and tested the script and it works fine now. You should create Topic.txt file in your scripts folder to make the script work.
topicFile = "Topic.txt"
topic = nil
hubname = ""
secs=1/4 -- set refresh time (speed) here. decimals are allowed.
function Main()
SetTimer(secs*1000)
StartTimer()
char=0
end
function OnTimer()
hubname = frmHub:GetHubName()
handle = openfile(topicFile, "r")
if (handle) then
topic = read(handle)
closefile(handle)
end
chartab={}
char=char+1
if char < strlen(topic) then
SendToAll("$HubName "..hubname.." ** [ "..strsub(topic,char,strlen(topic)))
elseif char > strlen(topic) and char < strlen(topic)*2 then
SendToAll("$HubName "..hubname.." ** [ "..strsub(topic,-(strlen(topic)-char)))
else
char=0
end
end
Enjoy!
Best regards,
NemeziS
Yes, if there's no topic, it will crash. THX for report!
You did not notice that PtokaX has lua5 scripting now. I wrote this for lua5, complete script here (http://board.univ-angers.fr/thread.php?threadid=3855&boardid=26&styleid=1&sid=1c7d4e37ac995663e49444868a745249&page=1#2).
johan click here (http://board.univ-angers.fr/thread.php?threadid=3864&boardid=2&styleid=1&page=1#1)
plop
plop youre link is not working ...
Error Message
Invalid data!
Greetings Johan