Topic scrolling
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Topic scrolling

Started by NemeziS, 08 March, 2005, 17:34:43

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

NemeziS

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
--LUA forever! =)

bastya_elvtars

Available, but takes a lot of b/w. I will make it anyway later (or who is the faster lol)
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

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
Everything could have been anything else and it would have just as much meaning.

b_w_johan

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
checkout http://wwhublist.com/index.php for my World Wide HubList project!

b_w_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 ...
checkout http://wwhublist.com/index.php for my World Wide HubList project!

bastya_elvtars

#5
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.
Everything could have been anything else and it would have just as much meaning.

b_w_johan

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 .....)
checkout http://wwhublist.com/index.php for my World Wide HubList project!

bastya_elvtars

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 *
Everything could have been anything else and it would have just as much meaning.

NemeziS

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
--LUA forever! =)

bastya_elvtars

Yes, if there's no topic, it will crash. THX for report!
Everything could have been anything else and it would have just as much meaning.

bastya_elvtars

You did not notice that PtokaX has lua5 scripting now. I wrote this for lua5, complete script here.
Everything could have been anything else and it would have just as much meaning.

plop

http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

b_w_johan

plop youre link is not working ...

Error Message
Invalid data!

Greetings Johan
checkout http://wwhublist.com/index.php for my World Wide HubList project!

SMF spam blocked by CleanTalk