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.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Suggestions
➜ Fallthrough aliases
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Indoum
Sweden (17 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) 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 | Top |
|
Posted by
| Indoum
Sweden (17 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) 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 | 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.
14,439 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top