Sending Colored text to the world.

Posted by Poromenos on Fri 15 Nov 2002 04:03 PM — 6 posts, 15,255 views.

Greece #0
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)
Australia Forum Administrator #1
You would have to use a script, and display the two wildcards in different colours using world.colournote.
Greece #2
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!
Australia Forum Administrator #3
Can you post both triggers? I mean to select both, use the "copy" button, and paste them here, so I can comment better.
Greece #4
Here they are:


<triggers>
  <trigger
   custom_colour="5"
   enabled="y"
   ignore_case="y"
   keep_evaluating="y"
   match="^\&lt;.*?\&gt;"
   regexp="y"
   sequence="997"
  >
  </trigger>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^(\&lt;.*?\&gt;)(.*)$"
   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
Amended on Sun 17 Nov 2002 12:56 AM by Nick Gammon
Australia Forum Administrator #5
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