Hi TS community,
I'm currently working on a LUA-script that is parsing my current channel and all the online people within that channel into a text file so I can use it with Rainmeter.
After a while of digging around on the internet, I found this repo with a script that is working:
https://github.com/GhostZero/TS3Viewer
However due to the nature of this script (including talkers, etc.) Rainmeter is getting very unresponsive when reading the text file. So I decided to get rid of the talker mechanism and only parse the text file as follows:
- First line: Channel name I'm currently in
- Following lines: users that are currently in the channel
Since the linked script only hooks into onTalkStatusChangeEvent(), I decided to further modify the script to only update the text file when a person is leaving/joining my channel (according to Google, that should be onClientMoveEvent()).
However now it broke and I'm unfortunately not able to pinpoint where it fails (not a coder)
This is the code I'm currently working with:
https://pastebin.com/hDuMEm3t
The part I commented out is the part with the onTalkStatusChangeEvent() which is working perfectly fine.
From what I've gathered my logic should (??) be correct:
- When the onClientMoveEvent()is triggered (serverwide?), I call updateTxt() with the newChannelID of that particular client.
- In the updateTxt function, I grab nickname, my own ID, the ID of the channel I'm currently in, the ID of the channel the user is in, open the text file etc.
- Then I compare my current channel ID with the channelID (former "newChannelID) the user that triggered the event is in because I want to find out if that user joined my channel or not
- If that's the case, I loop the clientList of my channel and write it to txt
- If not, I print "Fail"
Unfortunately when I changed this, the script stopped working and I cannot find out how to get it working again (except rolling back to the onTalkStatusChangeEvent(), which then only updates the channel list when I'm talking (i.e. not when I'm muted/afk).
I also cannot figure out how to find some sort of debug log, my Client Log (Ctrl+L in TS) is empty, even if I tick "DEBUG" for the log browser... I tried putting in some debugPrint() messages, but they show up nowhere (or at least I cannot find them..)
Any help would be greatly appreciated. I'm aware this might be a ridiculous solution, but I just don't know better - if anybody has an easier way to do this (keep a text file of channelname + people in the channel which is updated whenever somebody joins/leaves, please let me know!)
Thanks in advance