Page 1 of 1

Trigger on Prompt

Posted: Mon May 02, 2011 4:51 pm
by Darmir
I am trying to figure out how to create a trigger on prompt. In CMUD is is very easy you just check a box for the trigger and it is there.
I watched the Capture Data Cast and he talks about doing "return isPrompt()" and select lua function. But that is for a mud with GA. How do you do it for a mud with GA?
My prompt looks like this:
Code: [show] | [select all] lua
<****** / ||||||> 
The number of asterisks or bars change depending on your health or fatigue.

Re: Trigger on Prompt

Posted: Tue May 03, 2011 2:04 am
by Darmir
Anybody know how to do this?

Re: Trigger on Prompt

Posted: Tue May 03, 2011 6:29 am
by Heiko
Prompt triggers are regular triggers in Mudlet. The manual has some examples. In your case a regex pattern would do such as
<([*]*).*?/.*?([|]*)>

Which MUD do you play?

Re: Trigger on Prompt

Posted: Tue May 03, 2011 3:17 pm
by Darmir
Shadows of Isildur

Re: Trigger on Prompt

Posted: Sun Mar 18, 2012 11:51 pm
by Urswick
Sorry to ressurect this but my prompt looks like this <500/500h 400/400m ... >
I only really want to capture the number in front of the slash. Been playing with it and can't seem to get the trigger right. Any help would be appreciated.

Re: Trigger on Prompt

Posted: Sun Mar 18, 2012 11:56 pm
by Sheia
Code: [show] | [select all] lua
^<(\d+)/\d+h (\d+)/\d+m ... >$
That should do it. Does it really have an ellipsis or are you just saying it continues like that? Naturally you'll need to set the trigger to Perl Regex. The captures will be contained in matches[2], matches[3], etc.
Regex Tester!
Regex Reference!

Re: Trigger on Prompt

Posted: Mon Mar 19, 2012 12:02 am
by Urswick
ellipses no it continues thanks! Would it work like this as well ^<(\d+)/\d+h (\d+)/\d+m and have it as a Begin of line substring? Thanks again

Re: Trigger on Prompt

Posted: Mon Mar 19, 2012 12:06 am
by Sheia
No you won't be able to use a begin of line substring. It needs to be a Regex Trigger. You could make a begin of line substring that is just " < " and then make a child trigger that is the Regex, but that is not really necessary.