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
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sat Feb 19, 2005 4:28 pm   

Help in syntax for creating a (should-be) simple alias
 
Looking to make an alias to the effect of:

#al ct *%1 {clan *%1}

This is ultimately a "preventative/convenience" alias, as due to reasons (complex to explain) to communicate on the same channel on my MUD, in 2 different ways, requires two different commands (one "ct" the other "clan *(words) )... Trying to combine it to one command. But b/c of the * used in the command, I cannot get ZMud to recognize the alias.. Am I missing something? {} maybe, somewhere? Or something I don't know about? Or can it just not be done?

Thanks a lot!
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sat Feb 19, 2005 5:24 pm   
 
Maybe you're looking for something like this?
Code:
#ALIAS ct {<ct *%0>;clan *%0}
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Sun Feb 20, 2005 6:26 am   
 
#alias ct {#if (%left(%-1,1)="*") {clan ~*%-1} {<ct %-1}}

I /think/ thats along the lines of what you're looking for... XD
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sun Feb 20, 2005 4:53 pm   Responses
 
Thanks for the responses guys, but the first one left actually didn't work, and the second instantly caused Zmud to crash and restore to backup MUD file all 3 times I tried it ;)

What I need is almost like a #IF statement, but for an alias.. the catch is to make it recognise the * in there... if I were to write it as a trigger, it would be:

Code:
#TR {ct ~*(%w)} {clan *%1}

That is actually the exact format I desire, except in alias form. I have of course tried that, and several variations, with and w/o the tiilde ( ~ ), but cannot get it to work properly.
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Feb 20, 2005 5:33 pm   
 
how about an ONINPUT trigger?

#ONINPUT {ct ~*(%w)} {clan *%1}


btw if you use (%w) then it will only send one word

so ct hello there not match the trigger and send ct hello there to the mud.
but ct *hello there only hello would be captured by (%w)
so ct *hello there would send clan *hello to the mud
maybe thats what you want?.
if not change (%w) to (*) so that it will capture the rest of the string and not just the first word.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Feb 20, 2005 7:31 pm   
 
That won't work, Dharkael. #ONINPUT triggers do not work like aliases wherein you can substitute commands with other commands. Instead, it will send both commands--the one from the command line that matches the trigger and the one the trigger sends. At least, that's how it works for me. I haven't seen any other different behavior ever before nor have I seen a Preference setting that would change this.
_________________
EDIT: I didn't like my old signature
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Feb 20, 2005 7:38 pm   
 
Think this is what you're after(?)

#ALIAS test {#IF (%left( %-1, 1)="*") {em %rightback( %-1, %len( %-1)-1)} {say %-1}}

So if you
test 1 2 3
then it sends 'say 1 2 3'

if you
test *1 2 3
then it sends "em 1 2 3"

should be able to change it as required.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Sun Feb 20, 2005 7:40 pm   
 
Not sure what you're talking about MattLofton because in fact it does work, at least for me.
And if you read the #ONINPUT help you'll see that exactly what the examples suggest it does.
if you want to be sure add the #GAG make sure the original text isnt sent
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Feb 21, 2005 1:19 am   
 
::mutters::
BAH! As solid as ZMud is getting, these random, no-apparent-reaspon glitches are getting even more annoying! I was working with #ONINPUT for some project about a month ago and I swear it was NOT working like that (although, yes, the trigger was firing and correctly doing the rest of the trigger behavior).
_________________
EDIT: I didn't like my old signature
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