Forum

Page 98 of 100 FirstFirst ... 488896979899100 LastLast
Results 1,456 to 1,470 of 1498
  1. #1456
    Join Date
    February 2018
    Posts
    1

    Loop

    Hey,

    I got a little problem with the API and I hope you can help me out.

    I want to implement a bot which is constantly checking the channel strukture and creating / deleting channels. The code I've written works pretty good but only the first iteration of the script. The problem is that the while loop which keeps the script running always uses the same data. So is there a way to get the actual data from the Server every iteration and not only the data when the sript is launched the first time?

    I'd like to show you my code but whenever I try to put some code here the submit gets blocked...

  2. #1457
    Join Date
    February 2014
    Posts
    283
    Quote Originally Posted by TobAlt View Post
    Hey,

    I got a little problem with the API and I hope you can help me out.

    I want to implement a bot which is constantly checking the channel strukture and creating / deleting channels. The code I've written works pretty good but only the first iteration of the script. The problem is that the while loop which keeps the script running always uses the same data. So is there a way to get the actual data from the Server every iteration and not only the data when the sript is launched the first time?

    I'd like to show you my code but whenever I try to put some code here the submit gets blocked...
    Why not just call the script every X mins rather than loop it constantly?

  3. #1458
    Join Date
    February 2018
    Posts
    1

    TS3 Framework - get client port and ping

    Hey, im working on a PHP script for my Teamspeak Server.


    Can someone tell me how I can get with PHP a client port and ping.



    Regards

  4. #1459
    Join Date
    August 2016
    Posts
    1
    I got an error with the API

    Code:
    PHP Fatal error:  Uncaught Error: Call to undefined function utf8_encode() in /o             pt/Whitelist/libraries/TeamSpeak3/Helper/String.php:475
    Stack trace:
    #0 /opt/Whitelist/libraries/TeamSpeak3/Adapter/ServerQuery.php(205): TeamSpeak3_             Helper_String->toUtf8()
    #1 /opt/Whitelist/libraries/TeamSpeak3/Node/Abstract.php(85): TeamSpeak3_Adapter             _ServerQuery->prepare('login', Array)
    #2 /opt/Whitelist/libraries/TeamSpeak3/Node/Abstract.php(97): TeamSpeak3_Node_Ab             stract->prepare('login', Array)
    #3 /opt/Whitelist/libraries/TeamSpeak3/Node/Host.php(839): TeamSpeak3_Node_Abstr             act->execute('login', Array)
    #4 /opt/Whitelist/libraries/TeamSpeak3/TeamSpeak3.php(330): TeamSpeak3_Node_Host             ->login(Object(TeamSpeak3_Helper_String), Object(TeamSpeak3_Helper_String))
    #5 /opt/Whitelist/whitelist.php(12): TeamSpeak3::factory(Object(TeamSpeak3_Helpe             r_Uri))
    #6 {main}
      thrown in /opt/Whitelist/libraries/TeamSpeak3/Helper/String.php on line 475

  5. #1460
    Join Date
    July 2014
    Posts
    24
    Hey,

    I want to set the default ChannelGroup (ID 8) of User "William" in Channel "Talking 1".
    Whats the line of code for that? I cant figure it out...
    The Names above are just examples for Usernames and Channelnames i get in my script to work with.

  6. #1461
    Join Date
    February 2014
    Posts
    283
    Quote Originally Posted by DerRene View Post
    Hey,

    I want to set the default ChannelGroup (ID 8) of User "William" in Channel "Talking 1".
    Whats the line of code for that? I cant figure it out...
    The Names above are just examples for Usernames and Channelnames i get in my script to work with.

    Take a look at: https://docs.planetteamspeak.com/ts3...008b886b1c52fb

  7. #1462
    Join Date
    July 2014
    Posts
    24
    Thanks, got it running.

    Now something else i need help with
    I need to get the last online date of an client i have the UID from.
    I build a script that works, but only for clients that are currently online, dont know how to
    do that for offline clients..

  8. #1463
    Join Date
    September 2008
    Location
    England...
    Posts
    40
    After updating to PHP7 I get this error when trying to either kick someone or delete them from Teamspeak, difficult to tell which if not both.
    Fatal error: Cannot unset $this in /home/sever/public_html/ts3apitest/TeamSpeak3/Node/Server.php on line 2272

    Does this not support PHP7 yet?

  9. #1464
    Join Date
    April 2014
    Location
    Seattle, WA, USA
    Posts
    141
    Hey everyone,

    Just a reminder that you can get the current release (stable) and pre-release updates for this at our GitHub repo:
    https://github.com/planetteamspeak/ts3phpframework

    Due to the inaccessibility of the forums, we rarely check this thread for support requests.
    If you need specific help or have a bug to report, we highly recommend opening an issue:
    https://github.com/planetteamspeak/t...amework/issues

    Some updates:
    Current Release: 1.1.31
    Compatibility: PHP 7.1 (stable), 7.2.x (works, but not fully tested)

    As an aside, I'm working on few feature branches at:
    https://github.com/ronindesign/ts3phpframework

    We're aiming for the following milestones, let us know what you think:
    - Testing: Unit tests for conversions, state, etc. Integration testing for async logic and query responses.
    - Usability Update: PSR compliant autoloading, documentation update, IDE code hinting, wiki pages applied usage
    - Async Upgrade: Threading support (multiple bots), better tooling for working in async / threaded env, more examples or extensions
    - Optimization: Implement new PHP features, rewrite/simplify some error-prone areas, offload parsing, service workers to C extensions.
    Last edited by Ronin Design; March 25th, 2018 at 01:41 PM.

  10. #1465
    Join Date
    May 2018
    Location
    Brazil
    Posts
    1

    Only days?

    How to show only days?

    PHP Code:
    <?php echo TeamSpeak3_Helper_Convert::seconds($ts3->virtualserver_uptime); ?>


    https://i.imgur.com/u2a4ill.png

  11. #1466
    Join Date
    March 2011
    Location
    Russia
    Posts
    24
    <?php echo ($ts3->virtualserver_uptime / 86400) % 30; ?>

  12. #1467
    Join Date
    June 2018
    Posts
    1
    Hello,

    I've been searching alot for a feature, I would like to get the session connection time for a user, then change it to a hh:mm:ss format.
    I tried things like $ts3_Client['client_connection_time'] but didn't work and I can't find a clue. Is there a way to grab this client information? (I'm not talking about total connection time because I know Teamspeak doesn't store it, but of session time)

    $ts3_Client comes from :

    $clientList = $ts3_VirtualServer->clientList();
    foreach($clientList as $ts3_Client){

    Thanks !

  13. #1468
    Join Date
    January 2016
    Posts
    12
    I have a laravel based app, Will give it a try to add some extra features to it. Thank you for the work.

  14. #1469
    Join Date
    June 2018
    Posts
    1

    client_lastconnected

    Quote Originally Posted by therealKitsune View Post
    Hello,

    I've been searching alot for a feature, I would like to get the session connection time for a user, then change it to a hh:mm:ss format.
    I tried things like $ts3_Client['client_connection_time'] but didn't work and I can't find a clue. Is there a way to grab this client information? (I'm not talking about total connection time because I know Teamspeak doesn't store it, but of session time)

    $ts3_Client comes from :

    $clientList = $ts3_VirtualServer->clientList();
    foreach($clientList as $ts3_Client){

    Thanks !
    You could do something like this:

    PHP Code:
    // Get clients
    $clients $ts3_VirtualServer->clientList();
    foreach (
    $clients as $client) {

        
    // Get extra info from db
        
    $db_id $client['client_database_id'];
        
    $extraInfo $client->clientInfoDb($db_id);

        
    $username $client['client_nickname']->__toString();
        
    $onlineFor time() - $extraInfo['client_lastconnected'];
        
    $pretty_time sprintf('%02d:%02d:%02d', ($onlineFor/3600),($onlineFor/60%60), $onlineFor%60);

        echo 
    'User ' $username ' is online for ' $pretty_time ' (H:M:S).';

    For some reason the client_lastconnected isn't always correct. For some users it's way to long (Like 10+ weeks). I've found some info about it in this forum, but no solid solution tho.

    Somebody that knows a solution tho client_lastconnedted not being reset?

    Hope it help

  15. #1470
    Join Date
    June 2008
    Posts
    18,412
    Would say you use server 3.2.0. This server version has a bug with last connection of clients.

    https://forum.teamspeak.com/threads/...603#post457603
    When sending me private messages: Please make sure to include reference link to your forum thread or post.

    TeamSpeak FAQ || What should i report, when i open a client thread?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP Framework
    By Multivit4min in forum Permission System
    Replies: 1
    Last Post: June 29th, 2015, 12:28 PM
  2. PHP Framework
    By phil998 in forum Server Support
    Replies: 0
    Last Post: February 25th, 2015, 07:27 PM
  3. TS3 PHP Framework Visualizations
    By Ronin Design in forum Tools / Web Based
    Replies: 2
    Last Post: February 22nd, 2015, 06:04 AM
  4. Extraction using the Framework
    By HarryMW in forum Tools / Web Based
    Replies: 1
    Last Post: August 3rd, 2012, 08:04 PM
  5. Teamspeak, PHP Framework?
    By mario2027 in forum General Questions
    Replies: 1
    Last Post: December 21st, 2010, 10:30 AM

Tags for this Thread

Posting Permissions

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