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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Matching of Prompt

Matching of Prompt

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


Posted by Lethethar   (7 posts)  [Biography] bio
Date Wed 16 Jul 2014 07:11 PM (UTC)
Message
I am trying to match all the varieties of my prompts
I have my prompt matched when out of combat but the second I end up in combat I cannot seem to make it match. <triggers>
<trigger
clipboard_arg="5"
enabled="y"
match="^(\d+)H (\d+)V (\d+)X (\d+)C Exits\:[NWSEUD]+\&gt;$"
regexp="y"
send_to="12"
sequence="100"
>
<send></send>
</trigger>
</triggers>
This works and matches the prompt but when I go into combat my prompt looks like

115H 94V 26542X 6C [Sel:Perfect] [the small black spider:Good] Exits:EW> 

<triggers>
<trigger
enabled="y"
match="^(\d+)H (\d+)V (\d+)X (\d+)C [\w\:[A-Za-z .]+] [(\w +)\:[A-Za-z .]+]Exits\:[NESWUD]+\&gt;$"
match_text_colour="y"
regexp="y"
send_to="12"
sequence="100"
text_colour="8"
>
<send></send>
</trigger>
</triggers>
but this trigger does not match. does not fire ver 4.84
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Wed 16 Jul 2014 07:37 PM (UTC)

Amended on Wed 16 Jul 2014 07:41 PM (UTC) by Fiendish

Message
FYI: the forum is eating some of your slashes. \[ and \] should be entered as \\[ \\] when you post here. MUSHclient has a feature that makes whatever is in your OS Clipboard forum-safe.

The simple explanation is that (and of course you know this already) your regex is wrong.

I have more luck with

^(\d+)H (\d+)V (\d+)X (\d+)C \[\w+\:[A-Za-z .]+\] \[([\w ]+)\:[A-Za-z .]+\] Exits\:[NESWUD]+\&gt;$


For future regex help, you should try one of the handy online assistants like http://www.regexr.com/

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Lethethar   (7 posts)  [Biography] bio
Date Reply #2 on Wed 16 Jul 2014 08:21 PM (UTC)
Message
Thank you for the help had been going over it for several hours.
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 16 Jul 2014 09:17 PM (UTC)
Message
There is a helper menu inside the trigger edit window:



That can help choose appropriate elements.

Also:

Template:regexp Regular expressions
  • Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
  • Also see how Lua string matching patterns work, as documented on the Lua string.find page.

- 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.


12,037 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 HostDash]