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
➜ Redirecting Output from Commands
Redirecting Output from Commands
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Hammerstein
(1 post) Bio
|
Date
| Wed 12 May 2004 03:07 AM (UTC) |
Message
| I suspect there might be a way to do this, but I'm not sure, so I thought I'd post it here. I was thinking that it would be great if MUSHclient supported a method of, upon the entry of a certain command, displaying the output from that command in a separate window that could be moved around the screen. That would be helpful for certain info commands that are best left always available.
Thank you for your time and effort. | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #1 on Wed 12 May 2004 03:53 AM (UTC) Amended on Wed 12 May 2004 03:54 AM (UTC) by Ked
|
Message
| One way to do this would be to pipe those commands through a single function that would send the command text to a notepad window. An example would be:
sub CommandLogger(comText)
world.AppendToNotepad "Commands", comText & vbCRLF
end sub
Then you could use this function either directly from an alias via send to scripting, or from another scripting function called by an alias. But it would be easier to just have a protocol of calling scripts immediately from aliases and prepending the call to CommandLogger before any other scripts in the aliases that you want logged. | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 12 May 2004 10:20 PM (UTC) Amended on Wed 12 May 2004 10:21 PM (UTC) by Nick Gammon
|
Message
| I think he wants the output in a separate window, not the command.
The problem with what you want to do is there is normally a lag between entering the command and receiving the results.
For example, you might type "inventory" but get back:
Lightning crackles in the sky above!
Boris chats 'where is the shop where I can buy swords?'
You are carrying:
a magic mushroom
a torch
a dragonskin
a bag
recall scroll
a braided leather belt
heavy mail leggings
In this case I have a couple of extra lines that are not really part of the inventory.
Now, if you don't mind that, then you could make an alias for (say) "inventory", that enables an trigger. This trigger would match "*" (everything), and send to "append to notepad", and also "omit from output".
That effectively moves everything that is received afterwards from the main window to the notepad (each notepad has a separate title based on the trigger name).
However your problem is stopping it. If you don't do anything else, then the entire following session will be in the notepad window and not the main window.
You need a "stopper" - in the case above a totally blank line is the end of the inventory. Another trigger could detect that and turn the first trigger off (disable it).
However in my example above there is also a blank line *before* the inventory. So, the simplest thing might be:
- Trigger "a" detects "You are carrying:" and enables trigger "b"
- Trigger "b" detects "*" (everything) and moves it to the notepad
- Trigger "c" detects a blank line and disables trigger "b"
|
- 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.
11,961 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top