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
vey2000
Novice


Joined: 21 May 2004
Posts: 32

PostPosted: Tue Mar 13, 2007 2:36 am   

I must be blind to not see any syntax errors in this, apparently
 
Ok, I've this similar problem a couple of times recently.

The current one is this: an alias with the following code
Code:
#FORALL {@Alignments} {
  #IF (%db( @SpellParameters, protection) = %i) {
    #SAY 1
    #ADDKEY AutoSpellList {%concat( "protection ", %i)} 1
    #ADDITEM AutoSpellQueue {%concat( "protection ", %i)}
    }{
    #SAY 0
    #ADDKEY AutoSpellList {%concat( "protection ", %i)} 0
    #DELITEM AutoSpellQueue {%concat( "protection ", %i)}
    }
  }

that when run, even from the command line, sends as commands to the mud the following:
Code:
{#SAY 1;#ADDKEY AutoSpellList {protection evil} 1;#ADDITEM AutoSpellQueue {protection evil}}{#SAY 0;#ADDKEY AutoSpellList {protection evil} 0;#DELITEM AutoSpellQueue {protection evil}}


I've tried just about every way to reexpress the if condition, just in case I was somehow getting a new line code in there -- yeah right, but I honestly have no clue what else could be causing it.

For what it's worth, I'm running 7.20b -- haven't felt like upgrading since the only change is a zmapper plugin fix and I don't own zmapper.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Mar 13, 2007 2:45 am   
 
Code:
#FORALL {@Alignments} {
  #IF (%db( @SpellParameters, protection) = %i) {
    #SAY 1
    #ADDKEY AutoSpellList {%concat( "protection ", %i)} 1
    #ADDITEM AutoSpellQueue {%concat( "protection ", %i)}
  } {
    #SAY 0
    #ADDKEY AutoSpellList {%concat( "protection ", %i)} 0
    #DELITEM AutoSpellQueue {%concat( "protection ", %i)}
  }
}

Note the space and the probably-not-required-but-might-help movement of the braces.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
vey2000
Novice


Joined: 21 May 2004
Posts: 32

PostPosted: Tue Mar 13, 2007 2:49 am   
 
Nevermind. I see now what space you're talking about. Oh man, I feel silly now. Thank you, that worked.
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Tue Mar 13, 2007 2:53 am   
 
I sometimes have had problems with

something = %1
it seems to work better , or more consistantly if its something="%1" but i think it depends on whats in %1 as to whether or not you can have a space after the = and whether or not you need the " "'s around the %1
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