Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
derekperrault
Newbie


Joined: 22 Dec 2008
Posts: 5

PostPosted: Mon Dec 22, 2008 2:50 am   

Feature Request: aliases with multiple action names
 
I really wish I didn't have to make multiple aliases to cover my bases.

For instance, when I am in the heat of battle, I don't know what combination of characters I'll type to flee.

I might type: flee, fle, or fl.

Rather than train my brain and fingers to only use one, I've created multiple aliases to perform the same sets of commands. What would be awesome would be something like:

#alias {flee, fle, fl} {...actions...}
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Dec 22, 2008 3:20 am   
 
You can use Oninput trigger instead of Alias in that case, imo.

For example,

Oninput trigger with a regex pattern of

Code:

fl(?:e|ee)



Maybe I'm totally off here but in a way I've always thought of Oninput triggers as more complex Aliases.
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Dec 22, 2008 3:21 am   
 
#oninput {^fle?e?$} {stuff} "" {regex}

If you don't understand the pattern, have a look at some regex cheat sheets.

EDIT: Damn you, prog :(
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
derekperrault
Newbie


Joined: 22 Dec 2008
Posts: 5

PostPosted: Mon Dec 22, 2008 3:36 am   
 
Okay, that does sound good. It will work perfectly.

Of course, now I have to ask: why do we still have aliases? We could use both simple and complex oninput triggers for everything.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon Dec 22, 2008 4:07 am   
 
The chief reason that aliases still exist, I think, is that they came first, and removing them when oninput triggers were added would've broken everyone's aliases. The second reason is probably that people find aliases slightly easier to understand. Finally, aliases are simpler than oninput triggers in some respects - they automatically capture their parameters in a few useful ways (both %1 and %-1, for example) and they can be set to automatically append arguments you haven't explicitly mentioned, as well. You're right that input triggers would work just as well, but they're uglier.
_________________
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 » CMUD 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