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


Joined: 02 Nov 2006
Posts: 9

PostPosted: Tue Mar 04, 2008 6:40 pm   

#IF question
 
Hello! I have a teleport alias that locates on the zmud map based on the teleport location using #IF statements

#IF (%-1=~"am ring") {#TELEPORT 10684} {#IF (%-1=~"bp ring") {#TELEPORT 14091} {#IF (%-1=~"medina") {#TELEPORT 13819} {#ECHO Unknown map location!}}}

However, the patterns with spaces in them behave strangely, "am ring" works correctly, but "bp ring" does not, going to the "am ring" location. Also gibberish patterns with spaces "ff ff" point to the "am ring" location. "media" works fine. How do I format the command matching to work with the spaces?

I'm hoping there is a simple solution to fix this. Thanks!

<snip>

EDIT: Never mind, managed to find a work around that didn't need the spaces, thank you!
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Wed Mar 05, 2008 7:26 am   
 
You need spaces around the =~ operators, and you need to quote the %-1's. The following acts like you would expect:
Code:
#IF ("%-1" =~ "am ring") {#SH am} {#IF ("%-1" =~ "bp ring") {#SH bp} {#IF ("%-1" =~ "medina") {#SH medina} {#ECHO Unknown map location!}}}

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