|
darantares Newbie
Joined: 14 Dec 2005 Posts: 6
|
Posted: Mon Apr 07, 2008 3:50 am
Multi-Line Trigger Question |
Good evening, folks.
I'm trying to write a trigger where sometimes the output from the mud is two lines, sometimes it is one. This is what the output looks like:
You jab a blade-tipped glaive towards Vivian, piercing through and shattering
her aura of rebounding.
You jab a blade-tipped glaive towards Kais, piercing through and shattering his
aura of rebounding.
I know of the \n command, but am having problems as to where to place it as which word is the start of the new line depends on how long the targets name is.
Any information would be most helpful.
In adventure,
Dan |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Apr 07, 2008 4:30 am |
The standard answer that you will receive for this question is see if you turn off server side word wrapping.
This greatly simplifies making triggers of this type. If you still want the text to wrap like it did before you can use Zmud's word wrapping feature.
Ok, the obligatory server side word wrapping advice given here is how I do this when I cannot turn off server side word wrapping.
Regex Pattern: (You jab a blade-tipped glaive towards \w+, piercing.*)\n(.*rebounding\.)
Value:
#if (%concat(%1," ",%2)=~"You jab a blade-tipped glaive towards %w, piercing through and shattering {his|her} aura of rebounding.") {#pcol mxpred 0 100 1 0}
Of course you could use regex in your if if you wanted to or match.
I used mxpred for the color in this example you could use whatever color.
The 0 100 1 0 means start at the first letter of the line above the one that matched this trigger and color through the 100th stop coloring with the 100th letter of this line. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Apr 07, 2008 4:32 am |
I'm sure there is a way to speed that up, but hopefully you will be using the server side word wrapping and someone will post a speed improvement on my suggestion as well.
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
|
|