BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6 support => Topic started by: Shakor on September 06, 2009, 06:54:04 pm

Title: register_command anonymous
Post by: Shakor on September 06, 2009, 06:54:04 pm
Hi,

Ok so I am creating a script what I want to have available for all anonymous players for the bot.

$this -> register_command('all', 'script_command', "ANONYMOUS");

But the bot is still posting "I only listen to members of this bot."

Anyone has some info for me?
Title: Re: register_command anonymous
Post by: Dochere on September 07, 2009, 12:06:15 am
Try setting the access with !commands then the "msg group" you want it to affect :)
Title: Re: register_command anonymous
Post by: Shakor on September 07, 2009, 08:48:43 am
Thanks I will try it out tonight.
Title: Re: register_command anonymous
Post by: Khalem on September 07, 2009, 02:20:07 pm
If you have previously registered the command with a different access level at any given point in time, it will still have that access level.

register_command only indicates the default value if no value is set.
Title: Re: register_command anonymous
Post by: Shakor on September 07, 2009, 02:35:15 pm
I don't understand. So when will it take effect? (After restarting the bot?) Or is it saved in the DB what the access level was?

Using this now and still get the same answer from bot.: I only listen to members of this bot.

Code:
$this -> register_command('all', 'cmd1', "ANONYMOUS");
$this -> register_command('all', 'cmd2', 'GUEST');
$this -> register_command('all', 'cmd3', 'GUEST');

I just want to have cmd1 to be executed to the outside world (and all members ofc.) And the other 2 commands restrict for members only access.

PS: Dochere: I have not yet tested your option out. Still at work :)
Title: Re: register_command anonymous
Post by: Khalem on September 07, 2009, 03:13:05 pm
Let me try to be more clear.

Whenever a command is registered for the very first time, the access level for that command is read from the provided level in the register_command function, or if none is provided, a the bot default is used (if memory serves).

This means that if you at any point ran any module which registered the command: 'cmd1' in your example, without an access level or with a different access level than ANONYMOUS... that access level has been entered into the database as the access level for that command.

As long as an entry exists in the database for that command... no matter what you set your register_command access level to, it will NEVER change for your install. It is ONLY used when registering a new command the bot has not had registered before.

To change the access level of a command that has been registered, or view it for that matter, you need to use the ingame !commands interface.
Title: Re: register_command anonymous
Post by: Shakor on September 07, 2009, 03:32:07 pm
Awesome, thanks for your clear information.
Title: Re: register_command anonymous
Post by: Shakor on September 07, 2009, 07:51:28 pm
Works like a charm. Thanks guys.
SimplePortal 2.3.7 © 2008-2025, SimplePortal