Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. date_default_timezone_set('America/Argentina/Buenos_Aires');
  3. require_once("TeamSpeak3/TeamSpeak3.php");
  4.  
  5.  
  6. $user = "serveradmin";
  7. $pass = "5rKKJKvA";
  8. $serverIP = "127.0.0.1";
  9. $botTimeChannel = 3411;
  10. $BotUserasChannel = 3412;
  11. $botspamchannel = 3414;
  12. $nickname = "BreakingGaming[AutomaticBot]";
  13. $query_port = "10011";
  14. $virtualserver_port = "9987";
  15.  
  16. //el array esta OK
  17. $spam = array(
  18.  
  19. '1'=>'★ InfinityHosted.org ★',
  20. '2'=>'★ 190.0.163.159:27029 ★',
  21. '3'=>'★ 190.0.163.159:27031 ★',
  22. '4'=>'★ 190.0.163.157:27021 ★',
  23. '5'=>'★ 190.0.163.157:27022 ★',
  24. '6'=>'★ 190.0.163.159:27030 ★',
  25. '7'=>'★ Pedi Tu DJ BreakinGaming.com ★',
  26. '8'=>'★ BreakinGaming.com ★',
  27. '9'=>'★ Administradores 24/7 ★',
  28. '10'=>'★ Iconos Automaticos ★',
  29. '11'=>'★ Ranking Usuarios ★',
  30. '12'=>'★ Ranking Mensual ★',
  31. '13'=>'★ Rangos Colaboradores ★',
  32. '14'=>'★ Sistema Premium ★',
  33.  
  34. );
  35.  
  36. try
  37. {
  38.  
  39. $ts3_query = TeamSpeak3::factory("serverquery://".$user.":".$pass."@".$serverIP.":".$query_port."/?nickname=".$nickname."");
  40. $ts3 = $ts3_query->serverGetById(27);
  41.  
  42. $BotChannelTime = $ts3->channelGetById($botTimeChannel);
  43. $BotUsersChannel = $ts3->channelGetById($BotUserasChannel);
  44.  
  45. $unixTime = time();
  46. $realTime = date('[d-m-Y] - [H:i]',$unixTime);
  47. echo $realTime."\t[INFO] Connected\n";
  48.  
  49. $unixTime = time();
  50. $realTime = date('[d-m-Y] - [H:i]',$unixTime);
  51.  
  52. $serverInfo = $ts3->getInfo();
  53. $maxSlots = $serverInfo["virtualserver_maxclients"];
  54. $clientsOnline = $ts3->clientCount();
  55. $slotsReserved = $serverInfo["virtualserver_reserved_slots"];
  56. $slotsAvailable = $maxSlots - $slotsReserved;
  57.  
  58. if($serverInfo["virtualserver_name"] != "[»] [BREAKING GAMING TS3] - [Online: {$clientsOnline}]")
  59. {
  60. $ts3->modify(array('virtualserver_name' => "[»] [BREAKING GAMING TS3] - [Online: {$clientsOnline} ]"));
  61. echo $realTime."\t[INFO] Users online updated\n";
  62. }
  63.  
  64. if($BotUsersChannel["channel_name"] != "[cspacer0] Conectados: {$clientsOnline}")
  65. {
  66. $BotUsersChannel["channel_name"] = "[cspacer0] Conectados: ".$clientsOnline."";
  67. $unixTime = time();
  68. $realTime = date('[d-m-Y] [H:i]',$unixTime);
  69. echo $realTime."\t[INFO] Conectados updated\n";
  70. }
  71.  
  72. $BotChannelSpam = $ts3->channelGetById($botspamchannel);
  73.  
  74. $nombre_canal = "0"; //esta variable esta en 0 significa qe siempre te mostrara el "mensaje" "1" del array spam
  75. $valor = "";
  76. $d = $nombre_canal + 1; //aca se le suma 1 (uno) al valor de nombre_canal
  77. foreach ($spam as $name=>$xx){
  78. if ($name == $d) {
  79. $nombre_canal = $name;
  80. $valor = $xx;
  81. }
  82. }
  83.  
  84. /* NOTA :
  85. Para que el codigo qe te pase funque necesitas guardar el valor de $nombre_canal en algun lado quizás puedas en algun array noc si podes en alguno qe te tire el ts , para luego "consultarlo" y ponérselo como valor ala variable $nombre_canal , de esa manera los "mensajes" son dinámicos y se va pasando al siguiente en cada ejecución del codigo
  86. */
  87.  
  88.  
  89. $BotChannelSpam["channel_name"] = "[cspacer0] ".$valor."";
  90.  
  91. //echo $BotChannelSpam["channel_name"];
  92.  
  93. if($BotChannelTime["channel_name"] != "[cspacer0] {$realTime}")
  94. {
  95. $BotChannelTime["channel_name"] = "[cspacer0] {$realTime}";
  96. $unixTime = time();
  97. $realTime = date('[d-m-Y] [H:i]',$unixTime);
  98. echo $realTime."\t[INFO] Time updated\n";
  99. }
  100.  
  101.  
  102. $code_id = array(
  103. 'AR' => 3174,'PY' => 3205 ,'CL' => 3176,'UY' => 3179,'PE' => 3182,'CA' => 3177,'US' => 3183,'ES' => 3178,'EC' => 3185,'BO' => 3189,'BR' => 3175,'BO' => 2862,'DE' => 3206,'MX' => 3181,'PT' => 3186,'VE' => 3190,'IT' => 3184,'CO' => 3180,
  104.  
  105. );
  106.  
  107. foreach($ts3->clientList() as $cliente)
  108. {
  109. if($cliente['client_type'] == 1) continue;
  110.  
  111. $country = (string)$cliente['client_country'];
  112. $groups = (string)$cliente['client_servergroups'];
  113. $groups = explode(',', $groups);
  114.  
  115. if(isset($code_id[$country]) && !in_array($code_id[$country], $groups)) {
  116. $cliente->addServerGroup($code_id[$country]);
  117. }
  118.  
  119. if(in_array("3031" , $groups)){
  120.  
  121. }else{
  122. $cliente->addServerGroup(3031);
  123. }
  124. }
  125.  
  126. echo $realTime."\t[INFO] Banderas Asignadas\n";
  127.  
  128. die($realTime."\t[INFO] Finished.\n");
  129. }
  130. catch(Exception $e)
  131. {
  132. $unixTime = time();
  133. $realTime = date('[d-m-Y] [H:i]',$unixTime);
  134. echo "Failed\n";
  135. die($realTime."\t[ERROR] " . $e->getMessage() . "\n". $e->getTraceAsString() ."\n");
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement