Plugins, Commands, and World.Execute

Posted by Tspivey on Sun 26 Mar 2006 08:11 PM — 2 posts, 12,294 views.

Canada #0
I have an interesting set of problems here.
1. My command seperator character is set to a ;.
2. I have a speech plugin, and want scripts to be able to speak to it without using a cumbersome Callplugin interface. I've got 2 ideas.
a. use a broadcast routine to speak the text. I suppose this would work, but you'd need to always use the number.

b. Use an alias and World.Execute. This seems the best idea, but if aliases are turned off, or the message to speak contains the current command-seperator character, then it will send text that we don't want to the mud. I want to avoid sending unwanted text to the mud if at all possible.
Also, is it possible to set up an alias with the first character being the command seperator character? Most diku's use ; as group tell, but I still want ; to be my command seperator. Also, can we have an alias that ignores the seperator character, e.g. tintin's \ for verbatim input?

Thanks.
Australia Forum Administrator #1
What is wrong with CallPlugin? You don't have problems with whether aliases are enabled, or contain the command stack character.

However if you want to use a script to call your plugin, using an alias, you can always turn off command stacking:


old_command_stack = GetOption ("enable_command_stack")
SetOption ("enable_command_stack", 0)
world.Execute ("whatever")
SetOption ("enable_command_stack", old_command_stack)


However since your alias will have to have some sort of identifying string (for the alias to pick up), followed by what you want to speak, it must look about as cumbersome as CallPlugin, surely?


CallPlugin("80f8022ed6accd86a4f14e21", "Speak", "What to say")