collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: register_command anonymous  (Read 8436 times)

0 Members and 1 Guest are viewing this topic.

Offline Shakor

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
register_command anonymous
« 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?

Offline Dochere

  • BeBot User
  • **
  • Posts: 43
  • Karma: +0/-0
Re: register_command anonymous
« Reply #1 on: September 07, 2009, 12:06:15 am »
Try setting the access with !commands then the "msg group" you want it to affect :)

Offline Shakor

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: register_command anonymous
« Reply #2 on: September 07, 2009, 08:48:43 am »
Thanks I will try it out tonight.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: register_command anonymous
« Reply #3 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.
BeBot Founder and Fixer Kingpin

Offline Shakor

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: register_command anonymous
« Reply #4 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 :)

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
Re: register_command anonymous
« Reply #5 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.
BeBot Founder and Fixer Kingpin

Offline Shakor

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: register_command anonymous
« Reply #6 on: September 07, 2009, 03:32:07 pm »
Awesome, thanks for your clear information.

Offline Shakor

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: register_command anonymous
« Reply #7 on: September 07, 2009, 07:51:28 pm »
Works like a charm. Thanks guys.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 210
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal