 |
pfloyd Newbie
Joined: 09 Dec 2003 Posts: 4 Location: Canada
|
Posted: Tue Dec 09, 2003 10:36 pm
data record? for eq slots.. |
Hi all..
WHat I wanna do is a buton to change between my eq sets..
that is pretty simple but what I have trouble with is making a trigger to get what I am wearing at the moment..
My mud (imperial 3.5)
is showing eq that way..
You are using:
<used as light> The Glowing Tip of a Fireworm(blue)
<worn on finger> A small bronze band(blue)
<worn on finger> a ring of defence
<worn around neck> Snake pendant(blue)
<worn around neck> Green silk scarf
I want a trigger to get what comes after every slots..
ex:
<used as light>(%s)(%w)
but that will only catch the first word right?
Also I want zmud to know that:
The Glowing Tip of a Fireworm(blue)= tip
for that I think I should use data record but dunno how to use them and cant find any help for them in help files?
after that should be fairly easy to make my buttoon work..
thx in advance..
Luigi |
|
|
|
 |
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Wed Dec 10, 2003 3:04 am |
Check the help file for pattern matching. (*) is what you want.
Trigger:
^<used as light> (*)
#IF (%1 = The Glowing Tip of a Fireworm~(blue~)) {#VAR light tip}
This isn't the cleanest way but i don't use the DB functions to answer it any other way. |
|
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Dec 10, 2003 4:03 am |
The other is to capture the 'keyword' that was used to wear the item. Keep a string list of the keywords for each eq set then go through them all with a #FORALL
|
|
|
|
 |
pfloyd Newbie
Joined: 09 Dec 2003 Posts: 4 Location: Canada
|
Posted: Thu Dec 11, 2003 6:49 pm |
Heres is what ive done..
#CLASS {EQ}
#VAR EQset {creation}
#TRIGGER {~<used as light> (*)}
{#IF (%1 = The Glowing Tip of a Fireworm~(blue~)) {#VAR EQset mana};
#IF (%1 = Underwater Lantern~(blue~)) {#VAR EQset AC};
#IF (%1 = Serenna's Orb) {#VAR EQset creation}}
#CLASS 0
but the ifs arent working corectly?
whatever im holding it will aways put creation in var eqset..
so whatever i do its always the last if that has final word.. :P
whats wrong?
Luigi |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Dec 12, 2003 1:05 am |
#IF ("%1" = "The Glowing Tip of a Fireworm~(blue~)") {#VAR EQset mana}
|
|
|
|
 |
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Fri Dec 12, 2003 3:54 am |
here's another option with out all the #IF's and not using a DB. I just learned this a few minutes ago.
#VAR lightsource {firearm}
#VAR lightsource_1 {The Glowing Tip of a Fireworm(blue)|Firearem of Light|Flashlight}
#VAR lightsource_2 {tip|firearm|batteries}
#TRIGGER {^~<used as light~> (*)$} {#IF (%ismember( %1, @lightsource_1)) {@lightsource = %item( @lightsource_2, %ismember( %1, @lightsource_1));#SHOW @lightsource}}
Create 2 variable lists (called mine lightsource_1 and lightsource_2. In list one, put the REAL text. In list 2, put in the text that's to replace the text from list 1.
I've only made one trigger for your "<used as light>" example.
it captures the text, scans list one, if text is a member of list one, it then gets the text from list 2 that is in the same index number as list 1. (ie: List1 index 1: The Glowing Tip of a Fireworm(blue) List2 index 1: tip)
Now this will only work if 1) the text matches an item in list 1 2) each list is synchronized. 3) note that variable lists are case sensitive (ie: flashlight and Flashilight can be in the same variable list. neither can match the other as well)
You can take out the #SHOW line. I only had that in there for testing. So long as list1 and list2 match 1-1 2-2 3-3, etc. it should work just fine. |
|
|
|
 |
pfloyd Newbie
Joined: 09 Dec 2003 Posts: 4 Location: Canada
|
Posted: Fri Dec 12, 2003 8:21 pm |
Thx Toetag works perfectly.. :)
|
|
|
|
 |
Toetag Magician
Joined: 10 Oct 2000 Posts: 356 Location: USA
|
Posted: Fri Dec 12, 2003 9:06 pm |
no problem pfloyd. I've been wanting this functionality for years not realizing the %ismember function actually did it for me. (i should have probably read the darn help file for that function more than once every 2-3 years)
|
|
|
|
 |
|
|
|