Prompt re-formatting problems

Posted by Vale on Sat 01 Apr 2006 03:46 AM — 3 posts, 13,693 views.

#0
Hi,

I play a MUD that uses the following prompt:

2884h, 4708m, 4252e, 10p, 21282w exkdb-

The MUD has an option to add a newline after this, but I have that turned off in favour of MUSHclient's "Convert IAC EOR/GA to new line" option. What I would like to do is add changes in health and mana, as well as the time, to the end of this, on the same line. I want it to look like this:

2884h, 4708m, 4252e, 10p, 21282w exkdb- H: -300 M: 400 10:21:32.05

I have no problem adding this info on a new line, but I absolutely can't figure out how to keep it on the same line without omitting the prompt from output and rewriting it entirely (which I don't want to do because I have a different trigger that colours the prompt when a certain action is possible.)

I also have a lot of triggers anchored to new lines (e.g. ^You move sluggishly into action.) and would really like to keep them that way. So I need a newline after the prompt line.

Lastly, as a minor question: VBscript's Time and Now functions return the time in HH:MM:SS format. How might I go about getting the time with a precision of tenths or hundredths of a second?

Thanks in advance for any help or suggestions you can offer.
Australia Forum Administrator #1
As has been discussed in the past, MUSHclient does not really permit you to rewrite the output it receives, partly because it has already displayed it before the trigger fires.

Omitting it and redrawing are really the only way to go. Surely your second trigger can be tied to the operation of the first, since they are both dealing with the prompt?

As for the high-precision time, you could use GetInfo (232) to get the internal high-performance counter, which is very accurate. This is not the time of day, but if you want to display time differences it is fine. Alternatively you could "tie" it to the time-of-day by working out an anchor point (ie. the real time when the world starts up) and then do some arithmetic. That is, if the time of day is 9:00 when the program starts, and you remember the internal timer too, then you can add the difference, and work out what the time must be now. :)
#2
Thanks very much for your help. I think I'll settle on calculating the health and mana differences and using them in scripts without displaying them, while writing the time only to the log file.