Skip to content
Haru edited this page Oct 19, 2016 · 1 revision

Syntax

  • bindatcmd "command","::<event></event>"{,<atcommand></atcommand>,<charcommand></charcommand>};

Description

This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding.

The following variables are created upon execution:

  • .@atcmd_command$: The atcmd used.
  • .@atcmd_numparameters: The number of parameters defined.
  • .@atcmd_parameters$[]: Array containing the given parameters, starting from an index of 0.

Example

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

 -	[[Basic_Scripting#NPC|script]]	atcmd_example	-1,{
 [[OnInit]]:
 	[[bindatcmd]] "test",[[strnpcinfo]](3)+"::OnAtcommand";
 	[[end]];
 OnAtcommand:
 	[[specialeffect2]] 338;
 	end;
 }

For another good usage example of this command, see changelook.

Category:Script_Command

Clone this wiki locally