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
Skaphia
Beginner


Joined: 18 Dec 2002
Posts: 27
Location: USA

PostPosted: Mon Sep 22, 2003 10:05 pm   

Trigger Help for Database
 
I am building a database script for items in my mud. So far I have every field covered except how to trigger the following:

Object 'a wraith weapon'...
It is a level 18 staff, weight 5.
Locations it can be worn: hold
Special properties: hum
This staff has a gold value of 1290.
Has 7(7) charges of level 28:
'wraith bomb'


The bold and italics fields are the ones I cannot get to work. How do I make a trigger that gathers the information from both lines? I don't know how to do multiple line triggers [xx(]
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Mon Sep 22, 2003 10:13 pm   
 
Been a while since I did this type of trigger. you may want to look into how people do some of the other multi-line triggers.

#tr {Has 7(7) charges of level 28:$'wraith bomb'} {dosomething}

try something like that or..


#tr {Has (%d)~((%d)~) charges of level (%d)~:$'(*)'} {say %1 or %2 charges for spell %4 at level %3}

PS - This code is NOT tested.
Reply with quote
Skaphia
Beginner


Joined: 18 Dec 2002
Posts: 27
Location: USA

PostPosted: Tue Sep 23, 2003 1:26 am   
 
So far that hasn't been of any use at all. Have any other suggestions?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Sep 23, 2003 4:59 am   
 
Talahaski's trigger captures ALL the variable portions of the pattern. Anything you could possibly want in the database is right there in %1 to %4. It's a shame that you just dismiss his answer, since there's nothing left to suggest that will glean any additional information from that section of the identify.

The only thing left is to decide what information needs to go into the database, what fieldtype would be best for each piece of information, and what to name the fields, and then make those fields and use the appropriate commands to store the information in the database. If you were able to cover the rest of the database, that shouldn't be any problem at all.
Reply with quote
Talahaski
Enchanter


Joined: 10 Oct 2000
Posts: 656
Location: USA

PostPosted: Tue Sep 23, 2003 3:42 pm   
 
Please be more specific on what aspect of the trigger is not working. Is the trigger firing on your input? Is the trigger not writing to the database - I did not give you code for writing to the database.

Give me a few more example. If it's not firing perhaps there are some spaces that have not been accounted for.

#tr {Has (%d)~((%d)~) charges of level (%d)~:%s$%s'(*)'} {say %1 or %2 charges for spell %4 at level %3}

Also tell us how you have your database set up and what the field names/types are.
Reply with quote
Skaphia
Beginner


Joined: 18 Dec 2002
Posts: 27
Location: USA

PostPosted: Wed Sep 24, 2003 7:39 pm   
 
It is truly a shame that you assume I dismissed Talahaski's answer. It was of minimal help as I mentioned. The problem I am having is that the solution given still does not capture the information on the first line.. it only captures the second line. Perhaps it is a version issue. I am on 5.55, maybe that is why. As always, all feedback is appreciated. And, since all of my fields are already set (as I said.. yay reading), that isn't an issue either. Perhaps it is my version of Zmud.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 24, 2003 9:09 pm   
 
Your text
Has 7(7) charges of level 28:
'wraith bomb'

Talahaski's trigger. There's nothing in it that wasn't available in version 5.55
#tr {Has (%d)~((%d)~) charges of level (%d)~:$'(*)'} {say %1 or %2 charges for spell %4 at level %3}

%1, %2, and %3 all match things on the first line, %4 is almost the entire second line. I don't expect that any of the other text on the first line will change. What is it you want on the first line that isn't being captured?

As Talahaski said, please be more specific.
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