BeBot - An Anarchy Online and Age Of Conan chat automaton
		Archive => Anarchy Online Archive => BeBot 0.4 support => Topic started by: exxie on November 14, 2008, 07:08:00 pm 
		
			
			- 
				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!
			 
			
			- 
				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.
			 
			
			- 
				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:
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
			 
			
			- 
				ok in Sources/Bot.php
in function connect() near botton of the function you will see
		// 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();
		}
replace it with
		// 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();
			}
		}
the last 1 it list is the Class that is causeing the problem
			 
			
			- 
				edited the code and got this message:
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
which class is class 0??  ???
			 
			
			- 
				got any custom modules ? old 1's could cause problems
			
 
			
			- 
				I disabled the modules one by one and it turns out, that it was the 0.5.0_Support.php-module ...
			
 
			
			- 
				with that module it is also a possibility that its a module that it loads thats causing the problem not the module it self
			
 
			
			- 
				ah okay. I'll try disabling the 0.5.0-modules one by one.