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
➜ Trigger matching to color codes
|
Trigger matching to color codes
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Jeffrey F. Pia
(49 posts) Bio
|
| Date
| Wed 03 Mar 2004 05:56 AM (UTC) Amended on Wed 03 Mar 2004 05:57 AM (UTC) by Jeffrey F. Pia
|
| Message
| Can a trigger be set to go off on a line that is a specific color? For instance when I look at a spell list, spells I am currently affected by are listed in bright green, and all others are dark green.
I looked around a bit and didn't see any documentation on this. If it's not possible via trigs, is it possible via script? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Wed 03 Mar 2004 08:12 PM (UTC) |
| Message
| Triggers can certainly match colours - see the "Match" line after the "trigger" line when you edit one.
However the colour is the colour of the first matching character, which may not be what you want.
If it is, fine, otherwise, make a trigger that matches the line in general, and then use GetLineInfo and GetStyleInfo to "walk" through the styles in the line and see what colour the word in question is. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Jeffrey F. Pia
(49 posts) Bio
|
| Date
| Reply #2 on Thu 04 Mar 2004 08:14 PM (UTC) |
| Message
| Yeah, this line has several color codes, the first of which is always the same:
Active spell - @wSpell: @GInvis @wAffects: blah blah
Inactive spell - @wSpell: @gInvis @wAffects: blah blah
I'll play around with GetLineInfo and GetStyleInfo and see if I can get it to do what I want. Thanks! | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Thu 04 Mar 2004 10:49 PM (UTC) |
| Message
| It should be pretty easy.
Use the Display menu -> Text Attributes -> Line info to see how many styles there are, and what they contain. In your example the spell name will probably be style 2 and contain (say) "Invis". Just use GetStyleInfo to find what *colour* that style is. |
- 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.
15,094 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top