Jump to content
  • 0
Xhiro

Adding Custom @commands

Question

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

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

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

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

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

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

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.