|
Sending Colored text to the world.
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Poromenos
Greece (1,037 posts) bio
|
| Date |
Fri 15 Nov 2002 04:03 PM (UTC) [ quote
] |
| Message |
Once again, after a long time, i bring this subject to light :p
I get the following line when i "look":
<Flg[HSY] Hp[1244/1228] Mana[1713/1713] Wgt[241/350] Go[252,429] Auc[]>The Marketplace
I can make it color the prompt blue using "^\<.*?\>", or i can separate it using "^(\<.*\>)(.*)$" and sending:
%1
%2
to the output. But i need it to be BOTH colored AND separated, i.e. Blue prompt and below it the text... how can i do that? (Using triggers) |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | top |
|
| Posted by |
Nick Gammon
Australia (18,797 posts) bio
Forum Administrator |
| Date |
Reply #1 on Fri 15 Nov 2002 07:08 PM (UTC) [ quote
] |
| Message |
| You would have to use a script, and display the two wildcards in different colours using world.colournote. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Poromenos
Greece (1,037 posts) bio
|
| Date |
Reply #2 on Sat 16 Nov 2002 03:03 PM (UTC) [ quote
] |
| Message |
| Why is it though, that if i use both triggers, one to colour and one to separate, the second trigger colours the line again? I mean, I have "no change" selected, yet the line that gets displayed is not blue, even if it was colored blue before! |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | top |
|
| Posted by |
Nick Gammon
Australia (18,797 posts) bio
Forum Administrator |
| Date |
Reply #3 on Sat 16 Nov 2002 09:08 PM (UTC) [ quote
] |
| Message |
| Can you post both triggers? I mean to select both, use the "copy" button, and paste them here, so I can comment better. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Poromenos
Greece (1,037 posts) bio
|
| Date |
Reply #4 on Sun 17 Nov 2002 12:25 AM (UTC) [ quote
] Amended on Sun 17 Nov 2002 12:56 AM (UTC) by Nick Gammon
|
| Message |
Here they are:
<triggers>
<trigger
custom_colour="5"
enabled="y"
ignore_case="y"
keep_evaluating="y"
match="^\<.*?\>"
regexp="y"
sequence="997"
>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^(\<.*?\>)(.*)$"
omit_from_log="y"
omit_from_output="y"
regexp="y"
repeat="y"
send_to="2"
sequence="998"
>
<send>%1
%2</send>
</trigger>
</triggers>
The 1st one seems to have no effect in this context... It colours normally if i disable the splitting one |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | top |
|
| Posted by |
Nick Gammon
Australia (18,797 posts) bio
Forum Administrator |
| Date |
Reply #5 on Sun 17 Nov 2002 01:02 AM (UTC) [ quote
] |
| Message |
The first one colours the line, but the second one omits it from output, so it is omitting the coloured one from output. Then your second one displays the line in the world note colour.
You really need just one trigger, that doesn't display anything directly. It calls a script that then displays the two wildcards in the desired colour. eg.
sub mytrigger (sname, sline, wildcards)
world.colournote "blue", "black", wildcards (1)
world.colournote "red", "black", wildcards (2)
end sub
|
- 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.
1,300 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )