|
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: Fri Jul 16, 2004 4:17 am
wildcards in alias names |
Is there a way to have a wildcard in the middle of an alias name?
I want to be able to make an alias that repeats a command a cetain number of times i know how to do this with #repeat but i want to be able to type a number with the alias for the number of loops as an example:
typing make 3 shirtsshould go through and sew 3 shirts however zmud seems to have an issue with using make (%d) shirts as the alias name[/b] |
|
|
|
Serentus Apprentice
Joined: 28 Sep 2001 Posts: 103 Location: USA
|
Posted: Fri Jul 16, 2004 4:26 am |
#ALIAS make {#LOOP %1 {sew %2}}
%1 and %2 are parameters passed to the alias, so
'make 3 shirts' will
sew shirt
sew shirt
sew shirt
'make 5 pants' will
sew pants
sew pants
sew pants
sew pants
sew pants |
|
_________________ -Serentus- |
|
|
|
Danlo Magician
Joined: 28 Nov 2003 Posts: 313 Location: Australia
|
Posted: Fri Jul 16, 2004 6:18 am |
Or, you could do this:
#oninput {Make(%d)pants$} {#gag;#loop %1 {sew pants}} |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: Fri Jul 16, 2004 12:09 pm |
"You should use an #ALIAS for this kind of command since it is more efficient than using command input (#ONINPUT) triggers." - Quoted from help file.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jul 16, 2004 3:41 pm |
Quote: |
zmud seems to have an issue with using make (%d) shirts as the alias name |
Alias names should be limited to a single word. zMUD will allow multiword alias names, but they are useless because only the first word of a command line is checked against the alias list.
This one is fairly simple, you can use #LOOP like Serentus did or just use the #nn syntax with %1 providing the number.
#AL make {#%1 sew}
make 5 shirt |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Chris_3413 Novice
Joined: 22 Mar 2004 Posts: 46 Location: Australia
|
Posted: Fri Jul 16, 2004 4:27 pm |
I got around it by using a second alias to call the first ones in a loop. but it would have been nice to have it all in one and sound like a proper sentence to type in... thanks anyway
|
|
_________________ What do you mean, Fatal Error! |
|
|
|
|
|