|
Kalus Beginner
Joined: 01 Dec 2000 Posts: 27
|
Posted: Tue Dec 23, 2003 4:01 pm
alias question |
I was wondering if there was a way to setup an alias so that if no argument was given, it would use a default variable. For example if i made and alias named bs, to backstab, if i typed bs rabbit it would backstab a rabbit. However if i didn't use an argument like rabbit, it would bs some default target.
I'm assuming the pattern would be something like this
backstab {%1||@defaulttarget}
obviously that doesn't work, but i'm not really sure what to try. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Dec 23, 2003 4:47 pm |
#IF %numparam() {backstab %-1} {backstab @defaulttarget}
|
|
|
|
Loto Apprentice
Joined: 05 May 2003 Posts: 194
|
Posted: Tue Dec 23, 2003 7:02 pm |
You could also just make two aliases :P
#ALIAS {bs} {backstab <thing you want as default>}
#ALIAS {bs} {backstab %1} |
|
|
|
soldado_del_rey Newbie
Joined: 23 Dec 2003 Posts: 7 Location: USA
|
Posted: Tue Dec 23, 2003 11:01 pm |
quote: Originally posted by LightBulb
#IF %numparam() {backstab %-1} {backstab @defaulttarget}
But don't IF statements only work when you input them? That's the problem I'm having. |
|
|
|
SolReapr Beginner
Joined: 03 Sep 2003 Posts: 13 Location: USA
|
Posted: Tue Dec 23, 2003 11:57 pm |
Place LightBulb's answer into your alias. As soon as you execute the alias it will parse the #IF statement.
If there are arguments passed then it returns true executing {backstab %-1}
If there are no arguments passed it returns false executing {backstab @defaulttarget} |
|
|
|
|
|