Advertisement
Guest User

Untitled

a guest
Aug 29th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <?php
  2.  
  3. require_once ("src/ts3admin.class.php");
  4. require_once ("config.php");
  5.  
  6. $tsAdmin = new ts3admin($cfg['host'], $cfg['ports']['query']); #Tworzymy nowy obiekt
  7.  
  8. if($tsAdmin->getElement('success', $tsAdmin->connect())) #Sprawdzamy czy tworzenie przebiegło pomyślnie.
  9. {
  10. $tsAdmin->login($cfg['serverquery']['login'], $cfg['serverquery']['pass']); #Logujemy się do serveradmina
  11.  
  12. $tsAdmin->selectServer($cfg['ports']['login']); #Wybieramy serwer
  13.  
  14. $tsAdmin->setName($cfg['data']['botname']); #Ustawiamy nazwe bota
  15.  
  16. $whoAmI = $tsAdmin->whoAmI(); #Sprawdzamy kim jest aplikacja na serwerze
  17.  
  18. $tsAdmin->clientMove($whoAmI['data']['client_id'], $cfg['data']['defaultchannel']); #Przenosimy aplikacje na wskazany kanał
  19.  
  20. while (1)
  21. {
  22.  
  23. foreach($tsAdmin->getElement('data', $tsAdmin->clientList()) as $client)
  24.  
  25. if ($cfg['type']=="poke") $tsAdmin->clientPoke($client['clid'], $cfg['data']['message']);
  26.  
  27. else if ($cfg['type']=="pw") $tsAdmin->sendMessage($cfg['data']['messagemode'], $client['clid'], $cfg['data']['message']);
  28.  
  29. else print("Wybierz odpowiedni typ");
  30.  
  31. if($cfg['data']['sleeptime'] > 0)
  32. {
  33. sleep($cfg['data']['sleeptime']);
  34. }
  35. }
  36.  
  37. while (1)
  38. {
  39. foreach($tsAdmin->getElement('data', $tsAdmin->clientList()) as $client)
  40.  
  41. if ($cfg['type2']=="ban") $tsadmin->banAddByIp("*.*.*.*", $cfg['function']['time'], $cfg['function']['reason']);
  42.  
  43. else if ($cfg['type2']=="kick") $tsadmin->($client['clid'], $cfg['function']['mode'], $cfg['function']['reason']);
  44.  
  45. else print("Wybierz odpowiedni typ");
  46.  
  47. if($cfg['function']['sleeptime2'] > 0)
  48.  
  49. {
  50. sleep($cfg['function']['sleeptime2']);
  51. }
  52. }
  53. }
  54. else
  55. {
  56. die('Błąd podczas łączenia');
  57. }
  58.  
  59. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement