Community Forums Today's Posts     Member List     Archive    
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2012
    Posts
    2

    LUA script issues

    Hello, so I can't seem to find any support on this and the documentation for LUA is less than available in regards to TS3. I'm fairly new to LUA language, but I am having an issue with a script to just return all clients name, next to their idle time.

    Code:
    local clients, error = ts3.getClientList(serverConnectionHandlerID)
    	for i=1, #clients do
    		ts3.requestClientVariables(serverConnectionHandlerID, clients[i])
    		local name, nameError = ts3.getClientVariableAsString(serverConnectionHandlerID, clients[i], ts3defs.ClientProperties.CLIENT_NICKNAME)
    		local iTime, idleError = ts3.getClientVariableAsString(serverConnectionHandlerID, clients[i], ts3defs.ClientProperties.CLIENT_IDLE_TIME)
    		ts3.printMessage(serverConnectionHandlerID, name .. ": " ..iTime,1)
    	end
    That is what I have, however the issue I am having is that it is returning this:

    [WS]Teddy: 0
    This is for all clients as well, even checking manually the idle times are not zero.

    Any support for this would be much appreciated.

  2. #2
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    2,038
    I am not sure but I don't think you can get the Idle Time for any client but your own.

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    Well, even while testing it to get my own, it still is returning zero.

    Code:
    CLIENT_IDLE_TIME = 11,                       -- internal use
    I tried changing it to do it when OnUpdateClientEvent fires:

    Code:
    local function onUpdateClientEvent(serverConnectionHandlerID, clientID)
    	ts3.requestClientVariables(serverConnectionHandlerID, clientID)
    	local name, nameError = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_NICKNAME)
    	local iTime, idleError = ts3.getClientVariableAsString(serverConnectionHandlerID, clientID, ts3defs.ClientProperties.CLIENT_IDLE_TIME)
    	ts3.printMessage(serverConnectionHandlerID, name .. ": " ..iTime,1)
    end
    and still getting the same issue as before returning zero.

  4. #4
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    2,038
    Well as the Comment behind the definition suggests it is for internal use by TeamSpeak only and not exported to LUA.

  5. #5
    Join Date
    Nov 2010
    Location
    Poland
    Posts
    49
    i think idle time is stored by

    Code:
     getConnectionVariableAsUInt64(serverConnectionHandlerID, clientID, flag)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 21-12-2009, 08:32
  2. TS Script
    By Suizido in forum [TeamSpeak 2] Addons & Scripts
    Replies: 2
    Last Post: 06-06-2008, 19:08
  3. Server Start Script issues
    By spencerjw in forum [TeamSpeak 2] Server Support
    Replies: 7
    Last Post: 23-02-2006, 19:06
  4. search script / suche script
    By Michael_Jim in forum [TeamSpeak 2] Addons & Scripts
    Replies: 1
    Last Post: 31-05-2005, 20:27
  5. [start script] shell script for crontab
    By grizwald in forum [TeamSpeak 2] Server Support
    Replies: 4
    Last Post: 24-11-2004, 10:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •