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.
 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Bug with Tell/ColourTell

Bug with Tell/ColourTell

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


Posted by Derrickn   (3 posts)  Bio
Date Fri 09 Sep 2005 08:34 PM (UTC)
Message
when i try to use the 'tell' or 'colourtell' functions within my perl script, the first call seems to always start on a new line, whereas any subsequent calls stay on the same line. does anyone else have this problem? and if so, is there a known fix for it? here is an example of my code and the output:

# ------begin perl script-------
$world->ColourTell( "blue", "", "test" );
# ...etc...
$world->ColourTell( "blue", "", "(" );
$world->ColourTell( "green", "", "+1" );
$world->ColourTell( "blue", "", ")" );
# ------end perl script---------

------beging output-------
[SAFE]<2600
testhp 1449(+1)sp
------end output----------

the prompt from the mud that i play is not terminated by an iac eor or newline (or any other special character) so i'm triggering off of mxp set variable events. as you can see, the first call is being placed on a newline, whereas the next 3 are placed on the same line.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Sat 10 Sep 2005 02:38 AM (UTC)
Message
Is the problem for you that the first Tell is on a new line, or subsequent Tell's all on one line? That's how Tell's are supposed to work - no newline is appended to them, so several Tell's will end up on one line, unless you include a newline in the text, or do a Note, which has a newline appended automatically.

If you actually want the first Tell to go on the same line as your prompt, then I don't think that that is possible - I believe Mushclient forces Tell/Note output and MUD output to always be on separate lines, otherwise, for example, it wouldn't be possible to tell whether the given line is custom or MUD output with GetLineInfo. What you can do in that case is use the OnPluginPacketReceived callback to append your text to the MUD output, so it is treated by Mushclient as one thing.
Top

Posted by Derrickn   (3 posts)  Bio
Date Reply #2 on Sat 10 Sep 2005 02:47 AM (UTC)
Message
my problem is that the first tell is on a new line. and if that's the case, then why are subsequent calls to tell on the same line even with mud output between these calls? according to you, they should be on a separate line as well...

thanks for the tip on the plugin, though. i'll just use that instead :>
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #3 on Sat 10 Sep 2005 05:30 PM (UTC)
Message
Umm. Not at all sure what you mean, but I would suspect that it is probably because all 'output' from the mud is suspended during script execution. In other words, no new content from the mud is recieved at all, until your entire script and all tells are executed, then the script exits and any additional mud output is handled. Since you are using tell, all parts will appear on the same line, since no newline or 'note' command ever happens.
Top

Posted by Derrickn   (3 posts)  Bio
Date Reply #4 on Sun 11 Sep 2005 05:44 PM (UTC)
Message
that's not true shadow... as you can see from the output i pasted, there is mud output between each call to the script. the reason for this is because the script is triggered off mxp events, which can happen multiple times per line of mud output.

i just don't understand why one call starts on a new line, and the other ones don't. at the very least they should all start on a new line, or none of them.
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #5 on Mon 12 Sep 2005 01:36 AM (UTC)
Message
That could only be explained by looking at the actually input being dealt with. The problem is still not likely a bug, but a misinterpretation of what it really going on. But short of seeing both the script **and** a complete feed of what is recieved when it happens, all we can do is guess.
Top

Posted by Shadowfyr   USA  (1,788 posts)  Bio
Date Reply #6 on Mon 12 Sep 2005 01:39 AM (UTC)
Message
Oh, and it would also help to see what *doesn't* cause the error, so we can compare and see what is going on. If I was looking for a bug like this, I would make a plugin to dump all packets to an external file of some sort, so I could later feed the exact data back in, to figure out what was really going on. Without that, your example only tells us something went wrong, not why it did that time, instead of the times you say it works.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 18 Sep 2005 06:13 AM (UTC)
Message
MUSHclient goes to a considerable amount of trouble to not mix output types. Thus, MUD output is not appended to command echo, or notes, and vice-versa.

In any case, Tell (as opposed to Note) suppresses the *trailing* newline, not a leading newline.

- 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.


25,308 views.

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.