|
rob_tavares Newbie
Joined: 06 Sep 2006 Posts: 7
|
Posted: Wed Jun 11, 2008 10:03 am
Alias Question |
Well, seeing as I'm new to CMUD, but have used zmud for years, this one's got me :)
This script worked in Zmud & oddly enough, it worked in Cmud for a couple of days until it went buggy & I had to reinstall. Now it refuses to work at all.
An Imm command on a mud I play is 'find'
old alias that worked:#alias fo {find -t o -n}
Now, that doesn't work at all.
intended use:fo mouse
[04:59 2h]*||5000/5000|5000/5000||find -t o -n mouse
# Vnum Clanid Proof/auth Desc:
-------------------------------------
1) 7899 [ -1] { P } [ 0] the Mouser's Board
2) 13591 [ -1] {G } [6350] a wireless, optical mouse
Its return is now is:
[04:58 2h]*||5000/5000|5000/5000||find -t o -n
You forgot to specify what name.
The scripts used to simple read what else was on the string, is it not doing that now (as evident in the present return)?
How do I get the script to accepted an argument at the end?
I use this command near a thousand times a day :P
Thanks guys,
-Rob |
|
|
|
The1nk Newbie
Joined: 09 Jun 2008 Posts: 5 Location: Blenheim, NJ
|
Posted: Wed Jun 11, 2008 10:48 am Well.. |
Well, you're supposed to be able to use %1 within the script.
So, the alias would still be "fo" and the script would be:
however, that worked for me - for a couple of days. lol. Now it doesn't work for me anymore.
But, the workaround I use for passing parameters through an Alias is a magical check box. When you open the Package Editor and click on the alias, the right hand side with all the script in it, towards the bottom in the area of checkboxes there is one that reads, "Auto Append [Tool Tip: Automatically append unused arguments]". And that does the trick. In essence, if I have a script that uses %1, and I throw in 2 parameters instead of one, the second will automatically be sent to the mud at the very end of the command. So, it should work for you. :)
Need any thing else - send back!
Hth! ^_^
-The1nk |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Jun 11, 2008 11:01 am |
another good trick is the use of %param(1) (just this) and %params(3) (from this spot on)
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Wed Jun 11, 2008 12:02 pm |
Aliases no longer append automatically. You probably want to use %-1 rather than %1 though to get the same behaviour as in zMUD
For 'find abc def ghi'
then 'fo %1' would return 'fo abc'
and 'fo %-1' would return 'fo abc def ghi' |
|
|
|
rob_tavares Newbie
Joined: 06 Sep 2006 Posts: 7
|
Posted: Wed Jun 11, 2008 7:11 pm |
HAHAHA, dude, that append thing worked jsut fine.
so I'd technically want %~1? very nice, thank you guys :) |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Jun 11, 2008 7:23 pm |
Not %~1, you mean %-1. %1 means "parameter 1". %-1 means "parameter 1 and everything after it".
|
|
|
|
|
|