Jump to content

bindatcmd addition


GmOcean

Recommended Posts


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

Okay, as of right now, bindatcmd works as intended no problems at all, even the support for parameters is very useful. I would just also like for there to be a variable added as well, so we can figure out which command is used. Now before anyone says anything, YES i do know you specify an event label, which in turn renders this suggestion useless. However, with a variable ( .@atcmd$ ) we can in turn use 1 label for all of our bound-atcmds and determine how to calculate it from there.

I for one, would perfer to have this added, mainly because i like to use commands like this dynamically if i could. I had to stop mid-way writting a script to allow the dynamic build of atcmds because, i was unable to figure out which command was used.

e.g if i were to use: @test Testing Atcommand it would set the following:

.@atcmd$ = test

.@atcmd_parameters$[0] = Testing

.@atcmd_parameters$[1] = Atcommand

-	script	at_cmd	-1,{
OnInit:
bindatcmd("test","at_cmd::OnUseCmd");
end;
OnUseCmd:
dispbottom "You used: @"+ .@atcmd$+" "+ .@atcmd_parameters$[0] + .@atcmd_parameters$[1];
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

/meh

-	script	at_cmd	-1,{
OnInit:
bindatcmd "test","at_cmd::at_test";
bindatcmd "test2","at_cmd::at_test2";
bindatcmd "hello","at_cmd::at_hello";
end;

at_test:   set .@atcmd$, "test";   goto OnUseCmd;
at_test2:  set .@atcmd$, "test2";  goto OnUseCmd;
at_hello:  set .@atcmd$, "hello";  goto OnUseCmd;

OnUseCmd:
dispbottom "You used: @"+ .@atcmd$+" "+ .@atcmd_parameters$[0] + .@atcmd_parameters$[1];
end;
}

EDIT: on a more serious note, it looks like this is already implemented, but not documented.

r16471/trunk/src/map/npc.c

setd_sub(st, NULL, ".@atcmd_command$", 0, (void *)command, NULL);

Edited by Brian
  • Upvote 2
Link to comment
Share on other sites

×
×
  • Create New...