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
nostra
Wanderer


Joined: 23 May 2001
Posts: 68
Location: Sweden

PostPosted: Tue Jun 10, 2003 4:06 pm   

IF "value" not in a stringlist do "this"...
 
My character has a few regular beneficiary spell-affects that comes from wearing a special item. Occassionally the spell-affect is dispelled and I need to re-wear the item again.

I want to write a trigger that covers this, that is:
1. Checks my current spell-affects
2. Compare these spell-affects with a "master string list" that contains ALL "regular spell-affects".
3. If some of the spell-affects are missing I want to re-wear that particular item.

The way I think about it this covers at least two (maybe three) different lists:

List1 (stringList): Stores my current spell-affects
List2 (recVariable): Stores all beneficiary spell-affects AND which item it belongs to.

EXAMPLE
List1:
pass door
fireshield

List2:
pass door = mask
fireshield = boot
armor = helm
sanctuary = amulet

So, in this case I'm missing two beneficiary spells (armor and sanctuary) and hence I want the trigger to rem helm; wear helm; rem amulet; wear amulet.

From a similar posting I received following line from LightBulp but I'm unable to use it in this particular example...

#FORALL @stringlist2 {#IF (%ismember( {%i}, @stringlist1)) {} {cast %i}}

Any help as always much appreciated!

/Mikael
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 10, 2003 5:16 pm   
 
The only real difficulty here is the trigger to create the first variable and initiate the actions. Can't do that for you, since I don't know how you get the information or how you tell when you've reached the end of it. The simplest answer, of course, is to just remove and rewear everything in the second variable.

#ADDK List2 {pass door=mask|fireshield=boot|armor = helm|sanctuary=amulet}
#TR {Pattern to match affects listing} {#ADDI List1 {%1}}
#TR {Pattern to indicate end of affects listing} {#LOOPDB @List2 {#IF (%ismember( %key, @List1)) {} {remove %val;wear %val}};#VAR List1 {}}

LightBulb
Advanced Member
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