Advertisement
Guest User

Untitled

a guest
Jun 13th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.42 KB | None | 0 0
  1. <?php
  2. $ts3_ip = '127.0.0.1';
  3. $ts3_queryport = 10011;
  4. $ts3_port = 9987;
  5. $ts3_user = 'serveradmin';
  6. $ts3_pass = '';
  7. require("ts3admin.class.php");
  8.  
  9. $tsAdmin = new ts3admin($ts3_ip, $ts3_queryport);
  10. if($tsAdmin->getElement('success', $tsAdmin->connect())) {
  11. $tsAdmin->selectServer($ts3_port);
  12. $tsAdmin->login($ts3_user, $ts3_pass);
  13.  
  14. $users = array("zvR+TNbtGHbqI7ibCkzENzXCttU=", "D8Jmx6Ym7YqG3nheOagi2VEHI24=", "u1afCoH8DCA/gQMSpQiHQtoL9+4=");
  15. $channels = array(143, 101, 102);
  16.  
  17. $channelInfo = $tsAdmin->channelInfo($channels[0]);
  18. $client = $tsAdmin->clientGetIds($users[0]);
  19. $cldbid = $tsAdmin->clientGetDbIdFromUid($users[0]);
  20. $channelInfo3 = $tsAdmin->channelInfo($channels[1]);
  21. $cldbid3 = $tsAdmin->clientGetDbIdFromUid($users[1]);
  22. $client3 = $tsAdmin->clientGetIds($users[1]);
  23. $channelInfo2 = $tsAdmin->channelInfo($channels[2]);
  24. $cldbid2 = $tsAdmin->clientGetDbIdFromUid($users[2]);
  25. $client2 = $tsAdmin->clientGetIds($users[2]);
  26. $cldbid = $cldbid['data']['cldbid'];
  27. $cldbidx = $tsAdmin->clientGetNameFromDbid($cldbid);
  28.  
  29. //--------------------------------------------------------------
  30.  
  31. $cldbid3 = $cldbid3['data']['cldbid'];
  32. $cldbidx3 = $tsAdmin->clientGetNameFromDbid($cldbid3);
  33. if($client3['data']==null)
  34. {
  35. $status3 = "OFF";
  36. }else{
  37. foreach($client3['data'] as $clients3)
  38. @$clid3 = $clients3['clid'];
  39. $clientinfo3 = $tsAdmin->clientInfo($clid3);
  40. if($clientinfo3['data']['client_away']){
  41. $status3 = "AFK";
  42. }else{
  43. if($clientinfo3['data']['connection_bytes_sent_total'] == 0){
  44. $status3 = "OFF";
  45. }else{
  46. $status3 = "ON";
  47. }
  48. }
  49. }
  50.  
  51. $channelEdit3 = $tsAdmin->channelEdit($channels[1], array('channel_name' => "{".$status3."}".' [Admin] '."Pacjent"));
  52. //--------------------------------------------------------------
  53.  
  54.  
  55. $cldbid2 = $cldbid2['data']['cldbid'];
  56. $cldbidx2 = $tsAdmin->clientGetNameFromDbid($cldbid2);
  57. if($client2['data']==null)
  58. {
  59. $status2 = "OFF";
  60. }else{
  61. foreach($client2['data'] as $clients2)
  62. @$clid2 = $clients2['clid'];
  63. $clientinfo2 = $tsAdmin->clientInfo($clid2);
  64. if($clientinfo2['data']['client_away']){
  65. $status2 = "AFK";
  66. }else{
  67. if($clientinfo2['data']['connection_bytes_sent_total'] == 0){
  68. $status2 = "OFF";
  69. }else{
  70. $status2 = "ON";
  71. }
  72. }
  73. }
  74.  
  75. $channelEdit2 = $tsAdmin->channelEdit($channels[2], array('channel_name' => "{".$status2."}".' [Mod] '."Maciejos"));
  76. //--------------------------------------------------------------
  77. if($client['data']==null)
  78. {
  79. $status = "OFF";
  80. }else{
  81. foreach($client['data'] as $clients)
  82. $clid = $clients['clid'];
  83. @$clientinfo = $tsAdmin->clientInfo($clid);
  84. if($clientinfo['data']['client_away']){
  85. $status = "AFK";
  86. }else{
  87. if($clientinfo['data']['connection_bytes_sent_total'] == 0){
  88.  
  89. }else{
  90. $status = "ON";
  91. }
  92. }
  93. }
  94. $channelEdit = $tsAdmin->channelEdit($channels[0], array('channel_name' => "{".$status."}".' [Query] '."Klitek"));
  95. //----------------------------POKE-------------------------------------
  96.  
  97. }
  98. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement