[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multiline/Regular Expression Help
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Multiline/Regular Expression Help

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Pesmare   Australia  (4 posts)  [Biography] bio
Date Sun 29 Jan 2006 06:29 AM (UTC)
Message
Ok, I'm very new to multiline triggers, and even more so to regular expressions, so I could use a little help to be pushed into the right direction, so to speak.

What I am trying to do is have a box picking trigger, which matches on multiple lines, and omits it from output (as box picking is very spammy).

Here is what I am trying to match.


<5090hp4060m LVL53>
A sturdy iron-bound strongbox doesn't appear to be trapped.

Now, that may seem easy enough, but the 5090hp constantly changes, so it needs to be a variable. same as 4060 (but not the "m") and 53. So really, all numbers change.
The other thing that constantly changes is the "sturdy iron-bound strongbox", but it will always be 3 words. Not sure about the "-" though.
I did this as 2 triggers that omitted, originally, but then I realized that the prompt, which is anything from "<" to ">" I always need when not picking so...

Yeah, like I said, any help to push me in the right direction would be awesome. There's a whole lot more of these type of triggers, which I will probably eventually put in VBscript, but...for now, the help I receive will unlock the way to do the rest of them.

Thanks,
Pesmare
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Sun 29 Jan 2006 09:58 AM (UTC)
Message
Is there really any point in matching both lines? The first one is a prompt, so its not part of the "box" output and shouldn't need to be included. In any case, a multi-line trigger can't omit any lines (or re-colour them, for that matter). If you really want to omit both lines then you'll need to use two triggers for it.

Still, more details on what you are trying to do are needed. This sentence: "I did this as 2 triggers that omitted, originally, but then I realized that the prompt, which is anything from "<" to ">" I always need when not picking so..." is especially confusing in the preceding context.
[Go to top] top

Posted by Pesmare   Australia  (4 posts)  [Biography] bio
Date Reply #2 on Mon 30 Jan 2006 07:04 AM (UTC)
Message
I mean that the prompt, which is: <5090hp4060m LVL53>
appears on every command. The picking of boxes etc, is only a small part of the MUD, and I need the prompt when not from those commands. When I omit everything but the prompt (as would happen with a single line trigger), I get this down the screen.

<5090hp4060m LVL53>

<5090hp4060m LVL53>

<5090hp4060m LVL53>

<5090hp4060m LVL53>

etc. What I really want to see is nothing at all. And then when the box is finally picked, I want to see a prompt, plus various things from the boxes, but thats already sorted out. So really, I want the process of picking to show nothing, but the end of picking to show my prompt plus what I got, as would be the normal echo from the MUD.


Does that make more sense?
[Go to top] top

Posted by Nick Gammon   Australia  (21,386 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 30 Jan 2006 07:45 PM (UTC)
Message
Quote:

What I am trying to do is have a box picking trigger, which matches on multiple lines, and omits it from output ...


It is a part of the design of multi-line triggers that you cannot omit them from output. This is in the help file for editing triggers:


"Because of the way they work some trigger processing is not available to multi-line triggers (eg. colouring lines, omit from output, omit from log)."


If you can imagine for a moment, a 50-line multi-line trigger, that has received, displayed, and logged the first 49 lines, then suddenly the 50th line arrives. It isn't really practical to "undraw" the previous 49 lines.

I think the simple solution in your case is to make a second trigger that also omits the prompt line, and enable that only when picking boxes.

Something like this:


Alias: pick box
Send: EnableTrigger "promptline", 0
      Send "pick box"
Send to: script


This effectively re-sends your "pick box" command to the MUD, plus disables the prompt line from appearing (assuming you add a suitable trigger to do so).

Then when you detect the box has been picked, re-enable the prompt line.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,128 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]