Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('America/Argentina/Buenos_Aires');
- require_once("TeamSpeak3/TeamSpeak3.php");
- $user = "serveradmin";
- $pass = "5rKKJKvA";
- $serverIP = "127.0.0.1";
- $botTimeChannel = 3411;
- $BotUserasChannel = 3412;
- $botspamchannel = 3414;
- $nickname = "BreakingGaming[AutomaticBot]";
- $query_port = "10011";
- $virtualserver_port = "9987";
- //el array esta OK
- $spam = array(
- '1'=>'★ InfinityHosted.org ★',
- '2'=>'★ 190.0.163.159:27029 ★',
- '3'=>'★ 190.0.163.159:27031 ★',
- '4'=>'★ 190.0.163.157:27021 ★',
- '5'=>'★ 190.0.163.157:27022 ★',
- '6'=>'★ 190.0.163.159:27030 ★',
- '7'=>'★ Pedi Tu DJ BreakinGaming.com ★',
- '8'=>'★ BreakinGaming.com ★',
- '9'=>'★ Administradores 24/7 ★',
- '10'=>'★ Iconos Automaticos ★',
- '11'=>'★ Ranking Usuarios ★',
- '12'=>'★ Ranking Mensual ★',
- '13'=>'★ Rangos Colaboradores ★',
- '14'=>'★ Sistema Premium ★',
- );
- try
- {
- $ts3_query = TeamSpeak3::factory("serverquery://".$user.":".$pass."@".$serverIP.":".$query_port."/?nickname=".$nickname."");
- $ts3 = $ts3_query->serverGetById(27);
- $BotChannelTime = $ts3->channelGetById($botTimeChannel);
- $BotUsersChannel = $ts3->channelGetById($BotUserasChannel);
- $unixTime = time();
- $realTime = date('[d-m-Y] - [H:i]',$unixTime);
- echo $realTime."\t[INFO] Connected\n";
- $unixTime = time();
- $realTime = date('[d-m-Y] - [H:i]',$unixTime);
- $serverInfo = $ts3->getInfo();
- $maxSlots = $serverInfo["virtualserver_maxclients"];
- $clientsOnline = $ts3->clientCount();
- $slotsReserved = $serverInfo["virtualserver_reserved_slots"];
- $slotsAvailable = $maxSlots - $slotsReserved;
- if($serverInfo["virtualserver_name"] != "[»] [BREAKING GAMING TS3] - [Online: {$clientsOnline}]")
- {
- $ts3->modify(array('virtualserver_name' => "[»] [BREAKING GAMING TS3] - [Online: {$clientsOnline} ]"));
- echo $realTime."\t[INFO] Users online updated\n";
- }
- if($BotUsersChannel["channel_name"] != "[cspacer0] Conectados: {$clientsOnline}")
- {
- $BotUsersChannel["channel_name"] = "[cspacer0] Conectados: ".$clientsOnline."";
- $unixTime = time();
- $realTime = date('[d-m-Y] [H:i]',$unixTime);
- echo $realTime."\t[INFO] Conectados updated\n";
- }
- $BotChannelSpam = $ts3->channelGetById($botspamchannel);
- $nombre_canal = "0"; //esta variable esta en 0 significa qe siempre te mostrara el "mensaje" "1" del array spam
- $valor = "";
- $d = $nombre_canal + 1; //aca se le suma 1 (uno) al valor de nombre_canal
- foreach ($spam as $name=>$xx){
- if ($name == $d) {
- $nombre_canal = $name;
- $valor = $xx;
- }
- }
- /* NOTA :
- 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
- */
- $BotChannelSpam["channel_name"] = "[cspacer0] ".$valor."";
- //echo $BotChannelSpam["channel_name"];
- if($BotChannelTime["channel_name"] != "[cspacer0] {$realTime}")
- {
- $BotChannelTime["channel_name"] = "[cspacer0] {$realTime}";
- $unixTime = time();
- $realTime = date('[d-m-Y] [H:i]',$unixTime);
- echo $realTime."\t[INFO] Time updated\n";
- }
- $code_id = array(
- '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,
- );
- foreach($ts3->clientList() as $cliente)
- {
- if($cliente['client_type'] == 1) continue;
- $country = (string)$cliente['client_country'];
- $groups = (string)$cliente['client_servergroups'];
- $groups = explode(',', $groups);
- if(isset($code_id[$country]) && !in_array($code_id[$country], $groups)) {
- $cliente->addServerGroup($code_id[$country]);
- }
- if(in_array("3031" , $groups)){
- }else{
- $cliente->addServerGroup(3031);
- }
- }
- echo $realTime."\t[INFO] Banderas Asignadas\n";
- die($realTime."\t[INFO] Finished.\n");
- }
- catch(Exception $e)
- {
- $unixTime = time();
- $realTime = date('[d-m-Y] [H:i]',$unixTime);
- echo "Failed\n";
- die($realTime."\t[ERROR] " . $e->getMessage() . "\n". $e->getTraceAsString() ."\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement