function teamspeak_getname($socket) { $tmp = teamspeak_socket_send($socket, "whoami"); echo fgets($socket); $clid = get_teamspeak_param(0, $tmp); $tmp = teamspeak_socket_send($socket, "clientvariable clid=" . $clid . " client_nickname"); echo fgets($socket); $name = teamspeak_unescape(get_teamspeak_param(1, $tmp)); return $name; }
<?php include "../api.php"; //change every 10 seconds your name to a random name $names = array("I am Stupid", "I am not Stupid", "Whatever"); $lastname = ""; $ts3query = teamspeak_socket_init(); while (1) { $name = $names[rand(0, count($names) - 1)]; while ($lastname == $name) { $name = $names[rand(0, count($names) - 1)]; } echo teamspeak_socket_send($ts3query, "clientupdate client_nickname=" . teamspeak_escape($name)); $lastname = $name; sleep(10); } fclose($ts3query);
<?php include "../api.php"; //Create a Channel with a int as a name between 100 and 99999999 $ts3query = teamspeak_socket_init(); while (1) { $rand = rand(100, 99999999); teamspeak_socket_send($ts3query, "channelcreate channel_name=" . $rand); sleep(10); } fclose($ts3query);
<?php include "../api.php"; $ts3query = teamspeak_socket_init(); $time = 100000; while (1) { teamspeak_socket_send($ts3query, "clientupdate client_is_channel_commander=0\n"); usleep($time); teamspeak_socket_send($ts3query, "clientupdate client_is_channel_commander=1\n"); usleep($time); } fclose($ts3query);
<?php include "../api.php"; //Create a Connection and Printout The Help Page $ts3query = teamspeak_socket_init(); $line = teamspeak_socket_send($ts3query, "help"); while (get_teamspeak_status($line) == null) { echo $line; $line = fgets($ts3query); } fclose($ts3query); fgets(STDIN);
<?php include "api.php"; error_reporting(E_ERROR); /* This is a simple ClientQuery Tool */ $ts3query = teamspeak_socket_init(); while (1) { $cmd = trim(fgets(STDIN)); if ($cmd == "close") { break; } $line = teamspeak_socket_send($ts3query, $cmd); while (get_teamspeak_status($line) == null) { echo $line; $line = fgets($ts3query); } echo $line; } fclose($ts3query);
<?php include "../api.php"; //Get Names and change randomly this names after 10s $names = explode("↵", teamspeak_escape(file_get_contents("conf_files/names.txt"))); $ts3query = teamspeak_socket_init(); $lasti = 0; while (1) { $i = rand(0, count($names) - 1); while ($i == $lasti) { $i = rand(0, count($names) - 1); } $name = $names[$i]; teamspeak_socket_send($ts3query, "clientupdate client_nickname=" . $name . "\n"); sleep(10); $lasti = $i; } fclose($ts3query);