Grabbing Multiple Lines

Post Reply
jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Grabbing Multiple Lines

Post by jklua »

Hi all, is there a way to pick out a whole room description instead of just the first line? Here's an example from a mud I play (* = space).

The Eastern Wall of the Vast Cavern
**Stalactites and stalagmites cover the ceiling and floor making walking
treacherous. A dripping noise can be heard as well as a moaning and the
sounds of battle echoing from the distance. A soft glow comes from a
strange fungus all around you. The cave opens to the west, north and
south. The eastern wall of the cavern is split here by a wide opening
which extends southwards along its surface.


*****N
W***** E
*****S


civilized <100%hp 100%m 100%mv 2502tnl (7.33%)>

jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Re: Grabbing Multiple Lines

Post by jklua »

Like for example selecting all text between "^\s\s[A-Z]" and "\n\n" across multiple lines?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Grabbing Multiple Lines

Post by Vadi »

If your MUD doesn't support screenwidth 0, then it's still is possible - is there a GA signal for it?

jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Re: Grabbing Multiple Lines

Post by jklua »

I'm new to mudding, and not familiar with either of those. How do I check?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Grabbing Multiple Lines

Post by Vadi »

For the first one - check your MUD configuration settings. For the second, see if Mudlet says N: or <No GA> at the bottom.

jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Re: Grabbing Multiple Lines

Post by jklua »

No GA, no screenwidth options in settings.

jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Re: Grabbing Multiple Lines

Post by jklua »

What if "^\s\s[A-Z]" turns on a trigger to capture all lines of text, appends to a buffer, and "^\n" turns of the trigger off again? Is that possible?

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Grabbing Multiple Lines

Post by Vadi »

Yeah - make a 'return true' Lua function trigger and drag it into the '^\s\s[A-Z]' one. Set the fire length of the '^\s\s[A-Z]' one to, let's say, 50. Then make a trigger for '^$' (I'm assuming you mean it's a blank line there) that does setTriggerStayOpen("name of the ^\s\s[A-Z] trigger", 0)

jklua
Posts: 22
Joined: Fri Jun 17, 2011 9:45 pm

Re: Grabbing Multiple Lines

Post by jklua »

Thank you! I also found enable/disableTrigger("trigger_name"). Should be easy from here.
Last edited by jklua on Tue Jun 21, 2011 9:12 pm, edited 1 time in total.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Grabbing Multiple Lines

Post by Vadi »

It is all explained in the manual: http://mudlet.org/asciidoc/manual.html# ... neTriggers

'return true' Lua function trigger means that it'll fire on every line

Post Reply