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


Joined: 11 Jul 2002
Posts: 1

PostPosted: Tue Sep 17, 2002 7:23 am   

database eq help
 
i've been trying to make triggers to put in new entries into the database but for some reason it just wont work. my input is in yellow.

<375hp 661m 357mv> cast identify staff
Object 'staff magehunter' is type weapon, extra flags glow hum magic anti-evil.
Weight is 3, value is 0, level is 39.
Weapon type is polearm.
Damage is 4d12 (average 26).
Weapons flags: shocking
Affects damage roll by 7.
Affects hit roll by 6.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Sep 18, 2002 4:29 am   
 
And the question is?

Create a class to keep these triggers in. You can then use the #T+ command to enable the class and the #T- command to disable it, so the triggers will only be active when you're doing an identify. The #T+ command can either be in an alias for the "cast identify" command, or in a trigger for the first line. In either case, this command should also set the record variable to null, so that you don't carry over any data from the last identify.

The #T- command should be in a trigger which fires on whatever line will follow the id info -- this may be a blank line (#TR {$}) or it may be your prompt (be sure to use the nocr and prompt options). This trigger should also contain the #NEW command.

Your other triggers will be one (or more) for each line you expect to get and will use the #ADDKEY command to place the data into the record variable.

#AL id {#VAR identify %null;#T+ identify;cast identify}
#CLASS identify disable;#CLASS 0
#TR {^Object ~'(*)~' is type (*)} {#ADDKEY identify name {%1};#ADDKEY type {%2}}
#TR {extra flags (*).$} {#ADDKEY identify flags {%1}} {identify}
#TR {^~<%dhp %dm %dmv~>} {#T- identify} {#NEW all identify} {identify} {nocr|prompt}


Again, you really didn't ask a question. I hope this addressed what you wanted to know.

LightBulb
Senior Member
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