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


Joined: 09 Dec 2003
Posts: 4
Location: Canada

PostPosted: 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
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: 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.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
pfloyd
Newbie


Joined: 09 Dec 2003
Posts: 4
Location: Canada

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Dec 12, 2003 1:05 am   
 
#IF ("%1" = "The Glowing Tip of a Fireworm~(blue~)") {#VAR EQset mana}
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: 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.
Reply with quote
pfloyd
Newbie


Joined: 09 Dec 2003
Posts: 4
Location: Canada

PostPosted: Fri Dec 12, 2003 8:21 pm   
 
Thx Toetag works perfectly.. :)
Reply with quote
Toetag
Magician


Joined: 10 Oct 2000
Posts: 356
Location: USA

PostPosted: 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)
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