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


Joined: 27 Nov 2002
Posts: 5
Location: USA

PostPosted: Wed Nov 27, 2002 1:22 pm   

Variable Manipulation Q.
 
I am a GM for an MMORPG that uses a script for running a special set of gladitorial games. I am running into an issue with variable manipulation when it comes to restoring the life of a character with punctuation in their names.. such as ' or - The pattern catches the name correctly and stores it as a variable like this:
Pattern: (^~*->((%x) just died.)
Command:
#CW bright,green
#ECHO ~[System] Player %1 added to death list.
#VARIABLE @{%1} 1

However when the following is received,
Pattern: ~[GM] (%x) ~[(%w)] reports: Aeron dead
Command:
#CW bright,blue
#IF (@{%1} = 1) {
fix %1
#VARIABLE @{%1} 0
} {
#ECHO ~[System] *** %1 is requesting a heal when not dead.
#PLAY c:zmudwrong.wav
}
the system returns a false every time and truncates the first part of the name variable.. Is there something I'm missing?

Thanks in advance for any advice.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Nov 27, 2002 5:28 pm   
 
It took awhile, but I finally realized that your problem is indirect variable names. The quickest solution is to use a different method.

Pattern: (^~*->~((%x) just died.~)
Command:
#CW bright,green
#ECHO ~[System] Player %1 added to death list.
#ADDITEM dead {%1}

Pattern: ~[GM] (%x) ~[(%w)] reports: Aeron dead
Command:
#CW bright,blue
#IF (%ismember({%1}, @dead)) {
fix %1
#DELITEM dead {%1}
} {
#ECHO ~[System] *** %1 is requesting a heal when not dead.
#PLAY c:zmudwrong.wav
}


LightBulb
Senior Member
Reply with quote
DgateTam
Newbie


Joined: 27 Nov 2002
Posts: 5
Location: USA

PostPosted: Wed Nov 27, 2002 5:37 pm   
 
Thanks for the info! I'll drop that into the script and try it out. :)
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