BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => BeBot 0.5 support => Topic started by: Nytridr on July 22, 2007, 04:22:20 am
-
Fatal error: Call to a member function message() on a non-object in C:\aobots\Be
bot\modules\IRC.php on line 234
$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> bot -> settings -> get("Irc", "Channel"), $ircmsg);
Bot Client:
v0.5.0.svn(snapshot)
need I say more..:) go the first post at least :)
-
This hasn't been changed at all, are you sure you are loading the SmartIRC class?
EDIT: Another reason this error can happen is when you call the send_irc() function while you aren't connected to IRC yet.
-
This hasn't been changed at all, are you sure you are loading the SmartIRC class?
EDIT: Another reason this error can happen is when you call the send_irc() function while you aren't connected to IRC yet.
on the org bots I dont have this even configured anymore.. i am using a separate bot for IRC access.. but I am afraid to restart that bot due to this.. not sure if something was done unexpectantly or not.
-
No real need to load the IRC module on bots not using IRC at all.
Anyways, in the send_irc() function in Bot.php the safety checks were wrong, though I think they would just crash the bot, not send all to IRC. Fixed in SVN versions.
-
Still same thing, I will double check make sure I have everything correct when I copied the source over to the live bots. and the live bot I am testing it on, dosent have IRC setup at all. I know I could just _irc.php but then that would also affect the IRC bot I have running also. I am using the startup.bat argument option to run multiple bots from the same directory. maybe eventually we could have and configuration put in to turn off modules from loading say like in the bot.conf
irc.php = Off //On/Off option
but as of right now I am still getting that same error.
-
You could use the $module_directories variable. Move IRC.php into a subfolder, e.g. modules/irc/, and then include this in the conf files of the bots using IRC.
$module_directories = "modules/irc";
-
ok after removing the IRC.php and putting it in to a differnt folder I was getting a fatal error untill I added Tichy's little thing.
// Relays $msg to IRC module (and from there after formatting to IRC channel)
function relay_to_irc($msg)
{
{
if ($this -> bot -> settings -> get("irc", "connected"))
{
$this -> bot -> irc -> send_irc("", "", $this -> bot -> irc -> strip_formatting($msg));
}
}
}
It was just this
//$this -> bot -> irc -> send_irc("", "", $msg);
you know what is kind of funny is with the IRC.php module in my IRC bot that I use isnt having any problems. it seems as long as you have IRC setup and connecting then it runs fine, but if you have it off in the other bots, then it really dont like it and gives you the previous error I posted. May need to add checks to anything that sends out over the IRC to see if we are even going to connect to it, and if we aren't then dont run that part of the mod.
-
Just replace that with $this -> bot -> send_irc() with the same arguments, in that function there is a full check for IRC.
Going to fix this error in the SVN now.