MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Jul 16, 2005 7:03 pm |
I'm assuming your prompt shows up immediately after this list (I'm assuming yes)? Also, are all your items strictly alphabetic or are there special symbols used as well (I'm assuming alphabetic, given your example)? Finally, can a single critter hold duplicate items (I'm assuming yes)?
I'm thinking there's a way to do this via multi-state triggers as well, but I'm not well-versed in many of the state types. Anywho, here's a more basic version:
#trigger {The corpse of the (*) holds:} {#T+ tCorpseItemList;vCorpseItemList = "";vCorpseItemsFound = 1}
#trigger {line that indicates nothing was on the corpse} {vCorpseItemsFound = 0}
#trigger "tCorpseItemList" {%q([a-z ])%q} {vCorpseItemList = %additem("%1",vCorpseItemList)}
#alias CheckCorpseItems {#dbload ident;#query (&Name = %item(vCorpseItemList,1);#if (%null(%rec)) {#new "" Name=%item(vCorpseItemList,1);#delnitem vCorpseItemList 1};#DBCLOSE}
In the prompt trigger, include these lines:
#T- tCorpseItemList
CheckCorpseItems
This is untested, so no guarantees it will even work. However, the three triggers do nothing but populate a stringlist. The first one initializes variables and turns on the capturing trigger. The second one is for those cases when the corpse is empty, no need to check the database then. The third trigger is for any items that might be on the corpse. These are contained in the vCorpseItemList variable to be passed along to the alias. The prompt trigger then shuts down the capturing trigger so that it can't accidentally fire on some other list and executes the checking alias. |
|