Question Bot Still In The Server [PHP FrameWork]

Yousef

New Member
Joined
Nov 16, 2017
Messages
8
Points
16
Age
19
Hello Users ,

I Wanna To Create S Bot Still In The Server 24H and didn't time out from the server With PHP Framework [Planet]

i Try To Make it but it time out after 6 hours or 3 hours or 5 minuts

Thanks
 

FromLondon

Honk Honk
VIP
Joined
May 20, 2016
Messages
205
Points
78
Age
24
Location
Russia
Hi
I think your bot in some moment has been disconnected due to timeout.
You need to send keep-alive commands (version or smth else. Doesn't matter really). Default timeout is 600 seconds (if i not mistake, or 300)
 

kalle

high minded
VIP
Contributor
Joined
Oct 28, 2015
Messages
361
Points
118
Location
Bosnia and Herzegovina
Hi
I think your bot in some moment has been disconnected due to timeout.
You need to send keep-alive commands (version or smth else. Doesn't matter really). Default timeout is 600 seconds (if i not mistake, or 300)
Put 250 trust me. I had an problem with this and someone told me to put 250 and it worked lmao.
Edit: yes I remember now, @ewenjo helped me with this info. :D
 
Last edited:

Yousef

New Member
Joined
Nov 16, 2017
Messages
8
Points
16
Age
19
Put 250 trust me. I had an problem with this and someone told me to put 250 and it worked lmao.
Edit: yes I remember now, @ewenjo helped me with this info. :D

Yes He Helped Me But Where Can I Put My PHP Commands
 

Yousef

New Member
Joined
Nov 16, 2017
Messages
8
Points
16
Age
19
Be more specific, or post some code example.
this is my code example i wanna this bot poke user every 10 sec. i know how to do it but i don't know where can i put it
PHP:
<?php
require_once("assets/config.php");
require_once("libraries/TeamSpeak3/TeamSpeak3.php");
?>
 
<?php
/* load framework library */

/* initialize */
TeamSpeak3::init();

try
{
  /* subscribe to various events */
  TeamSpeak3_Helper_Signal::getInstance()->subscribe("notifyServerselected", "onSelect");

  /* connect to server, login and get TeamSpeak3_Node_Host object by URI */
   $ts3 = TeamSpeak3::factory("serverquery://".$YATQA_user.":".$YATQA_pass."@".$YATQA_ip.":".$query_port."/?server_port=9987&blocking=0&nickname=[AM]LevelBoost");

  /* wait for events */
  while(1) {
      $ts3->getAdapter()->wait();
// Here I Wanna To Add My Code But If I Add it no thing done
     
  }
}
catch(Exception $e)
{
  die("[ERROR]  " . $e->getMessage() . "\n");
}



function onTimeout($seconds, TeamSpeak3_Adapter_ServerQuery $adapter)
{
echo "[INFO]\tno reply from the server for " . $seconds . " seconds\n";
  if($adapter->getQueryLastTimestamp() < time()-250)
  {
    $adapter->request("clientupdate");
  }
}

function onSelect(TeamSpeak3_Node_Host $host)
{
  TeamSpeak3_Helper_Signal::getInstance()->subscribe("serverqueryWaitTimeout", "onTimeout");

  $host->serverGetSelected()->notifyRegister("server");
  echo "Connected to: " . $host->serverGetSelected()->getProperty("virtualserver_name") . "\n\n";

}

?>
 

Top