BeBot - An Anarchy Online and Age Of Conan chat automaton
Archive => Anarchy Online Archive => BeBot 0.2 support => Topic started by: Xenixa on October 17, 2005, 06:40:43 pm
-
Basically what I need to know is, is it possible to call another command from inside module thats defined in another Module.
Reason I ask is I'm using the AFK.php that Crazied came up with that works great. However I can't seem to get the info to appear in the online list when someone calls !online.
What I have so far in Online.php inside the Function online_list() is:
if (isset($this -> bot -> commands["gc"]["afk"] -> afk[$player[0]]))
{
$online_list .= "<font color=#FF0000>(AFK)</font>\n";
}
Not even sure is that is correct. It doesn't toss any errors but it doesn't print out if they are AFK either.
Anyone have any ideas?
-
You can, you just have to make sure the other module really gets loaded, or the bot will crash with an error ("Illegal function call" or something like that).
It works for functions, not sure what the rule for variables in objects is in PHP.
You could try adding a function that returns your wanted value, instead of trying to access the variable directly. Not sure if it will help with your problem though.
-
The simplest way is to do something like this:
$this -> bot -> commands["tell"]["online"] -> tell($name, "online");
That will pretend that a tell came from $name requesting the online module with the parameter online
-
NM, I found the problem. I was using the wrong channel in the command:
Online now reports those list as AFK with the Bot using Crazied's AFK.php :D
if ($this -> bot -> commands["tell"]["afk"] -> afk[$player[0]])
{
$online_list .= "<font color=#FF0000>(AFK)</font>\n";
}
Also didn't need to use isset()