It is currently April 28th, 2024, 6:07 pm
Help with Rainmeter Teamspeak Skin
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Help with Rainmeter Teamspeak Skin
I think eclectic-tech's solution is fine...
-
- Posts: 15
- Joined: November 15th, 2018, 2:47 pm
Re: Help with Rainmeter Teamspeak Skin
Thanks for all the good suggestions, I think I like balala's solution more (at least for my use case) since I'm using a quite large second screen with a lot of free real estate, so I don't necessarily care about showing a maximum number of users. If the list is longer than, say, 10 users, it just can expand further downwards.
However when I switch the measure over to WebParser I get the following problem in my Rainmeter log:
(Original error message is in German, I translated it roughly, hope it's understandable).
The problem seems to be that the WebParser cannot access the .txt file because it is in use (of course, because it's opened by Teamspeak to dump in the real-time channel data). Is there a way to circumvent this?
However when I switch the measure over to WebParser I get the following problem in my Rainmeter log:
Code: Select all
Fetching: file://C:\Users\enderep\AppData\Roaming\TSViewer\TSViewer.txt (TSViewer\TSViewer.ini - [measureTSViewer])
(Fetch error) The process cannot access the file, because it is currently in use by another process. (ErrorCode=32) (TSViewer\TSViewer.ini - [measureTSViewer])
The problem seems to be that the WebParser cannot access the .txt file because it is in use (of course, because it's opened by Teamspeak to dump in the real-time channel data). Is there a way to circumvent this?
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Help with Rainmeter Teamspeak Skin
I doubt it. It is unfortunate, and poor coding, that the Lua addon for Teamspeak opens the file in exclusive mode to write to it. That isn't necessary, as the only thing "writing" to the file is the Lua addon. There are no possible conflicts that need to be addressed like that.enderep12 wrote: ↑November 16th, 2018, 2:47 pm Thanks for all the good suggestions, I think I like balala's solution more (at least for my use case) since I'm using a quite large second screen with a lot of free real estate, so I don't necessarily care about showing a maximum number of users. If the list is longer than, say, 10 users, it just can expand further downwards.
However when I switch the measure over to WebParser I get the following problem in my Rainmeter log:(Original error message is in German, I translated it roughly, hope it's understandable).Code: Select all
Fetching: file://C:\Users\enderep\AppData\Roaming\TSViewer\TSViewer.txt (TSViewer\TSViewer.ini - [measureTSViewer]) (Fetch error) The process cannot access the file, because it is currently in use by another process. (ErrorCode=32) (TSViewer\TSViewer.ini - [measureTSViewer])
The problem seems to be that the WebParser cannot access the .txt file because it is in use (of course, because it's opened by Teamspeak to dump in the real-time channel data). Is there a way to circumvent this?
-
- Posts: 15
- Joined: November 15th, 2018, 2:47 pm
Re: Help with Rainmeter Teamspeak Skin
Highly likely Since I'm absolutely not a developer and I have no real clue what I'm doing in regards to that plugin I'm happy enough that I got it working. Do you have a suggestion how to change the LUA-Code in order to make the write non-exclusive? The part where I open/write to it is the following:jsmorley wrote: ↑November 16th, 2018, 3:00 pm I doubt it. It is unfortunate, and poor coding, that the Lua addon for Teamspeak opens the file in exclusive mode to write to it. That isn't necessary, as the only thing "writing" to the file is the Lua addon. There are no possible conflicts that need to be addressed like that.
Code: Select all
if channelID == ownChannel then
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[i]
local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME)
io.write("".. tempClientName .."\n")
end
else
local file = io.open(os.getenv('APPDATA') .. "/TSViewer/TSViewer.txt", "w")
io.output(file)
io.write("".. ownChannelName .."\n")
for i=1, #clientList do
local tempClientId = clientList[i]
local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME)
io.write("".. tempClientName .."\n")
end
end
io.close()
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Help with Rainmeter Teamspeak Skin
The first thing I would try is to change all "w" to "w+" in the file open statements.enderep12 wrote: ↑November 16th, 2018, 3:08 pm Highly likely Since I'm absolutely not a developer and I have no real clue what I'm doing in regards to that plugin I'm happy enough that I got it working. Do you have a suggestion how to change the LUA-Code in order to make the write non-exclusive? The part where I open/write to it is the following:
Would it help to put an io.close() within each part of the if/else?Code: Select all
if channelID == ownChannel then 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[i] local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME) io.write("".. tempClientName .."\n") end else local file = io.open(os.getenv('APPDATA') .. "/TSViewer/TSViewer.txt", "w") io.output(file) io.write("".. ownChannelName .."\n") for i=1, #clientList do local tempClientId = clientList[i] local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME) io.write("".. tempClientName .."\n") end end io.close()
-
- Posts: 15
- Joined: November 15th, 2018, 2:47 pm
Re: Help with Rainmeter Teamspeak Skin
Yup, that did it in part with moving the io.close after the for loops for the if/else. Thanks! The file is now properly closed after each write (which happens on a "onChannelMove" event (which is when somebody on the server changes channels):
Working Code:
Code: Select all
if channelID == ownChannel then
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[i]
local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME)
io.write("".. tempClientName .."\n")
end
io.close()
else
local file = io.open(os.getenv('APPDATA') .. "/TSViewer/TSViewer.txt", "w+")
io.output(file)
io.write("".. ownChannelName .."\n")
for i=1, #clientList do
local tempClientId = clientList[i]
local tempClientName = ts3.getClientVariableAsString(serverConnectionHandlerID, tempClientId, ts3defs.ClientProperties.CLIENT_NICKNAME)
io.write("".. tempClientName .."\n")
end
io.close()
end
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Help with Rainmeter Teamspeak Skin
The real issue I have with this is that the Lua apparently re-creates the entire file from scratch each time it is executed. This means that even in non-exclusive mode, WebParser could in theory hit the file and return nothing, or just a partial result, since the Lua could be in the middle of creating and populating the file.
In a perfect world, the Lua would open the file in "append" mode, and just add new stuff to it as needed, rather than re-creating the entire thing all the time. That would likely take some significant change to the logic of the addon though. I don't have Teamspeak, so I can't really get too far into that.
In a perfect world, the Lua would open the file in "append" mode, and just add new stuff to it as needed, rather than re-creating the entire thing all the time. That would likely take some significant change to the logic of the addon though. I don't have Teamspeak, so I can't really get too far into that.
-
- Rainmeter Sage
- Posts: 16185
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help with Rainmeter Teamspeak Skin
You can easily switch Rainmeter to English, from the Settings tab of the Manage Rainmeter dialog.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Help with Rainmeter Teamspeak Skin
That won't change the output of Windows API error messages, which that fetch error is...
-
- Posts: 15
- Joined: November 15th, 2018, 2:47 pm
Re: Help with Rainmeter Teamspeak Skin
My Rainmeter is in English, but my Operating System is not, I think this is an error message that was generated from my OS.
I agree, but this exceeds my coding skills For now this is good enough for me, but there is one more problem that I'm sure you guys can help me with.jsmorley wrote: ↑November 16th, 2018, 3:16 pm The real issue I have with this is that the Lua apparently re-creates the entire file from scratch each time it is executed. This means that even in non-exclusive mode, WebParser could in theory hit the file and return nothing, or just a partial result, since the Lua could be in the middle of creating and populating the file.
In a perfect world, the Lua would open the file in "append" mode, and just add new stuff to it as needed, rather than re-creating the entire thing all the time. That would likely take some significant change to the logic of the addon though. I don't have Teamspeak, so I can't really get too far into that.
I switched everything over to balala's method (thanks again!), since I have a lot of screen real estate and I'm fine with the list being (theoretically) endless (it will not be, since my TS has a limited amount of slots anyway). But there seems to be an error with parsing the Channelname (or maybe I created the meter wrong).
This is my current .ini: This is how my skin looks like and as you can see the channel name is missing (not sure why - the red text is added with Paint, obviously in my skin the space is just black) EDIT: FIXED IT, I was missing a DynamicVariables=1 in the meter for channel name!
You do not have the required permissions to view the files attached to this post.
Last edited by enderep12 on November 16th, 2018, 3:28 pm, edited 1 time in total.