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


Joined: 01 May 2004
Posts: 11
Location: USA

PostPosted: Sat May 01, 2004 8:35 am   

Reporting in multiple formats
 
I have an alias to report stuff to my party or to my screen:

msg
#if (@scon=1) {p' %1} {#echo %1}

The problem is that in order to get the alias to spam everything, i need to enclose the message in brackets. For example:

msg {%1 is in Good Shape} if scon=1 will spam p' {%1 is in Good Shape} and if scon=0 #echo %1 is in Good Shape

The difference is the extra curly brackets that i'm actually sending to my party channel. Sorry if that's not well described its late and I've been looking at this all night. I'm just really picky about what I spam, and it bugs me that I can't control exactly what characters I'm sending in this case. If anyone knows an easy way to do what I'm trying to do I would really appreciate the help.

I've tried both %remove and %replace, interestingly, it works if i do (p' %remove ("{",%1)) although I can't for the life of me figure out why, since as far as I know, it should only be removing the first instance of the { and not the matching } on the other side.

Thanks all.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 01, 2004 9:18 am   
 
If you just want everything after 'msg' to be included, use %-1.
#if (@scon=1) {p' %-1} {#echo %-1}
Reply with quote
Christopher
Beginner


Joined: 01 May 2004
Posts: 11
Location: USA

PostPosted: Sat May 01, 2004 3:21 pm   
 
Thank you very much! That did the trick nicely, I seem to recall the %-1 trick from somewhere, but I had looked through all the helps/documentation and nothing seemed to fit. Is there a resource that I can check to get better at the zmud syntax?

Again, thank for the quick help.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 01, 2004 5:46 pm   
 
Help is the primary resource for zMUD syntax. %-1 is explained in the help for the #ALIAS command but not in the Introduction to Aliases.

In addition to the zMUD helpfiles, there are articles covering a variety of subjects in the Support Library, which you can find from the Support link above. Most of these articles are by Zugg and provide additional details and examples.

Another resource is this forum itself. It usually takes less than an hour per day to read all the active topics, which will expose you to a variety of scripting styles. (It takes considerably longer to respond to them.)
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