|
Makya Newbie
Joined: 28 Nov 2011 Posts: 5
|
Posted: Sat Dec 31, 2011 3:25 am
Capturing messages into Variables... how? |
I can capture single words into a variable using %1, how can I get a whole input?
Desired...
>Input:
lsay1 Hello there. My name is Mike.
>Output:
lsay spanish Hello there. My name is Mike.
Any suggestions? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Sat Dec 31, 2011 3:49 am |
the correct way to capture a portion of your pattern into a variable is to enclose it in parenthesis, then reference it with %1 %2 etc
assuming you are using %1 in a alias, %0 or %-1 would be the entire list of arguments |
|
_________________ Discord: Shalimarwildcat |
|
|
|
angelwingfields Newbie
Joined: 02 Jan 2012 Posts: 1
|
Posted: Mon Jan 02, 2012 12:57 am |
Can somebody explain this further? Thanks!
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Mon Jan 02, 2012 3:09 am |
I think you need to explain exactly what you are wanting CMUD to do a bit better. From the information you have provided I can only assume you mean an alias, such as this one:
#ALIAS lsay1 {lsay spanish %params}
This will take anything typed after the user defined command 'lsay1' and append it to 'lsay spanish' command instead |
|
_________________ Discord: Shalimarwildcat |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Jan 03, 2012 2:02 pm |
In explanation--%1 only grabs the first parameter (i.e. word) after the alias. %2 would grab the second word, etc. To grab all the words, use %params instead of %1. %0 is an old Zmud alternative to %params, which is retained for compatibility reasons.
|
|
|
|
|
|