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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Multi Line Trigger

Multi Line Trigger

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page


Posted by Mudletusr   (2 posts)  [Biography] bio
Date Mon 01 Apr 2024 12:10 PM (UTC)
Message
Hi I"m trying to get this small multi line trigger working thanks. I want to match the last word of the second line.

Right here you (.*)$(.*)(\w+).*\z

For example:

Right here you see:
- The rabbit
- A field mouse

Should match rabbit but isn't outputting what I want. I use this:

say 'k %1 %2 aaaaaaaaaaaaa'
say 'k %1 %2 bbbbbbbbbbbb'

thanks
[Go to top] top

Posted by Nick Gammon   Australia  (23,001 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 02 Apr 2024 02:32 AM (UTC)
Message
Can you show the actual trigger please? See this:

Template:copying For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.


Quote:

Should match rabbit but isn't outputting what I want.


What is it outputting?

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,001 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 02 Apr 2024 02:46 AM (UTC)

Amended on Tue 02 Apr 2024 02:47 AM (UTC) by Nick Gammon

Message
Try this:


<triggers>
  <trigger
   enabled="y"
   lines_to_match="2"
   match="Right here you (.*)\n(?:.*)\s+(\w+)\Z"
   multi_line="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
print ("%%1 = %1")
print ("%%2 = %2")
  </send>
  </trigger>
</triggers>


Template:pasting For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.

- Nick Gammon

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

Posted by Mudletusr   (2 posts)  [Biography] bio
Date Reply #3 on Wed 03 Apr 2024 04:43 AM (UTC)
Message
That worked thanks a lot!
[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.


636 views.

You need to log onto the forum to reply or create new threads.

  [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 HostDash]