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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Rugbystyle
Wanderer


Joined: 07 Oct 2001
Posts: 71

PostPosted: Tue Aug 26, 2003 11:06 pm   

Multiline variable length trigger
 
I want a trigger that will fire on the entire pattern out put by the mud. IE "Bob slashes into you with a wickedly barbed war-axe, the blow carrying enough weight to severe your arm." I want to trigger to fire on that entire pattern and that entire pattern only.
My problem is, the wrap is at 72 characters. Now depending on WHO is attacking me like such; the length of their name can force the wrap at different places in the line. Is there an effecient and easy way to have zmud fire on "%w slashes into you with a wickedly barbed war-axe, the blow carrying enough weight to severe your arm." With the line break being in a variable location?

Any help would be appreciated. Thanks.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Aug 27, 2003 3:30 am   
 
No, there aren't any easy and efficient ways to do this. The easy and efficient way is to use a shorter section of the phrase which has a better chance of all appearing on the same line, but you've already rejected that.
Reply with quote
nabob
Beginner


Joined: 01 Aug 2004
Posts: 10

PostPosted: Wed Nov 22, 2006 2:13 pm   
 
Im trying to match 2 words:

Damage: 496

The problem is that because of variabe line lengths, I often get a line break in between damage: and the number.

I tried converting my pattern to regex and using /n but never used regexp before and don't know how to put it between.

"damage /n /d" does not work, and prevents it from firing when there is no linebreak between them.

any suggestions?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Wed Nov 22, 2006 3:28 pm   
 
Probably better thread etiquette to start a new topic rather than paste over an old one.

In zScript You can use the %s to match a variable amount of space.

ie
#TRIGGER {Damage~:%s(%d)} {#PCOL orange %x1}

Could use the regex convert in zMud to see what that translates to.
Reply with quote
nabob
Beginner


Joined: 01 Aug 2004
Posts: 10

PostPosted: Fri Nov 24, 2006 5:51 pm   
 
[quote="TonDiening"]Probably better thread etiquette to start a new topic rather than paste over an old one.

Pardon me. I thought it to be the same topic.

Thanks for the idea. I will try it.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Fri Nov 24, 2006 5:59 pm   
 
#TRIGGER {Damage~:%s(%d)} {#PCOL orange %x1}
#TRIGGER {Damage~:*$(%d)} {#PCOL orange %x1}

Ah I skimmed and missed the idea that the two could be on different lines.
You probably will need two triggers to quickly process the possibilities.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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