Jump to content
  • 0

Q> About adding commands


Meister

Question


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

Example. I want to give the player an @go command but there's a condition..

Condition:

If and only if the player is a 1st job or not novice.. How to set it?

Thanks in advance!

--

I have a question. what if I want to disable @go command for novice should I try this?

- script Sample -1,{
OnInit:
bindatcmd("go","Sample::OnAtcommand");
end;
OnAtcommand:
if( Job == Novice ){
 message strcharinfo(0),"@go command is disabled for your job/class";
}else{
 opengo;
end;
}

this? correct me if I'm wrong thanks.

Edited by Arcenciel
Split and Merged
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

@emong: "opengo" is not a script command. As a workaround, you could redirect to normal @go with:

atcommand "@go "+.@atcmd_parameters$[0];

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  69
  • Topics Per Day:  0.02
  • Content Count:  1315
  • Reputation:   372
  • Joined:  12/10/11
  • Last Seen:  

You can either edit the source or create a script that would change a player's group when they're a first job. The only difference in the group being one has @go the other doesn't.

EDIT:

Or use this

*bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>};
*bindatcmd("command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>});

This command will bind a NPC event label to an atcommand. Upon execution of
the atcommand, the user will invoke the NPC event label.

Example:
When a user types the command "@test", an angel effect will be shown.

-	script	atcmd_example	-1,{
OnInit:
bindatcmd("test","atcmd_example::OnAtcommand");
end;
OnAtcommand:
specialeffect2 338;
end;
}

EDIT 2:

Noticed your post on the other topic and this topic. Split from the other topic and merged here.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

solved! Thanks!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Why not just modifiy the source codes to only allow them to do it? Then you wouldn't even need the script to do @go.

Peopleperson49

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Why not just modifiy the source codes to only allow them to do it? Then you wouldn't even need the script to do @go.

BindAtcmd was implemented to make things like this a little easier to write. That way you don't have to recompile every time you make a change.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  218
  • Topics Per Day:  0.05
  • Content Count:  1180
  • Reputation:   141
  • Joined:  01/27/12
  • Last Seen:  

Thats good to know thanks. I checked the script_commands.txt and even the item_bonus.txt, but where do I read about this command?

Peopleperson49

Edited by peopleperson49
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Bindatcmd was added in r16471, documentation was added in r16473 to script_commands.txt.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

Bindatcmd was added in r16471, documentation was added in r16473 to script_commands.txt.

Hi Euphy,

i read the description of bindatcmd, but just to be clear, does this allow you to create custom atcommands?

is there also a command which verifies if an at command exists?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Yes, bindatcmd allows you to create new atcommands without modifying source. If you bind to an existing command, the atcommand will invoke your script and not the source function. There is no command which checks for an existing command.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

thank you very much. this is a helpful information :)

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