Advertisement
Guest User

Untitled

a guest
Jun 16th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. <?php
  2. //Created by Klitek
  3. $ts3_ip = '127.0.0.1';
  4. $ts3_queryport = 10011;
  5. $ts3_port = 9987;
  6. $ts3_user = 'serveradmin';
  7. $ts3_pass = 'ivoviix00';
  8. require("ts3admin.class.php");
  9. require("config.php");
  10. $ts3 = new ts3admin($ts3_ip, $ts3_queryport);
  11. if($ts3 -> getElement('success', $ts3 -> connect())) {
  12. $ts3 -> selectServer($ts3_port);
  13. $ts3 -> login($ts3_user, $ts3_pass);
  14.  
  15. $clientsID = array();
  16. $channelEdit = array();
  17. $data = array();
  18. $konwerter = array();
  19. $clientInfo = array();
  20. $lock = array();
  21. while(true == true){
  22. sleep($sleepTime);
  23. for($i = 0; $i < count($clients); ++$i){
  24. //Zdobywanie ID z grup
  25. $clientsID[$i] = $ts3 -> clientGetNameFromDbid($clients[$i]);
  26. //Pobieranie ID
  27. $konwerter[$i] = $ts3 -> clientGetIds($clientsID[$i]['data']['cluid']); //Malo wazne
  28. $IDs[$i] = $konwerter[$i]['data'][0]['clid'];
  29. //Pobieranie informacji o uzytkowniku
  30. $clientInfo[$i] = $ts3 -> clientInfo($IDs[$i]);
  31. //Info o kanale
  32. $channelInfo[$i] = $ts3 -> channelInfo($channels[$i]);
  33. //Info o grupach ! $groupList['data'][id]['name'] !
  34. //$groupList = $ts3 -> serverGroupList();
  35.  
  36. if($clientInfo[$i]['data']['connection_bandwidth_sent_last_second_total'] == 0) {
  37. //Nazwa kanalu == nick
  38. $data['channel_name'] = '[OFF] '.$clientsID[$i]['data']['name'];
  39. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
  40. if($unlock == true){
  41. if($channelInfo[$i]['data']['channel_maxclients'] == 666){
  42. $lock['channel_maxclients'] = 0;
  43. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
  44. }
  45. }
  46. }elseif($clientInfo[$i]['data']['client_away'] == 1)
  47. {
  48. $data['channel_name'] = '[AFK] '.$clientsID[$i]['data']['name'];
  49. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
  50. if($channelInfo[$i]['data']['channel_maxclients'] == 666){
  51. $lock['channel_maxclients'] = 0;
  52. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
  53. }
  54. }elseif($clientInfo[$i]['data']['client_away'] == 0){
  55. $data['channel_name'] = '[ON] '.$clientsID[$i]['data']['name'];
  56. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $data);
  57. if($unlock == true){
  58. if($channelInfo[$i]['data']['channel_maxclients'] == 0){
  59. $lock['channel_maxclients'] = 666;
  60. $channelEdit[$i] = $ts3 -> channelEdit($channels[$i], $lock);
  61. }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement