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
➜ Tips and tricks
➜ High lighting text with diffrent colours..
|
High lighting text with diffrent colours..
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Potato Hot
(3 posts) Bio
|
| Date
| Sat 09 Feb 2002 03:18 PM (UTC) Amended on Sun 10 Feb 2002 03:42 AM (UTC) by Nick Gammon
|
| Message
| Ok, back again with a problem.
There is a command for viewing a party status. I wanted my Hit poits to be high lighted with color. (changing when lowers would rok too. like high/mid/low) But so far have not been able to figure out how to do this..
Heres the exact party status:
,-----------------------------------------------------------------------------.
| Party Name: Up'RoCK'ha (Members: 1) | Exp Tot: 1013 |
| Created: Sat Feb 09 16:53:22 2002 ( 0h 0m 12s) | Exp/min: 1013 |
|========================================================|====================|
| Place Name Status HP SP EP | Lvl | Experience |
|========================================================|=====|==============|
| 1.2 Potato ldr 667( 673) 592( 592) 295(296) | 51 | 1013 |
`-----------------------------------------------------------------------------'
Spell point high lighting would also rok..
All I know is that Im not familiar enough with the client to do this.. Prolly some serius script needed too?
-Hot Potato, newbie with mushclient | | Top |
|
| Posted by
| Shadowfyr
USA (1,792 posts) Bio
|
| Date
| Reply #1 on Sun 10 Feb 2002 08:07 PM (UTC) Amended on Sun 10 Feb 2002 08:10 PM (UTC) by Shadowfyr
|
| Message
| Simple answer... You can't. At least not smething that complex and 'non-specific'. I believe you can hilight entire lines or individual words, but to do what you want you would need several things to be added to the client -
1) A Supress triggering line switch in the trigger - to prevent output of that line to the window.
2) The ability to embed color code into a string and send that back to the cleint from a script to 'replace' the original.
3) The ability to call either subs or functions from the trigger.
Without these changes, what you want is not realy possible.
Now to explain them -
First #3.. The most logical way to 'replace' the trigger line with a user modified one is to have the trigger pass it complete as the first wildcard, then at the end of a function, pass back the new information to display. Now, why not do this every time? Because sometimes it may be useful to surpress the line, but not return anything to replace it. With a function something must always be returned and even if it is a blank line, it will still fill up the client window. As an example of both, your problem would require passing a new line back to the client (complete with color codes) to be processed as though it was recieved from the mud, while with a recent script I wrote I don't really want to see my entire inventory every time I use it, since I only want the results I computed from it.
Item #2 - While embedding color codes in a world.note would be nice, it makes more sense to use a return value in a function and have the client treat that as though it where part of the original text. This means you could use <color> tags or ANSI codes, depending on which was turned on, though if Gammon does change custom colors to allow you to create a color trigger with any color, not just the 16 currently definable, it would make sense to have the client always process color tags even if MXP is off. Otherwise it would break the function of the changes made to the custom colors.
Item #1 - This is the heart of the problem and has really bugged me in many cases. There is simply no way to read something and not have it display in the output window. Not a big deal, until what you are trying to process takes up the entire client window. Then it gets inconvenient. ;)
As a technical note.. It would probably be a good idea if the first wildcard 'always' contained the full line that was triggered on, even if the user does not intend to use a function to return the results of their script. This is simple consistancy (not to mention easier than trying to have Mushclient figure out if it is calling a normal sub or a function). Though it may need to know that anyway to figure out if it should expect new data to be displayed or just continue as normal. Maybe another flag for 'script returns replacement line' or something... | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #2 on Mon 11 Feb 2002 12:43 AM (UTC) |
| Message
| Actually you can do most of that. :)
Quote:
1) A Supress triggering line switch in the trigger - to prevent output of that line to the window.
On the trigger check "omit from output".
Quote:
2) The ability to embed color code into a string and send that back to the cleint from a script to 'replace' the original.
You can do that by using NoteColourRGB, NoteColourFore or NoteColourBack, in conjunction with world.tell to construct a line that appears in different colours, under programmatic control.
Quote:
3) The ability to call either subs or functions from the trigger.
Triggers can currently call subs.
The difficulty I see is making the trigger match on the line with the HP in it, as it might be hard to pick it if all the numbers can vary. I would make another trigger that matches on:
| Place Name Status HP SP EP | Lvl | Experience |
This lets you know that the HP line is coming in a couple of lines, so you could then enable the real trigger that matches on the HP line, ie. the one with:
| 1.2 Potato ldr 667( 673) 592( 592) 295(296) | 51 | 1013 |
This second trigger could then pull the line apart (in VBscript or whatever language) and then use world.tell to output the numbers in various colours, and then disable itself, ready for next time.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Shadowfyr
USA (1,792 posts) Bio
|
| Date
| Reply #3 on Mon 11 Feb 2002 02:10 AM (UTC) |
| Message
| Ok... I am an idiot, everyone please ignore me. lol
Everything but the world.tell thing I should have been able to find had I not been half asleep when I first went looking for it. :p World.tell of course would require looking at the online help... Yah really need to privide an updated help file one of these days. ;) lol
Looks like everything is possible. Could still be occations when being able to pull the entire line from the wildcard info would be helpful for debugging purposes, but it is not that big of a deal and you can just turn off the 'omit from output' flag. Like I said.. Dummy me for not paying attention. ;) | | 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.
16,447 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top