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
➜ VBscript
➜ Prompt re-formatting problems
|
Prompt re-formatting problems
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Vale
(2 posts) Bio
|
| Date
| Sat 01 Apr 2006 03:46 AM (UTC) |
| Message
| 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. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Thu 06 Apr 2006 09:48 PM (UTC) |
| Message
| 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. :) |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Vale
(2 posts) Bio
|
| Date
| Reply #2 on Mon 10 Apr 2006 04:04 AM (UTC) |
| Message
| | 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. | | 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.
13,063 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top