• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

getIdleTime does not update the Idle time

Kavatch

Member
I have found a thing that I found quite weird about the getIdleTime while doing some testing.
My setup is as follows:
I have made a script which, every second, gets the clients idle time and then sends a message to the client with the time.

Now to my problem:
While running this script, I switch channels, talk and change my mic status. All of these I did multiple times and still the bot only noticed it once.
See the following clip: https://dl.pluoi.com/5e0cc50495850.mp4
(My client is in german but you can see the idle time in the line which says: Untätig seit)

I have also had a situation in which the time isn't just a few seconds of but instead a few hours.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
Idle time isn't an exact thing, sadly. Reason for this is that this info needs to be queried from the server. The bot tries to estimate the idle time of all clients it knows at that time but only queries/updates it periodically, where the time between updates depends on the number of clients the bot can see. Whenever the bot gets an updated idle time, it will interpolate the time between the time it got the info and the current time.

Whenever you open the connection information window for a user (like you did in the video), all the info gets pulled from the server once per second. This however obviously doesn't scale for all clients.

I'll try to improve this feature in the future by a) make it possible to query manually and b) resetting the idle time whenever an action happens that can be seen by the bot that is known to reset the idle time. I'll need to find some time to check up on that, though ;)
 

Kavatch

Member
Thanks for the answer.
In the meantime, is there any kind of workaround to find out if the user is active?
Otherwise I have to wait a little bit, but that's no problem at all ^^
 

flyth

is reticulating splines
Staff member
Developer
Contributor
In the meantime, is there any kind of workaround to find out if the user is active?
For now, not really. You would need to poll the time periodically and check for yourself.
 

Flosing

Active Member
Tier I
The idle is counted up over the entire time the client is connected to the server. That means your script runs correctly. Do you just want to always send the idle time, or what are you going to do?
 

Kavatch

Member
The idle is counted up over the entire time the client is connected to the server. That means your script runs correctly. Do you just want to always send the idle time, or what are you going to do?
Well that's the thing I don't understand. I always though the Idle time should go back to zero every time I do something like talk, change channels and stuff like that.
What I am currently trying to make is a Support Bot for my team, my plan is that the bot only messages team members which are active at this very moment. Of course I also check if they have their microphone muted, however they don't always do this :p That's why I wanted a way to check if they are active ^^
Anyways, I've also wanted to make some statistics with it (Active / AFK user average)

But as I have said, non of these things are of great importance to me at least. So its no problem for me to wait.
 

Flosing

Active Member
Tier I
I have already integrated the support function you described in my controlbot (not sinusbot). With the query connection, it's pretty easy. If you want to use the sinusbot for this, you either have to intercept all other events and then set the idle to 0 in the memory, or wait until it has been integrated by michael.

By the way. You are German, right?
 

Kavatch

Member
I have already integrated the support function you described in my controlbot (not sinusbot). With the query connection, it's pretty easy. If you want to use the sinusbot for this, you either have to intercept all other events and then set the idle to 0 in the memory, or wait until it has been integrated by michael.

By the way. You are German, right?
Yea, I am currently too using a Java based query bot. How ever for me its no longer worth to maintain it for such a small feature.

And yes, I am indeed from germany.
 

flyth

is reticulating splines
Staff member
Developer
Contributor
I've added functionality to request an update on the connection information for specific clients as well as an event that gets emitted whenever the time is updated to the latest version. Needs some testing, though...
 

Kavatch

Member
I've added functionality to request an update on the connection information for specific clients as well as an event that gets emitted whenever the time is updated to the latest version. Needs some testing, though...
Awesome! But how am I able to test this? I am more than willing to test it with some of my users.
 
Top