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
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

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


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: 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.
_________________
Unwritten Legends
Reply with quote
Martaigne
Wanderer


Joined: 05 Jan 2002
Posts: 88
Location: Atlanta, GA

PostPosted: Fri Feb 26, 2010 6:22 pm   
 
Golden, thank you. I always forget about #EXEC!
_________________
Unwritten Legends
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