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


Joined: 13 May 2002
Posts: 6
Location: Belgium

PostPosted: Mon May 13, 2002 12:32 pm   

Please help with making of Trigger
 
I've been working on an indentify trigger that'll enter the results of the identify into the Zmud DB. I've been following the Zmud help file on this subject, and it's been helpful, but i can't get the last bit right. Below i've pasted the result of an identify from the Mud i play on. I've been able to get most of the data i need into the DB, except for the bottom part of the Identify. As you can see this is the part where the special properties of the item appear. (Affects) There can be up to 3 affects to an item. I'm at a loss as to how i can capture each affect line and put them into the DB. Can someone PLEASE advice?

TIA



You recite a scroll of identify which dissolves.
You feel informed:
Object 'a crystal orb', Object type: Light
Object is: Glow
Object is made of: Magic Gem
Object is restricted: Level_20
Weight: 5, Value: 25000, Size: average
Hours remaining: 0
Object Affects :
Affects : Sense_Life By 1
Affects : Sense_Obj By 1
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Mon May 13, 2002 1:05 pm   
 
If you will follow these links to the Finished Mud Scripts Forum...

This is one way of doing it.
This is another way of doing it. (Scroll down to the last message).

Hope this helps.
Reply with quote
Tvesh
Newbie


Joined: 13 May 2002
Posts: 6
Location: Belgium

PostPosted: Mon May 13, 2002 1:32 pm   
 
Thanks for the links!

Man, this scripting is complicated...:(

So I need to make a seperate trigger for each possible affect if i'm correct?
Reply with quote
Pega
Magician


Joined: 08 Jan 2001
Posts: 341
Location: Singapore

PostPosted: Mon May 13, 2002 4:55 pm   
 
There are very many ways to do it. You could use a single trigger to capture all types of affects. Simply use a string list in the trigger, and match all known affects using a variable name concatenation.
Reply with quote
Tvesh
Newbie


Joined: 13 May 2002
Posts: 6
Location: Belgium

PostPosted: Mon May 13, 2002 9:43 pm   
 
I'm really sorry, but this whole scripting thing is beyond me...Is there anyone who'd be kind enough to show me the trigger needed to analyze this identify so i can use it? (with eternal gratitude :)
Reply with quote
NiteTrip
Novice


Joined: 21 May 2002
Posts: 40
Location: Canada

PostPosted: Mon May 27, 2002 3:32 am   
 
I am having the same problem, and I am trying to fix it. i will let you know when I do.. I want to capture everything after the Object Affects: line into a comment field in the database, i think this is the all around best way to do it. so stay tuned :)
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon May 27, 2002 12:22 pm   
 
If there can only be up to three affects, you can use this facts to simplify things a bit. With this in mind, you would then need to create three triggers to match the different possibilities. Example:
#TRIGGER {Object Affects:$Affects : (*) By (%d)} {commands}
#TRIGGER {Object Affects:$Affects : (*) By (%d)$Affects : (*) By (%d)} {commands}
etc.


Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon May 27, 2002 4:50 pm   
 
A complicated way of doing this, for those who prefer complexity to multiple triggers:
#VAR affects {}
#TR {^Affects: (*)} {#IF (%len(@affects)=0) {#VAR affects {%1}} {#VAR affects {@affects, %1}}}
#ADDKEY @DBvar affects {@affects}

The #VAR command will need to be in your initializing trigger, where you clear the database variable.
The #ADDKEY command will need to in your final trigger (or any trigger that will follow the list of affects), before the command to add the data to the database. This gives you a comma-separated list of affects, which is suitable for a Comment-type field.

LightBulb
Vague questions get vague answers
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