[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  Fallthrough aliases
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Fallthrough aliases

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Indoum   Sweden  (17 posts)  [Biography] bio
Date Mon 26 Jun 2006 10:32 PM (UTC)
Message
In the MUD I'm playing there's an alias that stops most ongoing activities, "stop", and I wish to use that throughout all my plugins to stop whatever chaining activities they have going on.

The problem is that I also want stop to be sent to the MUD. I've so far been forced to add a line with Send("stop") to the aliases (since I wont know which plugins will be installed) but that only results in the MUD being spammed.

What I suggest is a fallthrough option being added to aliases which, when enabled, will make the alias not interrupt the executed command.
[Go to top] top

Posted by Nick Gammon   Australia  (21,674 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 27 Jun 2006 06:58 AM (UTC)
Message
Quote:

... which, when enabled, will make the alias not interrupt the executed command ...


I'm not really sure what you mean here, but you should be able to do it with the existing aliases.

Aliases have an option to "keep evaluating" which means more than one alias can be processed per line typed.

By judicious use of sequence numbers you could make a "catch all" alias (matching on *) that does something first (like send "stop") and then fall through to do other things.

I'm not sure if that totally answers your question, but perhaps give an example of what you are trying to do.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Indoum   Sweden  (17 posts)  [Biography] bio
Date Reply #2 on Tue 27 Jun 2006 10:13 AM (UTC)
Message
Let's say I have three plugins with different functions I want to distribute to friends. They all chain an action, which is stoped by typing "stop". I also want them to be able to send stop directly to the MUD, since it stops ongoing activities there too. If I use that catch-all-alias in all three plugins then the MUD will be spammed and I cannot use it in only one plugin, as I don't know which ones they'll actually use.

Currently when an alias is triggered, it'll stop the input from being sent to the MUD. What I was trying to say was that I'd like to have an option in aliases that would make them not stop the input from being sent.

<alias fallthrough="y">

It would default to yes. If any alias is triggered that has a negative value to fallthrough, it would behave like now and stop the text from being sent.
[Go to top] top

Posted by Nick Gammon   Australia  (21,674 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 28 Jun 2006 07:19 AM (UTC)
Message
I'm not sure that would help. I gather you have up to 3 plugins, and if each one decides to send "stop" then you have spammed the MUD with 3 commands?

However as described on this page:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6572

... aliases are matched in each plugin. So, each plugin will send "stop" anyway.

I think you need to save some sort of state, to know whether or not to send the "stop" to the MUD. You can probably use the plugin callback OnPluginSend to know if something was sent to the MUD. If you sent "stop" you could set the "stop sent" flag. If something else, a "stop needed" flag. Something like that. I can still see possibilities for it to go wrong, but you could try that.

The other thing that might help is the new plugin callback (not yet released) in version 3.75 - OnPluginCommandEntered. This is called when a command is entered, before plugin processing. This could set a flag "stop not sent" and then the first plugin to match can send "stop" and change the flag to "stop sent". Then the other plugins don't send "stop" again.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


3,354 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]