Register forum user name 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Baffling Newline

Baffling Newline

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


Pages: 1  2 

Posted by Candido   USA  (78 posts)  Bio
Date Reply #15 on Tue 12 Feb 2008 05:12 AM (UTC)
Message
Am I right in assuming the best way to store my commands in a table to be echoed later is by monitoring OnPluginSend?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #16 on Tue 12 Feb 2008 05:28 AM (UTC)
Message
Well that might work but I can forsee problems. What is going to force the command out exactly? I thought what I saw above was a note, but you are saying it is a command, is that right?

If you store a command for later, to be sent when you receive something (like a line), imagine what happens if there is no MUD output at all, and you type something like "inventory".

Now your OnPluginSend puts that in a table, and waits for a line to arrive from the MUD. So, it seems to you that your command has done nothing.

Maybe if you only did that if "packet" was not empty, then this would work, as you would assume another packet will arrive shortly.

- Nick Gammon

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

Posted by Candido   USA  (78 posts)  Bio
Date Reply #17 on Tue 12 Feb 2008 05:35 AM (UTC)
Message
Ah, no, I guess I wasn't clear. What split the prompt was a command echo. My idea was to uncheck the "Echo My Input In" option in the commands configuration, then, while still allowing commands to pass, keep track of what commands did pass (using information from OnPluginSend) and then Note them when I receive a complete line to simulate a command echo without a risk of it splitting prompts.
Top

Posted by Candido   USA  (78 posts)  Bio
Date Reply #18 on Fri 15 Feb 2008 05:19 AM (UTC)

Amended on Fri 15 Feb 2008 05:20 AM (UTC) by Candido

Message
It turns out that won't be necessary after all. I think I mentioned earlier that I planned on allowing the subnegotiations that create a second prompt to pass to output. The problem before was I was trying to make a single line prompt from text that could possibly arrive divided in two packets, creating the possibility of a well timed note or command echo splitting up the prompt.

It turned out that creating a two line prompt by allowing the subnegotiation prompts to pass, in conjunction with combining incomplete subnegotiations with the next packet, eliminated the possibility of splitting the subnegotiation prompt, instead putting any would be splitters between the two prompts. It's still possible to split the first line of the prompt since I don't specifically check for incompleteness on it, but it's much rarer and of comparatively little consequence.

So, with that in mind I simply gag the two prompts and construct one with a ColourNote, and thanks to Mr. Gammon's code advice it's all lightning fast. Thanks for the help.
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.


58,703 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     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.