Trigger on Prompt

Post Reply
Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Trigger on Prompt

Post 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.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Trigger on Prompt

Post by Darmir »

Anybody know how to do this?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Trigger on Prompt

Post 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?

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Trigger on Prompt

Post by Darmir »

Shadows of Isildur

Urswick
Posts: 29
Joined: Fri Oct 15, 2010 1:47 pm

Re: Trigger on Prompt

Post 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.

Sheia
Posts: 33
Joined: Tue Dec 01, 2009 4:40 am

Re: Trigger on Prompt

Post 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!

Urswick
Posts: 29
Joined: Fri Oct 15, 2010 1:47 pm

Re: Trigger on Prompt

Post 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

Sheia
Posts: 33
Joined: Tue Dec 01, 2009 4:40 am

Re: Trigger on Prompt

Post 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.

Post Reply