BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Enian on October 17, 2005, 05:45:18 pm

Title: Error with AOChat Line 156
Post by: Enian on October 17, 2005, 05:45:18 pm
Hi

I have an error Line 156 with AOchat when i try to launch the bot.

It says :

Warning: socket_create() expects parameter 3 to be long, string given in D:\bebo
t\AOChat.php on line 156
Could not create socket.


Can someone know what i have to do ?
Title: Error with AOChat Line 156
Post by: Xenixa on October 17, 2005, 06:29:57 pm
That would be the start of Function Connect()

Does it look like this??:
Code: [Select]
   function connect($server = "chat2.d1.funcom.com", $port = 7012)
    {
      if($this->state !== "connect")
        die("AOChat: not expecting connect.\n");

      $s = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
      if(!is_resource($s)) /* this is fatal */
        die("Could not create socket.\n");

      $this->socket = $s;
      $this->state = "auth";

      if(@socket_connect($s, $server, $port) === false)
      {
        trigger_error("Could not connect to the AO Chat server ($server:$port): ".
          socket_strerror(socket_last_error($s)), E_USER_WARNING);
        $this->disconnect();
        return false;
      }

      $packet = $this->get_packet();
      if(!is_object($packet) || $packet->type != AOCP_LOGIN_SEED)
      {
        trigger_error("Received invalid greeting packet from AO Chat server.", E_USER_WARNING);
        $this->disconnect();
        return false;
      }

      $this->tellqueue = new AOChatQueue(&$this, 'dispatch_tell', AOC_FLOOD_LIMIT, AOC_FLOOD_INC);

      return $s;
    }


Compare that to what you have. That should work unless you have bad login info in the .conf file. Check user name and password, they are case sensitive.
Title: Error with AOChat Line 156
Post by: Enian on October 17, 2005, 07:00:12 pm
the code is exactly the same as what you posted. I checked again usernam and password but i do'nt think its that because the bot can't even connect, saying socket can't be created.

I don't understand that error  :(

Do i miss a lib or something ?
Title: Error with AOChat Line 156
Post by: Enian on October 17, 2005, 07:09:21 pm
Ok nevermind, i found the problem.
It was about connexion protocol.

with the line $s = socket_create(AF_INET, SOCK_STREAM, 0); its working

thank you for answering anyway :D
Title: Error with AOChat Line 156
Post by: Xenixa on October 17, 2005, 07:16:25 pm
No problem :)
SimplePortal 2.3.7 © 2008-2025, SimplePortal