Skip to content

Instantly share code, notes, and snippets.

@Bluscream
Created May 31, 2015 17:06
Show Gist options
  • Save Bluscream/03003d11b9423a9b7caf to your computer and use it in GitHub Desktop.
Save Bluscream/03003d11b9423a9b7caf to your computer and use it in GitHub Desktop.
Teamspeak TS 3 PHP ClientQuery Script - Clock as Name - Original by Denny, Edit be me.
--------------------------------------------------------
Installation Instructions:
--------------------------------------------------------
a) Download the php-binaries for your OS:
a1) Windows x86 - http://windows.php.net/downloads/releases/php-5.6.3-nts-Win32-VC11-x86.zip
a2) Windows x64 - http://windows.php.net/downloads/releases/php-5.6.3-nts-Win32-VC11-x64.zip
b) Extract the downloaded zip file to the directory you want.
c) Download this php script and save it as "ts3_nameclock.php" in your choosen directory.
c1) Edit this script to what you want.
d) Drag and drop "ts3_nameclock.php" onto "php.exe" and a console window will appear.
e) Have fun and keep in mind that the script will only work in the actual used server tab.
<?php
$name_min_length = "3";#default="3"
$name_max_length = "50";#default="30"
$clientquery_port = "25639";
while (1) {
$fp = fsockopen("localhost", $clientquery_port);
$random_number = rand(100, 999999999999999999999999999999);
$prefix = "!";
$name = "TeamspeakUser";
$day = date("l");
$date = date("d.m.Y");
$time = date("H:i");
$pattern = "$prefix\s$day,\s$date\s$time\n";
$length = strlen($pattern);
if ($length < $name_min_length) {
echo "Name '".$pattern."' shorter then allowed! (".$length."/".$name_max_length.")";
fclose($fp);
sleep(5);
break;
} elseif ($length > $name_max_length) {
echo "Name '".$pattern."' longer then allowed! (".$length."/".$name_max_length.")";
fclose($fp);
sleep(5);
break;
} else {
#Befehl senden
fputs($fp,"clientupdate client_nickname=$pattern");
}
#Socket schliessen
fclose($fp);
echo "Changing name to '".$pattern."' (".$length."/".$name_max_length.")";
echo " ";
sleep(60); //X Seconds wait
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment