|
Tvesh Newbie
Joined: 13 May 2002 Posts: 6 Location: Belgium
|
Posted: 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 |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: 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. |
|
|
|
Tvesh Newbie
Joined: 13 May 2002 Posts: 6 Location: Belgium
|
Posted: 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? |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: 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.
|
|
|
|
Tvesh Newbie
Joined: 13 May 2002 Posts: 6 Location: Belgium
|
Posted: 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 :)
|
|
|
|
NiteTrip Novice
Joined: 21 May 2002 Posts: 40 Location: Canada
|
Posted: 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 :)
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
|
|