 |
David_Crowder Newbie
Joined: 07 Feb 2012 Posts: 3
|
Posted: Tue Feb 07, 2012 5:25 pm
Multiline Coloring |
I'm rather new to trying to do cMUD scripting. I've stumbled through some of the more basic line coloring #TRIGGERS but I an unable to get a trigger to work that starts with one line colors everything in between and ends with a different line.
ex:
Code: |
-- WhatIsZ Extended V1.0.0.1 WF ---------------------------------[ Room View ]
Name1 misc information
more misc information
Namename2 misc information
Name3 misc information
-------------------------------------------------------- by K'T/AnnonyMouse --
|
I'm trying to set all of this into a certain color. I can trigger on the first line or the last line, but everything the middle is left uncolored...I can't trigger on anything specific in the middle nor set it as a specific number of lines as it will change depending on how many people are in the room and how much information per person. |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Tue Feb 07, 2012 7:36 pm |
Try this:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger priority="40530" verbatim="true" copy="yes">
<pattern>^-- WhatIsZ Extended V1.0.0.1 WF ---------------------------------[ Room View ]$</pattern>
<value>#CW red</value>
<trigger type="Manual">
<pattern>^(*)$</pattern>
<value>#CW red
#IF %match(%1, "^-------------------------------------------------------- by K'T/AnnonyMouse --$") {#STATE 0}</value>
</trigger>
</trigger>
</cmud> |
|
|
|
 |
David_Crowder Newbie
Joined: 07 Feb 2012 Posts: 3
|
Posted: Wed Feb 08, 2012 11:52 pm |
Thanks...had to change the #CW to #COLOR for it to fully work, but what you provided was a great help Daern.
|
|
|
 |
David_Crowder Newbie
Joined: 07 Feb 2012 Posts: 3
|
Posted: Sun Feb 12, 2012 6:38 pm |
Another question folks. I tried to modify the above code to trigger on "(" and ")" but nothing happens.
<trigger priority="73" verbatim="true" id="35">
<pattern>^~(*</pattern>
<value>#CW cyan</value>
<trigger type="Manual">
<pattern>^(*)$</pattern>
<value>#CW cyan
#IF %match(%1, "^~)*") {#STATE 0}</value>
</trigger>
</trigger> |
|
|
 |
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sun Feb 12, 2012 7:28 pm |
The ^ means only match at the start of the line. I'm guessing the ) isn't the first character on the line you're trying to match on...
|
|
|
 |
|
|