It is currently April 27th, 2024, 11:43 pm

Help with Rainmeter Teamspeak Skin

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with Rainmeter Teamspeak Skin

Post by jsmorley »

balala wrote: November 15th, 2018, 4:23 pm 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.
Balala, here is the .zip file with the text file he want to parse.

TSViewer.zip
You do not have the required permissions to view the files attached to this post.
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

balala wrote: November 15th, 2018, 4:23 pm 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.
Hm, that is very strange, the skin only consists of the .ini file that I posted in the very first post and a single .png (teamspeak icon) and the zip files are only a single .txt file with 3 lines of content..

If you follow the instructions in my second post, you should be able to recreate the setup just by copy+pasting everything, you can see the sourcecode of the lua as well, so definitely not a virus :???:

Does it work if I upload via forum?
TSViewer_0.1.rmskin
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

enderep12 wrote: November 15th, 2018, 4:37 pm Hm, that is very strange, the skin only consists of the .ini file that I posted in the very first post and a single .png (teamspeak icon) and the zip files are only a single .txt file with 3 lines of content..

If you follow the instructions in my second post, you should be able to recreate the setup just by copy+pasting everything, you can see the sourcecode of the lua as well, so definitely not a virus :???:
I have that PSViewer.txt file, with those three lines, as jsmorley re-posted it. But you were talking about some lua-plugin, which I don't know what is.
Beside, I'd need both files, the .ini, and the image (if there indeed are just two files). As I said, I can't download the package, because my Eset Smart security doesn't let me to do this. You said the package doesn't contain viruses and I don't contest this, however I can't download the package. Maybe the site where you've uploaded it is harmful or something, but I just can't download it (and to be honest I won't bypass my well working anti virus).
So again, please re-pack the whole config and upload it here on the forum. - Sorry, saw too late your uploaded package. I just downloaded the last posted package and it is ok!
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

- The LUA is a script for Teamspeak, not for Rainmeter. You can find it (in text form) on the pastebin provided in my very first post. This LUA is loaded by Teamspeaks LUA-Plugin and is then writing to a text file (this is completely separate from Rainmeter) and works already...

The text file which containts info written into it by TS should then be read into Rainmeter (to show me who's online).

I was only having problems with the Rainmeter part, but to make it fully clear I was also posting the LUA script for TS.


So for the full skin:
Create a folder TSViewer in your Rainmeter directory, insert the .ini I posted in first thread and a subfolder images where you place
Teamspeak.png
.

Then you set the TXTPath variable to a text file (this is in my case the text file that is created by the LUA plugin out of Teamspeak).

Edit: Just saw that the forum upload worked, that's good to hear!

So just to make it clear again, the full workflow of this skin should be:
- Teamspeak LUA plugin is writing data of online ppl in a text file (this LUA is running in TS, NOT in Rainmeter!)
- Rainmeter is parsing this text file into a Skin
- I have problems with parsing special chars like ü/ö/ä/etc. (as mentioned before this might have something to do with encoding?!)
- I'd like to parse the first line of the text file (always the channel name i'm currently in) to the header of the skin (currently: "Who's online")
- The skin in its current form makes my rainmeter very laggy and I don't know why, since it's only reading a text file
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

I'm sorry, I retire, because I don't have Teamspeak installed. Hope jsmorley or someone else will help you. I realized just now, I need it to help you.
Sorry again...
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

balala wrote: November 15th, 2018, 5:19 pm I'm sorry, I retire, because I don't have Teamspeak installed. Hope jsmorley or someone else will help you. I realized just now, I need it to help you.
Sorry again...
No problem, this is why I said you can just create a dummy text file (not a "real time") and set TXTPath to that, that should work as well..
User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

enderep12 wrote: November 15th, 2018, 5:22 pm No problem, this is why I said you can just create a dummy text file (not a "real time") and set TXTPath to that, that should work as well..
Ok, I see now.
So, there is a quite simple solution: you have to replace the QuotePlugin measure with the appropriate WebParser measures. For example you can use the following ones:

Code: Select all

[measureTSViewer]
Measure=WebParser
URL=file://#TXTPath#
RegExp=(?siU)^(.*)\n(.*)$
DecodeCharacterReference=1

[MeasureName]
Measure=WebParser
Url=[measureTSViewer]
StringIndex=1
DecodeCharacterReference=1

[MeasureUsers]
Measure=WebParser
Url=[measureTSViewer]
StringIndex=2
DecodeCharacterReference=1
As I think you've figured out, [MeasureName] returns the name of channel, while [MeasureUsers] returns the list of users.
I don't think a .lua script would be needed.
Obviously you have to modify the [meterTSViewer] String meter to show up the new measures as well. I hope you can do this. Please do it , then test the above code. And let me know how does it work.
enderep12
Posts: 15
Joined: November 15th, 2018, 2:47 pm

Re: Help with Rainmeter Teamspeak Skin

Post by enderep12 »

Thanks for the input! I will try this tomorrow and get back to you.

I think I'll be able to figure it out from what you gave me. :thumbup:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Help with Rainmeter Teamspeak Skin

Post by eclectic-tech »

jsmorley will be posting a lua solution, but in the meantime, I would suggest slightly modified version of balala's code, using lookahead in your RegExp since you do not know how many users will be on at any given time.

Using balala's RegExp, create a lookahead variable 'capture', and add that as many times as the number of users you want to show, to the end of the RegExp line.

The lookahead will prevent the webparser from failing if the number of users is less than you expect.

Here's my version:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

; ========= Variables ==========
[Variables]
capture=(?(?=...)(.*)\n)

; ========= Measures ==========
[MeasureWebParser]
Measure=WebParser
URL=file://#CurrentPath#TSViewer.txt
RegExp=(?siU)^(.*)\n#capture##capture##capture##capture##capture#
; Substitute=
StringIndex=1
ForceReload=1
LogSubstringErrors=0
; Documentation: https://docs.rainmeter.net/manual-beta/measures/webparser/

[MeasureWebParserChild1]
Measure=WebParser
Url=[MeasureWebParser]
StringIndex=2
; RegExpSubstitute=1
; Substitute=
DecodeCharacterReference=1

[MeasureWebParserChild2]
Measure=WebParser
Url=[MeasureWebParser]
StringIndex=3
; RegExpSubstitute=1
; Substitute=
DecodeCharacterReference=1

[MeasureWebParserChild3]
Measure=WebParser
Url=[MeasureWebParser]
StringIndex=4
; RegExpSubstitute=1
; Substitute=
DecodeCharacterReference=1

; ========= Meter Styles ==========



; ========= Meters ==========

[MeterStringT]
Meter=String
MeasureName=MeasureWebParser

[MeterString1]
Meter=String
MeasureName=MeasureWebParserChild1
X=r
Y=R

[MeterString2]
Meter=String
MeasureName=MeasureWebParserChild2
X=r
Y=R

[MeterString3]
Meter=String
MeasureName=MeasureWebParserChild3
X=r
Y=R

[MeterString4]
Meter=String
MeasureName=MeasureWebParserChild4
X=r
Y=R

User avatar
balala
Rainmeter Sage
Posts: 16182
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with Rainmeter Teamspeak Skin

Post by balala »

eclectic-tech wrote: November 15th, 2018, 7:05 pm jsmorley will be posting a lua solution, but in the meantime, I would suggest slightly modified version of balala's code, using lookahead in your RegExp since you do not know how many users will be on at any given time.

Using balala's RegExp, create a lookahead variable 'capture', and add that as many times as the number of users you want to show, to the end of the RegExp line.

The lookahead will prevent the webparser from failing if the number of users is less than you expect.
Yep, good point! :thumbup:
My code returns the list of users as one. No new measure for each of them, they being returned by one. Although I didn't test your code, it probably could be a better solution (especially knowing your usually good solutions).
Let's see what enderep12 will say.