|
connor Newbie
Joined: 01 Feb 2004 Posts: 2 Location: Sweden
|
Posted: Sun Feb 01, 2004 2:22 am
problems with record Item |
I have tried to capture identify scroll from the med but dont succes.
how should I compose the Triggers, Alias etc 4 capture identify scrolls from the mud just like that below?
You recite a scroll of identify.
Object 'sword standard merc' is type weapon.
Extra flags: magic.
Weight is 5, value is 1280, level is 16.
Wear location is wield.
Weapon type is sword.
Damage is 3d5 (average 9).
Affects hit roll by 1.
Affects damage roll by 1.
#ALIAS identify {#T+ identify;#VAR Item "";cast identify %1}
#TRIGGER {Name: &Item.Name Type: &ItemType} {} identify
#TRIGGER {Cost: &Item.Cost} {} identify
#TRIGGER {Weight: &Item.Weight} {} identify
#TRIGGER {Damage: &Item.Damage} {} identify
#TRIGGER {Hit: &Item.Hit} {} identify
#TRIGGER {Dam: &Item.Dam} {} identify
#TRIGGER {$} {#T- identify;#IF (!%null(@NewItem)) {#NEW @ItemType @Item}} identify |
|
|
|
musishun00 Wanderer
Joined: 16 Dec 2003 Posts: 77 Location: USA
|
Posted: Sun Feb 01, 2004 10:48 am |
Looks to me like your only problem is that everything has the same name. Try this, which puts it all into a class folder and does it that way.
#ALIAS identify {#T+ ident_trigs;#VAR Item "";cast identify %1}
#CLASS ident_trigs
#TRIGGER {Name: &Item.Name Type: &ItemType} {}
#TRIGGER {Cost: &Item.Cost} {}
#TRIGGER {Weight: &Item.Weight} {}
#TRIGGER {Damage: &Item.Damage} {}
#TRIGGER {Hit: &Item.Hit} {}
#TRIGGER {Dam: &Item.Dam} {}
#TRIGGER {$} {#T- ident_trigs;#IF (!%null(@NewItem)) {#NEW @ItemType @Item}}
#CLASS 0
I'm not entirely positive this will do what you want, but it should at least get you put on the right track. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Feb 01, 2004 9:01 pm |
You probably shouldn't use the same name for the alias that you are using for the trigger class. This presents the possibility of having the alias disabled when you meant for the class to be disabled. I'd recommend renaming the alias to "id" or "ident".
Your trigger patterns don't match the MUD output. The first line of information from the MUD is
Object 'sword standard merc' is type weapon.
and you are trying to match it with the trigger
#TRIGGER {Name: &Item.Name Type: &ItemType} {} identify
but the line doesn't contain the text Name: or Type:. It does contain the word "type", but there is no colon following it.
Since the patterns don't match the MUD, the triggers won't fire. A correct trigger would look something like:
#TR {Object '&Item.Name' is type &{Item.Type}.} {} identify
You would probably benefit from reading all the help topics on Triggers and Patterns, as well as the topics on Databases. |
|
|
|
|
|