Archive > BeBot 0.4 support
Call to a member function connect() on a non-object
exxie:
hey guys!
i just rebooted my rootserver and right after that I restarted my bebot but it crashloops with this error message:
Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 237
it worked just fine a few minutes ago!
I did not add any modules, modified anything or changed anything else! i just rebooted the server!
why do i get this error message now? :-/
any help would be greatly appreciated!
Alreadythere:
Some module you are using is registering for connect, but doesn't offer a connect() function.
Search for $commands["connect"][] at the top of your modules, if it's there make sure there is a function connect defined.
exxie:
yeah, I read about that hint in another thread.
I searched every file for $commands["connect"] and every single one has a function connect() in it :-(
every module is loading properly, the error message pops up when the bot is authenticating:
--- Code: ---Cratcom [2008-11-14 21:50:27] [LOGIN] [STATUS] Connecting
Cratcom [2008-11-14 21:50:27] [LOGIN] [STATUS] Authenticating
Cratcom [2008-11-14 21:50:30] [LOGIN] [STATUS] Logging in
Cratcom [2008-11-14 21:50:30] [LOGIN] [RESULT] OK
Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 237
--- End code ---
Temar:
ok in Sources/Bot.php
in function connect() near botton of the function you will see
--- Code: (php) --- // Tell modules that the bot is connected
if (!empty($this -> commands["connect"]))
{
$keys = array_keys($this -> commands["connect"]);
foreach ($keys as $key)
$this -> commands["connect"][$key] -> connect();
}
--- End code ---
replace it with
--- Code: (php) --- // Tell modules that the bot is connected
if (!empty($this -> commands["connect"]))
{
$keys = array_keys($this -> commands["connect"]);
foreach ($keys as $key)
{
echo "running Connect function in Class: ".$key."\n";
$this -> commands["connect"][$key] -> connect();
}
}
--- End code ---
the last 1 it list is the Class that is causeing the problem
exxie:
edited the code and got this message:
--- Code: ---running Connect function in Class: 0
Fatal error: Call to a member function connect() on a non-object in /home/aobot/cratcom_bebot/Sources/Bot.php on line 249
--- End code ---
which class is class 0?? ???
Navigation
[0] Message Index
[#] Next page
Go to full version