Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ Plugins, Commands, and World.Execute

Plugins, Commands, and World.Execute

Posting of new messages is disabled at present.

Refresh page


Posted by Tspivey   Canada  (54 posts)  Bio
Date Sun 26 Mar 2006 08:11 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,122 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 28 Mar 2006 07:58 PM (UTC)

Amended on Tue 28 Mar 2006 09:25 PM (UTC) by Nick Gammon

Message
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")

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,496 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.