Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
David_Crowder
Newbie


Joined: 07 Feb 2012
Posts: 3

PostPosted: 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.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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>
Reply with quote
David_Crowder
Newbie


Joined: 07 Feb 2012
Posts: 3

PostPosted: 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.
Reply with quote
David_Crowder
Newbie


Joined: 07 Feb 2012
Posts: 3

PostPosted: 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>
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net