LCDHost Forums

Sourcecode => Other sourcecode => Topic started by: lethys on 2010-12-27 02:49:03

Title: [release] LUA TS3 Plugin 0.01
Post by: lethys on 2010-12-27 02:49:03
since h0nk got on my nerves this evening, i managed to finish a ts3 lua plugin and an lcdhost lua plugin that share a file as pipeline for information.


The ts3 plugin keeps a table of the people who are actively talking (and of 0s for people who aren't talking) and writes it to a file (APPDATA/honkiformerts3.txt), the lcdhost plugin reads that file and checks for non-0s, if there is a non-zero the area of the class is filled with black with the name of the person(s) written in white and a special character in front.
latency is surprisingly instant.


h0nk will follow with an update layout soon

some more info for those who want to customize:

you can change the * in front of the nick by editing this line:
Code: [Select]
           active = active .. "*" .. line .. " "
for example:
Code: [Select]
           active = active .. "\226\128\162" .. line .. " "

you can make a message constantly appear in front of the nicks by editing:
Code: [Select]
   local active = ""
to your liking.

Of course it is also possible to change the colors or font since it uses cairo as drawing engine, so it can easily be adapted to display things in 32bit colors (nicks in different colors for example).

This makes it the first working TS3 Plugin (albeit a bit hackish) and the first useful LUA plugin for LCDHost n_n

please make feature requests for more ts3 functionality in this thread
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: SirReal on 2010-12-27 09:52:01
It is indeed the first Lua plugin for LCDHost! Congratulations!
I'm going to make you a moderator for the LCDHost plugins subforum, that will let you post your works there. (Where they belong).
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: Triscopic on 2010-12-27 12:14:32
Congrats on the plugin and welcome to the club!  ;)
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: lethys on 2010-12-27 18:07:12
weee thanks n_n
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: Insane on 2010-12-28 10:43:36
good work alright. been hassling these guys for ts3 for a while haha

future requests..ahh..just need font size bit bigger...and transparent background.
edit: figured out how to change font size....not text color or background yet tho
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: lethys on 2010-12-29 02:37:43
you can change the colors this way:
Code: [Select]
cairo.set_source_rgba(cr, RED, GREEN, BLUE, ALPHA)where red,green,blue and alpha go from 0.00(0000 ???) to 1.00
alpha is the transparency so if you want to make something transparent you set it 0 if you want to have it half transparent you set it to 0.5.
Code: [Select]
cairo.set_source_rgba(cr, 0, 1, 0, 1)gives you a nice green for example. I have no clue why they wouldn't use 0-255 but you can convert it like this: 1/255*[what you want]
the color is always set in front of the "action", cairo.paint(cr) paints the background while cairo.show_text(cr, bla ) displays text.
it would also be possible to displays nicks in different colors (random ? :D) or display the * character in a different color (that would be a bit of coding though to break up the strings, though cairo.show_text neatly places them directly after each other without needing a cairo.move_to)
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: lethys on 2010-12-29 03:36:55
I'm cleaning up my code a little and putting it all a little nicer so you have one lua where you can change the colors and fonts for all my plugins in one setting without having to worry about the actual code
Title: Re: [release] LUA TS3 Plugin 0.01
Post by: nuning on 2018-04-02 06:40:53
Thanks for the open channel, which I think is good.

bacc1688 (