BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Nesi on April 19, 2005, 09:52:45 am

Title: Giving me grey hairs :/
Post by: Nesi on April 19, 2005, 09:52:45 am
Trying to use:

if ($this -> bot -> admin -> in_group($user, "xxxxxgroup"))

In bot.php

Restarts the bot with the following error :

Fatal error: Call to a member function on a non-object.


Trying to use it in the incomming tell section.

Anyone got a clue how to make that work there?
Title: Giving me grey hairs :/
Post by: Nesi on April 19, 2005, 09:57:38 am
I can't make it call the database from bot.php either...
Title: Giving me grey hairs :/
Post by: Zacix on April 19, 2005, 12:59:14 pm
take away bot-> so it becomes:

if ($this -> admin -> in_group($user, "xxxxxgroup"))


since you are inside the Bot class, $this means the instance of the bot class. whereas $this ->bot which is used inside modules means a reference to the same class. Note that in the beginning/constructor of each module, a reference to the bot class is stored in a variable called $bot, hence u can access functions inside the bot class by doing $this ->bot->bot_class_function. In this case $this means the module class.
Title: Giving me grey hairs :/
Post by: Nesi on April 19, 2005, 10:39:14 pm
Yeah, figured that out like 5 mins after i posted that hehe, thanks for the reply tho.
SimplePortal 2.3.7 © 2008-2024, SimplePortal