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
aedron
Beginner


Joined: 29 Nov 2008
Posts: 20

PostPosted: Sun Nov 30, 2008 2:42 pm   

%pos
 
I'm not sure what's wrong with my reflex but it's not setting the variables the way it should with %pos.

Here is what I have:

^(*)h, (*)m, (*)e, (*)p, (*)en, (*)w (*)<>-$

#var prompt %7 _nodef Healing
#if %pos( x, @prompt) {balance=1} {balance=0}
#if %pos( e, @prompt) {equilibrium=1} {equilibrium=0}
#if %pos( l, @prompt) {leftarmbalance=1} {leftarmbalance=0}
#if %pos( r, @prompt) {rightarmbalance=1} {rightarmbalance=0}
#if %pos( b, @prompt) {sixthsense=1} {sixthsense=0}
#if %pos( k, @prompt) {kafe=1} {kafe=0}
#if %pos( p, @prompt) {prone=1} {prone=0}

All the variables (balance, equ, left/rightarm balances, sixthsense, kafe, prone) are equal to 1, whether or not it's in the prompt variable. Anybody able to point me with what's wrong with this?? I'm completely stumped. Thanks.
Reply with quote
aedron
Beginner


Joined: 29 Nov 2008
Posts: 20

PostPosted: Sun Nov 30, 2008 2:56 pm   
 
Gah, I solved the problem. When I specified the class to send the prompt variable to (Healing), I had a duplicate variable of prompt elsewhere, and it wasn't picking up the proper variable.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sun Nov 30, 2008 6:09 pm   
 
By the way, you should really use %d instead of * in this case. That trigger will match extremely slowly.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
aedron
Beginner


Joined: 29 Nov 2008
Posts: 20

PostPosted: Mon Dec 01, 2008 12:01 pm   
 
will %d still work for matching each number in the prompt correctly like (*)?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Dec 01, 2008 12:08 pm   
 
You still need to put brackets around it, but yes, %d matches numbers specifically, whereas * matches anything. Take a look at this help file.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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