Capturing and subsituting 2 lines together

Post Reply
timoomit
Posts: 4
Joined: Tue Jun 15, 2010 8:53 pm

Capturing and subsituting 2 lines together

Post by timoomit »

An IRE mud, getting a two-line attack input.

Like this:

Someone brings a blackened warhammer bearing fangs before his face, as a corona
of light begins emanating from within.

I would like to capture this as a single trigger, do my logic and then replace it with my own string.
Im not fully sure how to attach the second line to the first. And in IRE muds can I be sure that
the attack text breaks at the same place always or is it dependent on the name length or weapon name length for example.

chalraes
Posts: 10
Joined: Mon Jun 14, 2010 10:48 pm

Re: Capturing and subsituting 2 lines together

Post by chalraes »

timoomit wrote:An IRE mud, getting a two-line attack input.

Like this:

Someone brings a blackened warhammer bearing fangs before his face, as a corona
of light begins emanating from within.

I would like to capture this as a single trigger, do my logic and then replace it with my own string.
Im not fully sure how to attach the second line to the first. And in IRE muds can I be sure that
the attack text breaks at the same place always or is it dependent on the name length or weapon name length for example.
The length of it, and the break point, are both dependant on the weapon name. Since it is an IRE mud, there are two ways that are obvious to me that could solve this problem.

1: Use a trigger that uses regex to match the first part of the line. For example:
^\w+ brings a .*+ before (?:his|her) face, .*+$
This would match it for most weapon names(anything which pushes face, down onto the next line would break it).

2: Within every IRE mud, there is a config option that would send the whole string in a single line(depending on the client, it may not display as a single line, but it will be matched as one). If memory serves, it is CONFIG WRAPWIDTH <0-*>, with 0 being no wrapping due to width by the game. If you do this, you could easily just use the regex:
^\w+ brings a .*+ before (?:his|her) face\, as a corona of light begins emanating from within\.$

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Capturing and subsituting 2 lines together

Post by tsuujin »

The last time I started a character on Imperian they didn't have an option to disable wrapping (which was frustrating enough that I just lost interest and went back to another game after a few hours)

chalraes
Posts: 10
Joined: Mon Jun 14, 2010 10:48 pm

Re: Capturing and subsituting 2 lines together

Post by chalraes »

tsuujin wrote:The last time I started a character on Imperian they didn't have an option to disable wrapping (which was frustrating enough that I just lost interest and went back to another game after a few hours)
Hmm. Just checked, and CONFIG WRAPWIDTH 0 does work on Imperian(in fact, if memory serves, I believe it is a requirement for IMTS, which has been around for more than a few years).

timoomit
Posts: 4
Joined: Tue Jun 15, 2010 8:53 pm

Re: Capturing and subsituting 2 lines together

Post by timoomit »

Cannot seem to find the config on midkemiaonline though.

chalraes
Posts: 10
Joined: Mon Jun 14, 2010 10:48 pm

Re: Capturing and subsituting 2 lines together

Post by chalraes »

timoomit wrote:Cannot seem to find the config on midkemiaonline though.
It seems they changed it on MKO. Try using CONFIG SCREENWIDTH 0

Post Reply