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

Title: irc.php
Post by: Nytridr on July 22, 2007, 04:22:20 am
Code: [Select]
Fatal error: Call to a member function message() on a non-object in C:\aobots\Be
bot\modules\IRC.php on line 234

Code: [Select]
$this -> irc -> message(SMARTIRC_TYPE_CHANNEL, $this -> bot -> settings -> get("Irc", "Channel"), $ircmsg);
Code: [Select]
Bot Client:
 v0.5.0.svn(snapshot)

need I say more..:)  go the first post at least :)
Title: Re: irc.php
Post by: Alreadythere on July 22, 2007, 10:43:05 am
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.
Title: Re: irc.php
Post by: Nytridr on July 23, 2007, 02:54:01 am
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.
Title: Re: irc.php
Post by: Alreadythere on July 23, 2007, 12:08:58 pm
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.
Title: Re: irc.php
Post by: Nytridr on July 24, 2007, 05:46:18 am
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.
Title: Re: irc.php
Post by: Alreadythere on July 24, 2007, 10:26:56 am
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.
Code: [Select]
$module_directories = "modules/irc";
Title: Re: irc.php
Post by: Nytridr on July 25, 2007, 05:55:33 pm
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. 

Code: [Select]
// 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
Code: [Select]
//$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.
Title: Re: irc.php
Post by: Alreadythere on July 25, 2007, 06:31:24 pm
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.
SimplePortal 2.3.7 © 2008-2024, SimplePortal