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
rob_tavares
Newbie


Joined: 06 Sep 2006
Posts: 7

PostPosted: 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
Reply with quote
The1nk
Newbie


Joined: 09 Jun 2008
Posts: 5
Location: Blenheim, NJ

PostPosted: 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:
Code:
find -t o -n %1

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
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: 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
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: 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'
Reply with quote
rob_tavares
Newbie


Joined: 06 Sep 2006
Posts: 7

PostPosted: 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 :)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jun 11, 2008 7:23 pm   
 
Not %~1, you mean %-1. %1 means "parameter 1". %-1 means "parameter 1 and everything after it".
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