Jump to content
  • 0

Adding Custom @commands


Xhiro

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

Either I'm absolutely lousy at searching or I'm just blind.

How do I add new @commands in using the groups ID?

Previously when using GM level, the steps was to edit the following :-

  1. adding your @command in src/map/atcommand.c
  2. adding a line similar to this in the same file
    
    { "font", 1,1, atcommand_font },


  3. etc etc

Step 2 doesn't exist now though... So what else am I supposed to edit?

What I have edited are

  1. Edited the atcommand.c in trunk/src/map
  2. Didn't edit the groups.conf since it says the following

commands: {
	/* not necessary due all_commands: true */
}

Edited by Xhiro
  • Upvote 1
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   3
  • Joined:  07/19/12
  • Last Seen:  

It's easy, you only need to know the src command, an example:

commands: {

item: true

job: true

customcommand: true

}

:3 i hope you understand and i help in something xP

PD: Sorry for my bad english DX

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

I meant for it to be an admin (group id 99) only command. Since admins have all_commands : true, i didn't edit that. Still doesn't work though. Not sure what I'm missing exactly

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

By default, gm lvl 99, will be able to use ALL commands. If you don't want a specific group to have a command, just enter:

command_name: false (assuming it is inherting another group).

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  754
  • Reputation:   186
  • Joined:  05/22/12
  • Last Seen:  

for the step 2

in atcommand.c, search for this part

/**
 * Command reference list, place the base of your commands here
 **/
AtCommandInfo atcommand_base[] = {
 ACMD_DEF2("warp", mapmove),
 ACMD_DEF(where),
 ACMD_DEF(autostore),
 ACMD_DEF(jumpto),

add your command there

ex.

/**
 * Command reference list, place the base of your commands here
 **/
AtCommandInfo atcommand_base[] = {
+ ACMD_DEF(newcommand),
 ACMD_DEF2("warp", mapmove),
 ACMD_DEF(where),
 ACMD_DEF(autostore),
 ACMD_DEF(jumpto),

  • Upvote 3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

Ah... thanks clydelion. I was looking for that :D

Kinda proves that I am blind /swt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

If that is what you were trying to do, then you no longer need to do that, since rAthena made a conf file for that.

rAthena/conf/atcommand_athena.conf

/* Command aliases
You can define aliases for any command. Aliases work just like original
command.
Format is
<commandname>: ["<alias>", ...]
*/
aliases: {
mobinfo: ["monsterinfo", "mi"]
iteminfo: ["ii"]

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   2
  • Joined:  10/22/12
  • Last Seen:  

If that is what you were trying to do, then you no longer need to do that, since rAthena made a conf file for that.

rAthena/conf/atcommand_athena.conf

/* Command aliases
You can define aliases for any command. Aliases work just like original
command.
Format is
<commandname>: ["<alias>", ...]
*/
aliases: {
mobinfo: ["monsterinfo", "mi"]
iteminfo: ["ii"]

If that is what you were trying to do, then you no longer need to do that, since rAthena made a conf file for that.

rAthena/conf/atcommand_athena.conf

/* Command aliases
You can define aliases for any command. Aliases work just like original
command.
Format is
<commandname>: ["<alias>", ...]
*/
aliases: {
mobinfo: ["monsterinfo", "mi"]
iteminfo: ["ii"]

This is aliases for alternative @command names, but it doesn't define the new @commands.

clydelion found what I wanted already. Thanks all~

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...