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
T0rin
Beginner


Joined: 27 Dec 2008
Posts: 14

PostPosted: Sat May 30, 2009 2:05 am   

#oninput used with movement char "."
 
Is there any way to parse any .path or .newsud commands through an oninput? I tried using the pattern of ".(*)" but it didnt catch it, I assume because the "." is the movement char. I'd like to perform a specific action anytime I use a speedwalk path via .path or just speedwalking in general like .2ws. I also tried an alias of ".", but that didn't work either.

Any ideas?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jun 01, 2009 6:15 pm   
 
Go to your #oninput trigger and turn on the "Trigger on Prompt" option. That will cause your command line to trigger the oninput pattern before it is parsed by anything else in CMUD (like the speedwalking system).
Reply with quote
T0rin
Beginner


Joined: 27 Dec 2008
Posts: 14

PostPosted: Mon Jun 01, 2009 10:22 pm   
 
Zugg wrote:
Go to your #oninput trigger and turn on the "Trigger on Prompt" option. That will cause your command line to trigger the oninput pattern before it is parsed by anything else in CMUD (like the speedwalking system).

Nope, still nothing. Using 3.06 if that matters.

Trigger pattern is ".(*)" and action is "say bye;#exec {.%1};say hi"

I type ".2u" and it just goes up twice.

Trigger type is "Command Input", the checked boxes are "Trigger on Newline" and "Trigger on Prompt".
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Jun 02, 2009 4:58 pm   
 
I think your best bet would be to redefine the movement special character to something you're less likely to use. You can do this by going to Options -> Gerneral -> Scripting - Special Characters.

I hope that helps.

You could also add a debug message to make sure you oninput trigger is being called.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Jun 02, 2009 5:17 pm   
 
1) Turn off the "Trigger on Newline" option. Only enable "Trigger on Prompt". Otherwise your #oninput trigger might fire twice.
2) Use the #SEND command to send text to the MUD within the script.
3) Use the #NOINPUT command to prevent any other text or commands from being executed.

So your script should look like:
Code:
#SEND "say bye"
#EXEC %concat(".", %1)
#SEND "say hi"
#NOINPUT

Your existing #EXEC syntax might work fine, but using an explicit %concat function is better.

Tested this in 2.37 and 3.08 and it worked fine here. If I removed the #EXEC statement, then it didn't perform any speedwalking directions.
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