 |
vileplume Novice
Joined: 26 Dec 2001 Posts: 43 Location: USA
|
|
|
|
 |
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: Wed Dec 26, 2001 1:43 am |
Whether you're after specific wear-locations that must be wearing something, or specific pieces of equipment that must be present, this idea should suffice...
Create a variable that contains a list of the wear-locations (or item descriptions) you want to check against. For instance "wielding"|"hands"|"wearing"|"torso"|etc. or "bronze rapier"|"gloves of darkening"|"green hunters cloak"|etc.
Make sure the variable includes all 32 locations/items you want to check against, and that each item in the list is unique... i.e. no "gold ring"|"gold ring" stuff, or that'll mess with my logic.
That variable will be MasterList.
You'll create an #alias named invlist that does this: #t+ InvList;ThisList = @MasterList;~invlist. The first command turns on the trigger class InvList, the second copies the MasterList variable into a ThisList instance. The last command sends the "invlist" command to the mud. The ~ in front of the command makes zMUD ignore the command (so as not to repeatedly fire this alias).
Next up you'll create a trigger, presumably on the pattern ^You(*).. That matches the descriptions you gave, if there are any that are different you might need more than one trigger with different patterns to match the alternative formats.
The command of the trigger should be something like:
#Forall @ThisList {#if (%pos(%i, %1) > 0) {#delitem ThisList %i}}
Put the trigger in the InvList class.
Create another trigger on the text "You are in possession of %d items." and make the command for that one #t- InvList;#show --------;#forall @ThisList {#Show Missing: %i}
Put this trigger in the InvList class too.
I don't have zMUD handy to create and test this as I think about it, but you should get something like:
>invlist
You are wielding a bronze rapier.
Your hands are concealed by gloves of darkening.
You are wearing a green hunters cloak of camoflauge.
Your torso is protected by a silver breastplate.
You are wearing a gold ring of blessings on your right index finger.
You are wearing a silver ring of starlight on your right middle finger.
You are in possession of 32 items.
--------
Missing: a golden helm
Missing: solid silver boots
Missing: your favorite item
(Assuming the three example items I named are in your MasterList variable).
To maintain this system, just update the MasterList variable whenever you get new eq.
This is untested.
zMUD 6 Online Help: All the power you'll ever need. |
|
|
|
 |
vileplume Novice
Joined: 26 Dec 2001 Posts: 43 Location: USA
|
Posted: Wed Dec 26, 2001 2:40 am |
Thank you, Darker, for your excellent suggestion. Although I do generally understand the process, I have one question that I would like to ask before I try this.
You mention creating a trigger on the pattern ^You(*) to match the beginning of each line of text descriptions in the list. I'm wondering, though, will this trigger be activated ANYTIME a line beginning with you is displayed? The reason I ask this is that periodically during a session, I will get a message such as: You are hungry, You are thirsty, You need sleep, etc. These messages appear quite frequently and it would not be desireable to have anything related to this process occur based on them.
Once again, thanks a bazillion!
P.S. in your message, I was unclear as to whether the trigger in question:
^You(*) would include a period after it or not. You typed it as ^You(*). but I wondered if you meant to end the sentence with the period or if that was part of the syntax I should use when creating the trigger. |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Wed Dec 26, 2001 3:01 am |
The trigger set up Darker suggested is turned on by the alias and turned off by its final trigger. The only things I would suggest to change in that setup is to make the class name different from the alias name.
You may wish to make the logic a little more complex so that it can higlight lines that contain something new. If your interested in doing that you should look up the SUB command. |
|
|
|
 |
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: Wed Dec 26, 2001 2:08 pm |
quote:
will this trigger be activated ANYTIME a line beginning with you is displayed?
Nope, it'll only fire on lines starting with You while the class is turned on (it's turned on by the invlist alias), and the 2nd trigger in the class turns itself off when it's done looking at your items.
quote:
P.S. in your message, I was unclear as to whether the trigger in question:
^You(*) would include a period after it or not.
I intended it to include the period, but it'll work either way.
Vijilante's got a good idea about the trigger class name. It might be a good idea to make it similar, but not the same as the alias.
zMUD 6 Online Help: All the power you'll ever need. |
|
|
|
 |
vileplume Novice
Joined: 26 Dec 2001 Posts: 43 Location: USA
|
Posted: Wed Dec 26, 2001 7:09 pm |
Thank you for your help. This seems to be working fine. Now, however, my speed menu is not happy. If you feel like taking a crack at that one please do!
|
|
|
|
 |
|
|
|
|
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
|
|