Page 1 of 2

Mudlet help

Posted: 26 May 2017 19:58
by palaver
I've been toying with Mudlet. It seems powerful and flexible, but to use it fully, I need to become way more familiar with it. The learning curve is steep. Can we use this thread to compile resources and tips for people who are using this client?

Question: Can I set up a timer that triggers can turn on and off? Here's what I have in mind:

Timer sends combat command every x.x seconds.
Trigger activates the timer on something like "attacks you."
Trigger de-activates the timer on something like "The __ died."
Is such a setup possible?

Re: Mudlet help

Posted: 28 May 2017 03:43
by palaver
Another question.

I want a trigger firing from

Code: Select all

^You attack the (.+)$
Then I want a special guild appraisal of (.+), which is my target.
But (.+) captures the full stop in, e.g., "You attack the foul-smelling orc."
So Genesis goes "What?"
Would something like

Code: Select all

^You attack the (\w+)$
grab all the words but not the full stop?

Thanks for any advice on this, or just learning how Mudlet works in general, you might be able to offer. The manual is helpful to an extent but obviously I could use some help. Plus I think maybe this isn't even Mudlet specific.

Re: Mudlet help

Posted: 28 May 2017 05:14
by Ckrik
palaver wrote:Another question.

I want a trigger firing from

Code: Select all

^You attack the (.+)$
Your regex is capturing the period. Try this:

Code: Select all

^You attack the (.+)\.$

Re: Mudlet help

Posted: 28 May 2017 10:44
by Tarax the Terrible
palaver wrote:I've been toying with Mudlet. It seems powerful and flexible, but to use it fully, I need to become way more familiar with it. The learning curve is steep. Can we use this thread to compile resources and tips for people who are using this client?

Question: Can I set up a timer that triggers can turn on and off? Here's what I have in mind:

Timer sends combat command every x.x seconds.
Trigger activates the timer on something like "attacks you."
Trigger de-activates the timer on something like "The __ died."
Is such a setup possible?
Does this help?
http://wiki.mudlet.org/w/Manual:Timer_Engine

Re: Mudlet help

Posted: 28 May 2017 10:56
by Drazson
Is there a way to use the mentioned (.+) in the browser triggers?
e.g. You find a (.+) --> put (.+) in backpack or something?

Re: Mudlet help

Posted: 28 May 2017 11:09
by Tarax the Terrible
Drazson wrote:Is there a way to use the mentioned (.+) in the browser triggers?
e.g. You find a (.+) --> put (.+) in backpack or something?
Britannica almost does that in an example here
https://www.genesismud.org/forums/viewt ... =37&t=3307

Using args to check then a command, could probably use args in the command too

Look here too
https://www.genesismud.org/forums/viewt ... =37&t=3285

Re: Mudlet help

Posted: 29 May 2017 00:45
by palaver
Tarax the Terrible wrote:Does this help?
http://wiki.mudlet.org/w/Manual:Timer_Engine
It's incredibly nice of you to look this up, since you're not even a Mudlet user. I've looked at various parts of the manual, including this one.
I get the basic commands, but I don't see how to make the enabling / disabling dependent on something like the MUD spitting out
"The [target] died" - inside a trigger. I think I could figure out how to make it its own trigger, but not how to embed this condition itself
in a trigger.

P.S. Haven't looked at the Britannica stuff yet - but I will, and I appreciate it.

Re: Mudlet help

Posted: 29 May 2017 01:47
by palaver
Ckrik wrote:Your regex is capturing the period. Try this:

Code: Select all

^You attack the (.+)\.$
Great. I will try this. Thank you.

Re: Mudlet help

Posted: 29 May 2017 05:26
by palaver
palaver wrote:I don't see how to make the enabling / disabling dependent on something like the MUD spitting out
"The [target] died" - inside a trigger. I think I could figure out how to make it its own trigger, but not how to embed this condition itself
in a trigger.
Maybe an even more elegant solution would be to put the kill switch in the timer itself? I'll see if I can figure out how to do that.

Re: Mudlet help

Posted: 03 Jun 2017 23:58
by palaver
I realize this is no longer really about Mudlet, but about Perl regex. Sorry about that.
Ckrik wrote:Your regex is capturing the period. Try this:

Code: Select all

^You attack the (.+)\.$
This worked beautifully. Now I'm wondering how I can capture just the last word. I find this suggestion:

Code: Select all

\s(\w+)$
but I wonder how to put that into the trigger pattern. I'm guessing I can't do

Code: Select all

^You attack the (.+)\s(\w+)\.$
I apologize in advance for anyone who reads that and finds it hideous, which I'm sure it is.
The basic question is, what do I put between the known beginning of the pattern "You attack ..." and the unknown stuff up until the last word, which is what I want to capture?