 |
kjaerhus Magician

Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Thu Mar 25, 2010 10:28 pm
Using named parameters in a trigger |
Hi
I have an alias looking somehing like below. My goal is to use the value of the parameter $command both to send to the mud and to filter the command from my screen. However, CMUD contructs the temp trigger differently than I hoped for as it will interpret what I put inside the {} literally. Any hints?
| Code: |
<alias name="doWait" id="430">
<value>
#IF ($hideOption == "hide") {
#TEMP {$command} {gagLine} "" input
}
#EXECUTE $command
</value>
<arglist>$command, $hideOption</arglist>
</alias> |
|
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Mar 25, 2010 11:27 pm |
Have you looked into command-input triggers? You can use #NOINPUT to intercept the stuff you typed on the command line, preventing it from both going to the game as well as going to the screen. If you capture the pattern, you can then use #SEND/#SENDRAW to send it to the game without showing on the screen.
To answer your question, though, I think you might need to concat the #temp command together and then #execute the result. |
|
_________________ EDIT: I didn't like my old signature |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Fri Mar 26, 2010 3:49 am |
MattLofton is correct. You'll need to do:
#EXEC %concat("#TEMP {",$command,"} {gagLine} ",%char(34),%char(34)," input")
for it to work. I think doubling up the quotes will also work, but I tend to use %char instead. However, Matt's suggestion of #ONINPUT might be what you want to do instead.
Charneus |
|
|
|
 |
kjaerhus Magician

Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Fri Mar 26, 2010 4:32 pm |
Great answers both. I didn't think of actually putting the creation og the trigger inside a function. I tried everything inside the brackets but all that seems to go unprocessed to the trigger pattern. In the end Í might just do a sendraw and then write the same command in the "log" window. I forgot this opportunity and then I don't need a trigger.
|
|
|
|
 |
|
|
|