Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once ("src/ts3admin.class.php");
- require_once ("config.php");
- $tsAdmin = new ts3admin($cfg['host'], $cfg['ports']['query']); #Tworzymy nowy obiekt
- if($tsAdmin->getElement('success', $tsAdmin->connect())) #Sprawdzamy czy tworzenie przebiegło pomyślnie.
- {
- $tsAdmin->login($cfg['serverquery']['login'], $cfg['serverquery']['pass']); #Logujemy się do serveradmina
- $tsAdmin->selectServer($cfg['ports']['login']); #Wybieramy serwer
- $tsAdmin->setName($cfg['data']['botname']); #Ustawiamy nazwe bota
- $whoAmI = $tsAdmin->whoAmI(); #Sprawdzamy kim jest aplikacja na serwerze
- $tsAdmin->clientMove($whoAmI['data']['client_id'], $cfg['data']['defaultchannel']); #Przenosimy aplikacje na wskazany kanał
- while (1)
- {
- foreach($tsAdmin->getElement('data', $tsAdmin->clientList()) as $client)
- if ($cfg['type']=="poke") $tsAdmin->clientPoke($client['clid'], $cfg['data']['message']);
- else if ($cfg['type']=="pw") $tsAdmin->sendMessage($cfg['data']['messagemode'], $client['clid'], $cfg['data']['message']);
- else print("Wybierz odpowiedni typ");
- if($cfg['data']['sleeptime'] > 0)
- {
- sleep($cfg['data']['sleeptime']);
- }
- }
- while (1)
- {
- foreach($tsAdmin->getElement('data', $tsAdmin->clientList()) as $client)
- if ($cfg['type2']=="ban") $tsadmin->banAddByIp("*.*.*.*", $cfg['function']['time'], $cfg['function']['reason']);
- else if ($cfg['type2']=="kick") $tsadmin->($client['clid'], $cfg['function']['mode'], $cfg['function']['reason']);
- else print("Wybierz odpowiedni typ");
- if($cfg['function']['sleeptime2'] > 0)
- {
- sleep($cfg['function']['sleeptime2']);
- }
- }
- }
- else
- {
- die('Błąd podczas łączenia');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement