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


Joined: 02 Feb 2003
Posts: 99
Location: Seattle, Wa

PostPosted: Wed Jul 12, 2006 4:25 pm   

comparing stringlist confusion into oblivion
 
Ok after trying to figure this out through the forums search I've completely confused myself.

What I want to do is take a master spells list and compare it to what spells currently affect me then if i'm missing something from the master spell list either add it to another list or cast it.

here's my stuff so far
Mud ouput:
0hr soulrage +15 to SPELLPOWER
43hr detect invisibility , You can detect invisible
29578hr vitality +5 to CON
29578hr body equilibrium , 50% bonus to HP regen
29578hr combat mind +17 to HITROLL
29578hr detect alignment , You can detect alignments
29578hr detect magic , You can detect magic
29578hr focus strength +20 to STR
29578hr hold align , Your alignment is unchangeable.
29578hr regeneration , Your regeneration rates are doubled
29578hr sense life , You can sense life
29578hr waterwalk , You can walk on water
29578hr stone skin +35 to ARMOR, Your skin is made of stone.
29578hr dark shield +100 to MR, A black aura surrounds you.
115hr know weakness +11 to DAMROLL
115hr fly , You are flying.
29712hr knowledge +5 to WIS
29746hr bless +6 to HITROLL
29846hr cunning +5 to INT
30108hr dexterity +5 to DEX
29846hr strength +5 to STR
29626hr armor +20 to ARMOR
29588hr haste , You are hasty.
29752hr protection from good , You are protected from good
29752hr protection from evil , You are protected from evil
29583hr sanctuary , Halves physical damage
29664hr dark power +52 to SPELLPOWER, (Unknown)

Here's the trigger I have so far

#TRIGGER {(&spelltime)hr (&spellaff)%s{,|+}} {#additem spelluplist %trimright( @spellaff)}

now I basically have a complete spelluplist so i don't really need to #additem anymore but my problem comes when im trying to make a list of spells that are missing from spelluplist, like if armor and sanctuary aren't there when i type aff tell me or add to a list.

I'm confused any help appreciated.
_________________
Spin
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Jul 12, 2006 5:45 pm   
 
make i list of all possible spells you can cast - @allspells
make a list of all the spells on you via triggers - @spelluplist

#FORALL allspells {#IF %ismember(%i, @spellsuplist)) {#NOOP} {#VAR spellsneeded {%additem( %i, @spellsneeded)}}

then all the spells you still need are in - @spellsneeded
_________________
Discord: Shalimarwildcat
Reply with quote
Mixsel
Wanderer


Joined: 02 Feb 2003
Posts: 99
Location: Seattle, Wa

PostPosted: Wed Jul 12, 2006 8:33 pm   
 
Hmmmpf Ok I see how this would work, I'm just having a problem properly bracketing and parathensising lol them damn bracers
_________________
Spin
Reply with quote
Mixsel
Wanderer


Joined: 02 Feb 2003
Posts: 99
Location: Seattle, Wa

PostPosted: Thu Jul 13, 2006 2:07 pm   
 
Well hell, Can't seem to make it work no matter how i try to correct the syntax, i keep getting an error.
Can anyone help?
_________________
Spin
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jul 13, 2006 10:13 pm   
 
According to what shalimar posted, you are missing an opening parenthesis in the #IF condition.
_________________
EDIT: I didn't like my old signature
Reply with quote
Mixsel
Wanderer


Joined: 02 Feb 2003
Posts: 99
Location: Seattle, Wa

PostPosted: Thu Jul 13, 2006 10:31 pm   
 
MattLofton wrote:
According to what shalimar posted, you are missing an opening parenthesis in the #IF condition.


only thing I can get to remotly work but still doesn't is

#FORALL spellaff {#IF (%ismember( %i, @spellsuplist)) {#NOOP} {#VAR spellsneeded %additem( %i, @spellsneeded)}}


that makes the #VAR spellsneeded list spellaff about 28 times heh
tried to open and closed the brackets different ways and no luck

any one wanna retype the statement above with what it should look like?
cause i can't get it to work

EDIT: #FORALL @allspells {#IF (%ismember( %i, @spellsuplist)) {#NOOP} {#VAR spellsneeded %additem( %i, @spellsneeded)}}

The bold is closest addition so far heh except of course it's adding the 5 spells needed to the @spellsneeded var repeatedly as many spells i have on me so I'm getting close.
_________________
Spin
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Jul 14, 2006 12:39 am   
 
How are you firing the #forall @allspells? If you are doing this in a trigger related to your spell list then this is why. You do not need to so, you have made the allspells that is permanent you don't need to change it. You make the spellsuplist via the trigger processing. What you need to do after that is done is just run an alias that contains the #forall and you'll get your list of needed spells. Alternatively if you want the #forall in the trigger processing then change from using the function %additem to using the command #additem, the function allows duplicates the command does not.
_________________
Taz :)
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