elninocrazy
Member
- Aug 16, 2016
- 3
- 0
- 36
hey guys, hope ya fine
im having a little issue with teamspeak php framework
i think the issue is when the script tries to update the client list
the connection instance is located before the while cicle
what i wanted to do is create a alive bot which has a job to add guests users to another group.
it does add to the group when the bot is launched but if i remove the server group it doesn't work in the next re-check
could you take a look please?
im having a little issue with teamspeak php framework
i think the issue is when the script tries to update the client list
Code:
while (1) {
$Date = date('Y-m-d H:i:s');
try {
foreach ($TeamSpeakConnection->clientList() as $client) {
if ($client["client_type"])
continue;
$groups = explode(',', (string) $client->client_servergroups);
if (!in_array($TeamSpeak['MemberGroup'], $groups)) {
echo "[" . $Date . "] " . $TeamSpeak['QueyClientName'] . " " . $client['client_nickname'] . " has added to member\n";
$TeamSpeakConnection->serverGroupClientAdd($TeamSpeak['MemberGroup'], $client['client_database_id']);
}
}
sleep(5);
echo "[" . $Date . "] " . $TeamSpeak['QueyClientName'] . " is refreshing\n";
}
catch (Exception $e) {
$Date = date('Y-m-d H:i:s');
die("[" . $Date . "] " . $TeamSpeak['QueyClientName'] . " " . $e->getMessage() . "\n" . $e->getTraceAsString() . "\n");
}
}
the connection instance is located before the while cicle
what i wanted to do is create a alive bot which has a job to add guests users to another group.
it does add to the group when the bot is launched but if i remove the server group it doesn't work in the next re-check
could you take a look please?