B1uscr34m

Teamspeak TS 3 TS3 Plugin PHP Script - Clock as name script

Nov 14th, 2014
1,416
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------------------------------------------
  2. Installation Instructions:
  3. --------------------------------------------------------
  4. a) Download the php-binaries for your OS:
  5. a1) Windows x86 - http://windows.php.net/downloads/releases/php-5.6.3-nts-Win32-VC11-x86.zip
  6. a2) Windows x64 - http://windows.php.net/downloads/releases/php-5.6.3-nts-Win32-VC11-x64.zip
  7. b) Extract the downloaded zip file to the directory you want.
  8. c) Download this php script and save it as "ts3_nameclock.php" in your choosen directory.
  9. c1) Edit this script to what you want.
  10. d) Drag and drop "ts3_nameclock.php" onto "php.exe" and a console window will appear.
  11. e) Have fun and keep in mind that the script will only work in the actual used server tab.
  12.  
  13. <?php
  14. $name_min_length = "3";#default="3"
  15. $name_max_length = "50";#default="30"
  16. $clientquery_port = "25639";
  17. while (1) {
  18. $fp = fsockopen("localhost", $clientquery_port);
  19. $random_number = rand(100, 999999999999999999999999999999);
  20. $prefix = "!";
  21. $name = "TeamspeakUser";
  22. $day = date("l");
  23. $date = date("d.m.Y");
  24. $time = date("H:i");
  25. $pattern = "$prefix\s$day,\s$date\s$time\n";
  26. $length = strlen($pattern);
  27. if ($length < $name_min_length) {
  28.     echo "Name '".$pattern."' shorter then allowed! (".$length."/".$name_max_length.")";
  29.     fclose($fp);
  30.     sleep(5);
  31.     break;
  32. } elseif ($length > $name_max_length) {
  33.     echo "Name '".$pattern."' longer then allowed! (".$length."/".$name_max_length.")";
  34.     fclose($fp);
  35.     sleep(5);
  36.     break;
  37. } else {
  38.     #Befehl senden
  39.     fputs($fp,"clientupdate client_nickname=$pattern");
  40. }
  41. #Socket schliessen
  42. fclose($fp);
  43. echo "Changing name to '".$pattern."' (".$length."/".$name_max_length.")";
  44. echo " ";
  45. sleep(60); //X Seconds wait
  46. }
  47. ?>
RAW Paste Data