HEY MAN YOU NEED TO DOWNLOAD TeamSpeak 3 PHP Framework TO USE ITI can't use this script.Can u help me? could you provide some information about how i want to use?
nimda can do this. https://r4p3.net/threads/developement-nimdats3-a-real-modular-teamspeak-3-bot.2741/How can i let the bot execute something, if an user joins a specific channel (for example channel id 50)? Is there any way to do it? (there should be a way... for example jts3servermod is able to poke certain user, if someone connects to a channel)
thx for your help
he's not telling you to use nimda.. https://github.com/JABirchall/NimdaTS3 read the source code if you're interesed.I don't want to use nimba, i want an example as i wrote before...
thats why i linked nimda, its a bot framework to allow you to do commands simply like that.I don't want to use nimda, i want an example as i wrote before...
Yeah, but i just copied the ChannelGroupNotify plugin and changed it, so it fits into my code...thats why i linked nimda, its a bot framework to allow you to do commands simply like that.
heres an example/tutorial
PHP Parse error: syntax error, unexpected '"onWaitTimeout"' (T_CONSTANT_ENCAPSED_STRING) in /home/teamspeakbot/ChannelBot/commands.php on line 23
PHP Parse error: syntax error, unexpected ''serveradmin'' (T_CONSTANT_ENCAPSED_STRING) in /home/teamspeakbot/ChannelBot/standart.php on line 5
looks like you don't know how to code.I don't know what's wrong, but the whole bot is not working anymore...
After i run the file, this error comes up...
I reinstalled the whole library, but it still doesn't work... Now i ran the standart script, which hASVAN posted in here and it stopped working too, although it worked before...Code:PHP Parse error: syntax error, unexpected '"onWaitTimeout"' (T_CONSTANT_ENCAPSED_STRING) in /home/teamspeakbot/ChannelBot/commands.php on line 23
Code:PHP Parse error: syntax error, unexpected ''serveradmin'' (T_CONSTANT_ENCAPSED_STRING) in /home/teamspeakbot/ChannelBot/standart.php on line 5
Can someone help me please, i tried to fix this for hours -.-'
I may not be the best coder, but i know how to work with php... This is the second time use the teamspeak3 php Framework, so im new in this element...looks like you don't know how to code.
Yeah because reinstalling a server will magically fix your bad code. thats a new meta.I may not be the best coder, but i know how to work with php... This is the second time use the teamspeak3 php Framework, so im new in this element...
The script i wrote stopped working suddenly and after i couldn't find any errors i reinstalled another script (this one: https://r4p3.net/threads/script-create-your-own-commands-with-php.1982/), but i still get a similar error, although it worked for me 2 days ago...
I even reinstalled the whole server and changed from ubuntu to debian... I even switched to another server but i always get the same error... I don't know how this can be, cause the SAME script worked for me 2 days ago, as i mentioned
Don't you get it! It's not the fault of the code! I downloaded this script:Yeah because reinstalling a server will magically fix your bad code. thats a new meta.
<?php
require_once("TeamSpeak3/TeamSpeak3.php");
//--------INFO------------//
$login_name = 'serveradmin';
$login_password ='';
$ip = '127.0.0.1';
$query_port = '10011';
$virtualserver_port = '9987';
$bot_name = 'TS3hASVANBot';
$ts3helpchannel = "94";
//--------INFO------------//
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$login_name.":".$login_password."@".$ip.":".$query_port."/?server_port=".$virtualserver_port."&nickname=TEST&blocking=0");
$ts3botid = $ts3_VirtualServer->whoamiGet('client_id');
$ts3_VirtualServer->clientMove($ts3botid, $ts3helpchannel);
$arr_ClientList = $ts3_VirtualServer->clientList(array("client_platform" => "ServerQuery"));
foreach($arr_ClientList as $ts3_Client)
{
if($ts3_Client['client_nickname'] == $bot_name)
{
$ts3_VirtualServer->request("quit");
exit;
}
}
$ts3_VirtualServer->selfUpdate(array("client_nickname" => $bot_name));
TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onWaitTimeout");
TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "onTextMessage");
$ts3_VirtualServer->notifyRegister("server");
$ts3_VirtualServer->notifyRegister("channel");
$ts3_VirtualServer->notifyRegister("textserver");
$ts3_VirtualServer->notifyRegister("textchannel");
$ts3_VirtualServer->notifyRegister("textprivate");
while(1)
{
$ts3_VirtualServer->getAdapter()->wait();
}
function onWaitTimeout($time, TeamSpeak3_Adapter_Abstract $adapter)
{
if($adapter->getQueryLastTimestamp() < time()-300)
{
$adapter->request('clientupdate');
}
}
function onTextMessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host) {
$info = $event->getData();
$srv = $host->serverGetSelected();
if($info["targetmode"] == 2)
{
$mystring = $info["msg"];
$pos1 = strpos($mystring, " ");
if($pos1 > 0){
$var = substr($mystring, 0, $pos1);
}else{
$var = $mystring;
}
if($var == "!say"){
$srv->message("".str_replace('!say ', '', "[b][color=green]".$info["msg"]."[/color][/b]")."");
}elseif($var == "!kick"){
$client = str_replace('!kick ', '', $info["msg"]);
foreach($srv->clientList() as $ts3_Client)
{
if($client == $ts3_Client)
{
$srv->clientGetByName("".$client."")->kick(TeamSpeak3::KICK_SERVER, "");
}else{
$srv->clientGetByName($info["invokername"]->toString())->message("User Not found");
}
}
}else{
$srv->clientGetByName($info["invokername"]->toString())->message("Command Not found");
}
}
}
?>
SHORT UPDATE:Don't you get it! It's not the fault of the code! I downloaded this script:
and ran it and the same error appeared, although the script worked 2 days ago!PHP:<?php require_once("TeamSpeak3/TeamSpeak3.php"); //--------INFO------------// $login_name = 'serveradmin'; $login_password =''; $ip = '127.0.0.1'; $query_port = '10011'; $virtualserver_port = '9987'; $bot_name = 'TS3hASVANBot'; $ts3helpchannel = "94"; //--------INFO------------// $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$login_name.":".$login_password."@".$ip.":".$query_port."/?server_port=".$virtualserver_port."&nickname=TEST&blocking=0"); $ts3botid = $ts3_VirtualServer->whoamiGet('client_id'); $ts3_VirtualServer->clientMove($ts3botid, $ts3helpchannel); $arr_ClientList = $ts3_VirtualServer->clientList(array("client_platform" => "ServerQuery")); foreach($arr_ClientList as $ts3_Client) { if($ts3_Client['client_nickname'] == $bot_name) { $ts3_VirtualServer->request("quit"); exit; } } $ts3_VirtualServer->selfUpdate(array("client_nickname" => $bot_name)); TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onWaitTimeout"); TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "onTextMessage"); $ts3_VirtualServer->notifyRegister("server"); $ts3_VirtualServer->notifyRegister("channel"); $ts3_VirtualServer->notifyRegister("textserver"); $ts3_VirtualServer->notifyRegister("textchannel"); $ts3_VirtualServer->notifyRegister("textprivate"); while(1) { $ts3_VirtualServer->getAdapter()->wait(); } function onWaitTimeout($time, TeamSpeak3_Adapter_Abstract $adapter) { if($adapter->getQueryLastTimestamp() < time()-300) { $adapter->request('clientupdate'); } } function onTextMessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host) { $info = $event->getData(); $srv = $host->serverGetSelected(); if($info["targetmode"] == 2) { $mystring = $info["msg"]; $pos1 = strpos($mystring, " "); if($pos1 > 0){ $var = substr($mystring, 0, $pos1); }else{ $var = $mystring; } if($var == "!say"){ $srv->message("".str_replace('!say ', '', "[b][color=green]".$info["msg"]."[/color][/b]").""); }elseif($var == "!kick"){ $client = str_replace('!kick ', '', $info["msg"]); foreach($srv->clientList() as $ts3_Client) { if($client == $ts3_Client) { $srv->clientGetByName("".$client."")->kick(TeamSpeak3::KICK_SERVER, ""); }else{ $srv->clientGetByName($info["invokername"]->toString())->message("User Not found"); } } }else{ $srv->clientGetByName($info["invokername"]->toString())->message("Command Not found"); } } } ?>
Yes!can't right now but if you want i can tell you how to do it
Use case switch.Example:PHP:<?php require_once("TeamSpeak3/TeamSpeak3.php"); //--------INFO------------// $login_name = 'serveradmin'; $login_password =''; $ip = '127.0.0.1'; $query_port = '10011'; $virtualserver_port = '9987'; $bot_name = 'TS3hASVANBot'; $ts3helpchannel = "94"; //--------INFO------------// $ts3_VirtualServer = TeamSpeak3::factory("serverquery://".$login_name.":".$login_password."@".$ip.":".$query_port."/?server_port=".$virtualserver_port."&nickname=TEST&blocking=0"); $ts3botid = $ts3_VirtualServer->whoamiGet('client_id'); $ts3_VirtualServer->clientMove($ts3botid, $ts3helpchannel); $arr_ClientList = $ts3_VirtualServer->clientList(array("client_platform" => "ServerQuery")); foreach($arr_ClientList as $ts3_Client) { if($ts3_Client['client_nickname'] == $bot_name) { $ts3_VirtualServer->request("quit"); exit; } } $ts3_VirtualServer->selfUpdate(array("client_nickname" => $bot_name)); TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onWaitTimeout"); TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyTextmessage", "onTextMessage"); $ts3_VirtualServer->notifyRegister("server"); $ts3_VirtualServer->notifyRegister("channel"); $ts3_VirtualServer->notifyRegister("textserver"); $ts3_VirtualServer->notifyRegister("textchannel"); $ts3_VirtualServer->notifyRegister("textprivate"); while(1) { $ts3_VirtualServer->getAdapter()->wait(); } function onWaitTimeout($time, TeamSpeak3_Adapter_Abstract $adapter) { if($adapter->getQueryLastTimestamp() < time()-300) { $adapter->request('clientupdate'); } } function onTextMessage(TeamSpeak3_Adapter_ServerQuery_Event $event, TeamSpeak3_Node_Host $host) { $info = $event->getData(); $srv = $host->serverGetSelected(); if($info["targetmode"] == 2) { $mystring = $info["msg"]; $pos1 = strpos($mystring, " "); if($pos1 > 0){ $var = substr($mystring, 0, $pos1); }else{ $var = $mystring; } if($var == "!say"){ $srv->message("".str_replace('!say ', '', "[b][color=green]".$info["msg"]."[/color][/b]").""); }elseif($var == "!kick"){ $client = str_replace('!kick ', '', $info["msg"]); foreach($srv->clientList() as $ts3_Client) { if($client == $ts3_Client) { $srv->clientGetByName("".$client."")->kick(TeamSpeak3::KICK_SERVER, ""); }else{ $srv->clientGetByName($info["invokername"]->toString())->message("User Not found"); } } }else{ $srv->clientGetByName($info["invokername"]->toString())->message("Command Not found"); } } } ?>