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


Joined: 31 Oct 2005
Posts: 4

PostPosted: Mon Oct 31, 2005 9:44 pm   

Trigger to match data record and return index
 
This seems like it is do-able, I just can't figure it out. I create a variable and make it a data record. I set the record up to have 2 columns, one column for a description of a mob, and a column for the corresponding mobs keyword. The array looks something like this (note that the labels A and B are not part of the record just there for discriptional purposes:

A ============================ B
A suspicious looking man is standing here. |drug
A singing, happy Drunk. |drunk
A grubby beggar sits here in the filth. |beggar
A young Street punk is loitering here. |punk

What I want to do is create a trigger that will be set off if it sees anything in column A of the spreadsheet, and return to kill the corresponding keyword from column B.

So if I walk into a room:

A suspicious looking man is standing here.

The trigger returns:

kill drug

Please help.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Oct 31, 2005 10:21 pm   
 
*smirk chuckle*

My other post in response to your question was providing the way to have maximum expandability with a decrease in user handling and overhead storage, but increased processing cost. This way is simpler, but has prices in speed as the record grows and of course requires you to locate and store the data yourself.

#TRIGGER {^({@MobShortDescs})$} {kill %db(@MobShortDescs,"%1")}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
patrck17
Newbie


Joined: 31 Oct 2005
Posts: 4

PostPosted: Mon Oct 31, 2005 10:45 pm   
 
Hehe, its my fault I can never really describe exactly what I need with these forums. This works out the problem completely, thanks for the help!
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