It is currently April 24th, 2024, 6:00 pm

Help with Rainmeter Teamspeak Skin

Get help with creating, editing & fixing problems with skins
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Help with Rainmeter Teamspeak Skin

Post by enderep12 »

Hi guys,

I'm currently working on a Rainmeter Teamspeak Skin.

I found a LUA-Plugin for Teamspeak that maintains a TXT-File with people in a channel. I modified this script to hook into the channel join/leave event and also include the channel name and got rid of the talker function (I found RM to become very laggy, especially when the talker was only talking for a fraction of a second and rainmeter update was set to 1000.) My modified code for this TS LUA-Plugin is here: https://pastebin.com/81V9nVJp

This textfile is always in this format (1st line = name of channel, rest of the lines = players in the channel):
Name of Channel
Player X
Player Y
Player Z
Player ...

So far so good, I then tried to create a skin for Rainmeter which reads this text file and outputs it in a formatted way, but I have several problems:

- First I tried using the reader from https://forum.rainmeter.net/viewtopic.php?t=6998 but this made my Rainmeter freeze up every few seconds (not sure why) - even when the txt-file didn't change at all
- Then I moved over to the "Quote" Plugin and just read the whole text file only when it updates. This makes it a bit more responsive, but it still freezes up sometimes... I don't know why - there's no CPU/IOPS peak visible in my taskmanager.. it just kinda freezes. The only other Skins I use are the ModernGadgets HWINFO Skins... (CPU, GPU, Clock, Network, Disk Meter)... As soon as I unload my TS Skin, RM is completely responsive again without hickups.
- Since a lot of channels on my TS are German, there's quite some characters like öäü etc. On Rainmeter these show up wrong, e.g. "für" will be "für" etc. The characters get parsed correctly to my txt file, so the problem seems to be somewhere in the quotes plugin? Is there a flag I can set so those chars show up correctly?

My skin so far (I used a design from a skin I found on the board which I liked and tried to put my info in there):
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
DynamicVariables=1
DecodeCharacterReference=1

[Variables]
;;Here's your font options. Change these to whatever fits your fancy. Know that you may have to change some meter alignments if you do.
FontFace=Segoe UI Light
FontSize=14
FontColor=f2f2f2
StringAlign=Right
TXTPath=C:\Users\enderep\AppData\Roaming\TSViewer\TSViewer.txt

[Title]
Meter=String
Text=Who's Online?
FontFace=#FontFace#
FontSize=#FontSize#
FontColor=#FontColor#
StringAlign=#StringAlign#
X=295
y=25
w=300
h=100
AntiAlias=1
SolidColor=0,0,0,1

[AddNoteIcon]
Meter=Image
ImageName=#CURRENTPATH#images\teamspeak.png
X=110
Y=r
W=30
H=30
PreserveAspectRatio=1
AntiAlias=1
GreyScale=1
ImageTint=d2d2d2
SolidColor=0,0,0,1

[BarStyle]
Solidcolor=140,140,140
X=112
y=30r
w=200
h=1

[Bar]
Meter=Image
MeterStyle=BarStyle

[EmptySpace]
Meter=String
X=0
Y=50
W=100
H=10

[measureTSViewer]
Measure=Plugin
Plugin=QuotePlugin
PathName=#TXTPath#
Separator=¶
OnChangeAction=[!UpdateMeter "meterTSViewer"][!Redraw]

[meterTSViewer]
Meter=String
X=120
Y=20r
FontFace=#FontFace#
FontSize=#FontSize#
FontColor=#FontColor#
StringAlign=Left
Text="[measureTSViewer]"
DynamicVariables=1
AntiAlias=1
SolidColor=0,0,0,1
Is there a more efficient way to read this textfile that doesn't freeze up Rainmeter that hard? I thought about using the webparser as well, but I'm too stupid for RegEx ;)
In a perfect world, I'd like to have my skin set up as follows:

