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


Joined: 07 Oct 2009
Posts: 19
Location: Poland

PostPosted: Wed Oct 07, 2009 9:08 am   

Catching end of MUD response
 
Hi,

In MUD which I use, after sending any command MUD responses with text + "> " chars in new line. Is it possible to catch > or some other way know when response for command is finished?

Trigger with pattern ">" does not work for single command.
For example sending "test" command, I get response
"Slucham?
> "
Code:
test
Slucham?
>


When sending "test;test" the response is:
Code:
test
test
Slucham?
> Slucham?
>


And then trigger fires in line "> Slucham?"

I also looked for some Event on this, but according to documentation there is no such one.

Thanks for your response
Pawel
Reply with quote
Tech
GURU


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

PostPosted: Wed Oct 07, 2009 3:12 pm   
 
It sounds like you want a #TRIGGER with the prompt option checked.

Something like this should help you out.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<trigger name="Prompt" priority="1130" newline="false" prompt="true" copy="yes">
<pattern>^></pattern>
<value>#RAISEEVENT onPrompt; #ECHO Prompt Fired</value>
</trigger>
</cmud>

This trigger looks for '>' at the start of a line and that's waiting for input. It echoes text to let you know the prompt was matched. It also raises an Event that let's you know you received your prompt. But that's just me trying to be fancy, and it's not necessary.
_________________
Asati di tempari!
Reply with quote
Fidel
Beginner


Joined: 07 Oct 2009
Posts: 19
Location: Poland

PostPosted: Wed Oct 07, 2009 7:44 pm   
 
It works.

Thanks
Pawel
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