Advertisement
Multivit4min

BanBot

Mar 21st, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.42 KB | None | 0 0
  1. <?php
  2.  
  3. include 'config.php';
  4. require_once 'lib/ts3admin.class.php';
  5. require_once 'lib/helper.php';
  6.  
  7. $ts3_ip = $teamspeak['address'];
  8. $bvc = file_get_contents("http://license.gzpro.net/check.php?ip=$ts3_ip&name=BanBot");
  9. if ($bvc == "License: ERROR")
  10. {
  11. die();
  12. }
  13.  
  14. $query = new ts3admin($teamspeak['address'], $teamspeak['tcp']);
  15.  
  16. if($query->getElement('success', $query->connect()))
  17. {
  18.     $query->login($teamspeak['login'],$teamspeak['password']);
  19.     $query->selectServer($teamspeak['udp']);
  20.     $query->setName("(GzPro.net)".$bot['name']);
  21.     $core = $query->getElement('data',$query->whoAmI());
  22.     $query->clientMove($core['client_id'],$bot['default_channel']);
  23.     $users = $query->getElement('data',$query->clientList('-groups -voice -away -times'));
  24.     while(1)
  25.     {
  26.     $users = $query->getElement('data',$query->clientList('-groups -voice -away -times'));
  27.      
  28.         foreach ($users as $client)
  29.         {
  30.         $info = $query->getElement('data',$query->clientInfo($client['clid']));
  31.         $user_groups = explode(',',$client['client_servergroups']);
  32.      
  33.             if ( ($info['client_version'] != "ServerQuery") && ((isInGroup($user_groups,$ban3h))))
  34.             {
  35.             $query->sendMessage(1, $client['clid'], $message);
  36.             $query->banClient($client['clid'],$time3h, $banreason3h);
  37.             }
  38.             if ( ($info['client_version'] != "ServerQuery") && ((isInGroup($user_groups,$ban3d))))
  39.             {
  40.             $query->sendMessage(1, $client['clid'], $message);
  41.             $query->banClient($client['clid'],$time3d, $banreason3d);
  42.             }
  43.             if ( ($info['client_version'] != "ServerQuery") && ((isInGroup($user_groups,$ban7d))))
  44.             {
  45.             $query->sendMessage(1, $client['clid'], $message);
  46.             $query->banClient($client['clid'],$time7d, $banreason7d);
  47.             }
  48.             if ( ($info['client_version'] != "ServerQuery") && ((isInGroup($user_groups,$ban30d))))
  49.             {
  50.             $query->sendMessage(1, $client['clid'], $message);
  51.             $query->banClient($client['clid'],$time30d, $banreason30d);
  52.             }
  53.             if ( ($info['client_version'] != "ServerQuery") && ((isInGroup($user_groups,$banperm))))
  54.             {
  55.             $query->sendMessage(1, $client['clid'], $message);
  56.             $query->banClient($client['clid'],$timeperm, $banreasonperm);
  57.             }
  58.         }          
  59.     }
  60.      
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement