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
webalchemy
Newbie


Joined: 25 Jan 2015
Posts: 2

PostPosted: Sun Jan 25, 2015 7:42 am   

Multiple lines in a trigger
 
Hi all -

I'm trying to write a trigger to capture item info and write to a database. When the item info is displayed on screen, the actual item detail begins on line 4 of the output, and I can't figure out how to get CMUD to correctly obtain the data. Here's an example of output:

Melizar the Sage tells you 'Ahhh... a long black cape...'
Melizar the Sage tells you 'Hrmm... YES, I know of this item... '

Item Keywords: cape black
Size: Normal, Composition: Silk, Weight: 6
Min Level: 20, Cost: 114000, Rent/day: 22800

This item is classified as ARMOR, with the following modifiers:
Equip Positions: TAKE NECK
Additional Modifiers: MAGIC


I'm trying to get my trigger to read the data immediately after the words "Item Keywords:" on line 4. I've tried several attempts at using regex to skip down (some below)... but none work, as no data ever gets assigned in #ADDKEY.

#TRIGGER {*Item Keywords: (*)} {#ADDKEY Item {Name="%1"}}

#TRIGGER {*$*$*$Item Keywords: (*)} {#ADDKEY Item {Name="%1"}}

etc...

How can I tell CMUD to skip the first 3 lines? Thank you!

Doug
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Sun Jan 25, 2015 8:49 am   
 
Don't worry about how many lines come between.

#TR {Item Keywords: (*)} {#ADDKEY Item Name %1}
_________________
Discord: Shalimarwildcat
Reply with quote
webalchemy
Newbie


Joined: 25 Jan 2015
Posts: 2

PostPosted: Sun Jan 25, 2015 9:17 pm   
 
Hi Shalimar - yes, tried that too... nothing.

It's weird, from the example above, if I use:

#TR {Melizar (*)} {#ADDKEY Item Name %1} melizar

then it works fine, and returns the string: the Sage tells you 'Hrmm... YES, I know of this item... '

so it does work (though notice it pulls the second occurrence of the work Melizar). I just can't get it to find the string match on the 4th line. Very frustrating.
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