|
Martaigne Wanderer
Joined: 05 Jan 2002 Posts: 88 Location: Atlanta, GA
|
Posted: Fri Feb 26, 2010 5:05 pm
alias parsing of commands sent via #SEND/#SENDRAW |
I'm having an issue with a script I wrote that will automatically queue the %lastinput if the command is halted due to existing round time. It works great, but the problem is, since I'm using #SEND/#SENDRAW to reissue the queued command, it will not parse aliases (obviously). The code example is below. It consists of two triggers, one which grabs the %lastinput and stores it, the other which waits for roundtime to = 0 before firing off the queued command. How can I submit the command automatically so that CMUD parses for aliases before sending the command to the mud, as #SEND and #SENDRAW don't seem capable?
<trigger priority="1830">
<pattern>Roundtime Remaining: %1 second{|s}.$</pattern>
<value>#VAR lastcommand %lastinput
#SHOW %ansi( green)SmartCommand storing command '@lastcommand'.</value>
</trigger>
<trigger type="MXP" priority="5370">
<pattern>rt</pattern>
<value>#GAG
rt = %0
#IF (@rt = 0) {
maxrt = 0
#IF (@lastcommand!="") {
#WAIT 500
#SHOW %ansi( green)SmartCommand resending command '@lastcommand'.
@lastcommand
lastcommand = ""
}
}
#IF (@maxrt < @rt) {maxrt = @rt}</value>
</trigger> |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Fri Feb 26, 2010 5:49 pm |
Actually, you aren't using #SEND to reissue the command, you are just using @lastcommand as a command line (not a good idea). However, to get it to actualy parse the command in @lastcommand, you can probably use: #EXEC @lastcommand.
|
|
|
|
Martaigne Wanderer
Joined: 05 Jan 2002 Posts: 88 Location: Atlanta, GA
|
Posted: Fri Feb 26, 2010 6:21 pm |
Right, I had tried both #SEND and #SENDRAW with no success, and removed them.
I'll give the #EXEC a try and report back. Thanks. |
|
|
|
Martaigne Wanderer
Joined: 05 Jan 2002 Posts: 88 Location: Atlanta, GA
|
Posted: Fri Feb 26, 2010 6:22 pm |
Golden, thank you. I always forget about #EXEC!
|
|
|
|
|
|