TS-Icon ............ Name of Channel (instead of "Who's online?)
-------------------------------------------
List of n Users in channel

Is it possible to parse the textfile in a way that I can split the first line and use it as channel name?

Thanks in advance for any help, it's greatly appreciated.
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

Would be better if you'd pack the whole config and would upload it, to have all needed files.
In the meantime, the following WebParser measure reads the content of the file:

Code: Select all

[MeasureFile]
Measure=WebParser
URL=file://#TXTPath#
RegExp=(?siU)^(.*)$
StringIndex=1
As I said, this measure returns the whole content of the file given as the TXTPath variable.
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

Hi, thanks for the reply.

The skin is uploaded here:
https://www72.zippyshare.com/v/rP9twXx1/file.html

However to get this to work you need to follow these instructions (part of it is the LUA-Plugin for Teamspeak 3):
1. Set-Up TS3 Lua Plugin:
-- Installation:
-- Go to /appdata/Roaming (%appdata% + Enter in Start) -> TS3Client -> plugins -> lua_plugin
-- Create a new folder, rename it to "TSViewer"
-- Create a file called "init.lua" and paste in the code from the pastebin https://pastebin.com/81V9nVJp
-- Start Teamspeak, make sure the lua plugin is enabled in options->plugins
-- Enter the TS LUA-plugin settings, enable the TSViewer script

2. Set-Up TXT File
-- Go to /appdata/Roaming (%appdata% + Enter in Start)
-- Create a folder called "TSViewer"
-- Create an empty text file called "TSViewer.txt"
-- Restart your TS client, if everything is set up correctly and you switch a channel, the name of the channel + users in it should be correctly written to this new text file

3. Set Up Rainmeter
-- Install .rmskin File to rainmeter
-- Edit skin and change "TXTPath" in [Variables] to the path of your TSViewer.txt file (usually C:\Users\[YOUR USERNAME]\AppData\Roaming\TSViewer\TSViewer.txt
-- Load Skin

--

For the sake of troubleshooting, you can just create a dummy textfile in C:\Users\[your username]\AppData\Roaming\TSViewer\TSViewer.txt and fill it with dummy info like:
Channelname
Username 1
Username 2
Username 3
Username 4

Then the skin should still work and show this list, as long as you have set the TXTPath variable to point to a text file. Even if you don't have TS installed.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with Rainmeter Teamspeak Skin

Post by jsmorley »

The easiest way for the folks here to help you is for you to .zip up that .txt file and attach it here. It's important that we have an actual version of the text file, so we are not chasing "encoding" and "line endings" or anything else that can just confuse the issue.
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

jsmorley wrote: November 15th, 2018, 3:49 pm The easiest way for the folks here to help you is for you to .zip up that .txt file and attach it here. It's important that we have an actual version of the text file, so we are not chasing "encoding" and "line endings" or anything else that can just confuse the issue.
ZIP with Text file as used by me is here: https://www25.zippyshare.com/v/JuwwWAwT/file.html

For the packaged skin, please see my post above.

Please bear in mind that this file changes all the time. Every time somebody joins the channel in TS, the LUA-Plugin for Teamspeak will rewrite the file with the new user list... But the format will always stay the same (the LUA Plugin for Teamspeak just opens it, writes the Channelname + Users and closes it again). For the code of this refer to the pastebin above. But it's basically this part:
local file = io.open(os.getenv('APPDATA') .. "/TSViewer/TSViewer.txt", "w")
io.output(file)
io.write("".. channelName .."\n")
for i=1, #clientList do
local tempClientId = clientList
local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME)
io.write("".. tempClientName .."\n")
end
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with Rainmeter Teamspeak Skin

Post by jsmorley »

I'd like to see a .zip with the text file having some non-ASCII chars in it, like umlauts and such. I want to be sure the text file ends up encoded as UTF-8 by the Lua.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with Rainmeter Teamspeak Skin

Post by jsmorley »

Don't create a fake example text file, we can't trust that. Go on an active Teamspeak channel and have it capture some real output. Zip that up.
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

I don't know what you mean by "fake zip file", this was taken from a live Teamspeak server... I was just mentioning that this file is not static, it get's rewritten by the TSViewer Plugin for Teamspeak all the time according to who's in the channel etc.

I renamed the channel with some special chars and zipped it up again:
https://www21.zippyshare.com/v/hPWzTxlr/file.html

When I open up this file in my text editor it shows all the umlauts correctly.

According to my VSCode this file is encoded in UTF-8 | CLRF, I created the first empty file by just rightclicking and selecting: New -> Text File in the Windows Context menu.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with Rainmeter Teamspeak Skin

Post by jsmorley »

Ok, I need to run out for a couple of hours I'm afraid. When I get back, if someone else hasn't jumped in, I will put something together.

The idea is this:

Create some maximum number of meters to hold the individual user names. These have to be created up front, although they will start as "hidden", so you must decide on some maximum number. These can be formatted any way you want as far as the font size and color and all that.

1) Use WebParser to read in the entire file into one long string.
2) Use a Lua Script measure to parse the first line as the "channel name", and all subsequent lines as a variable number of "user names". Get a "count" of these user names in Lua.

3) In a loop from 1 to "count", use Bangs in Lua to set the TEXT value for the first meter as the channel name, and then populate and unhide as many meters as needed for the user names.

I'll knock out an example when I get back, although someone is likely to beat me to it...
User avatar
balala
Rainmeter Sage
Posts: 16167
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

I'm sorry, I can't download any of the uploaded files, because they look infected and my anti virus don't let me to download them.
Please check your package and as jsmorley said, upload them here on the forum.