[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]  Bug reports
. . -> [Subject]  Trigger "Copy wildcard to Clipboard" happens on failed matches
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger "Copy wildcard to Clipboard" happens on failed matches

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


Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Sat 18 Oct 2008 10:18 PM (UTC)
Message
On the mud I play, walking around briefed shows rooms like:

"On a balcony (n,e)"

and you can set an ansi variable so matching it isn't a problem.


<triggers>
  <trigger
   back_colour="14"
   bold="y"
   clipboard_arg="1"
   enabled="y"
   match="^(.* (\(.*\)))$"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   name="RoomGrab"
   regexp="y"
   script="graphExits"
   sequence="100"
   text_colour="15"
  >
  </trigger>
</triggers>


This works as expected.

My hp bar echos output like:
 HP: 756/1013  K: 498/498 SP: 224/224 V: 92% [[ AG:277 O:373 PE:158 B MB HS:18 ]]   | 660637/337621 (92%)

It has multiple ansi codes in it, the first space nor the "HP:" are white on cyan, like the room short echos. Trace shows that it's not matching. However, the entire hpbar ends up on the clipboard. Disabling the RoomGrab trigger stops the behavior. (So it's not a conflicting trigger)

Thanks Nick! :)
[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sun 19 Oct 2008 03:16 AM (UTC)
Message
I can't reproduce that. Bear in mind that clipboard_arg="1" means it should copy argument 1 to the clipboard, so the clipboard text would have in it "On a balcony (n,e)" not the HP bar stuff.

- Nick Gammon

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

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Sun 19 Oct 2008 04:45 AM (UTC)

Amended on Sun 19 Oct 2008 05:16 AM (UTC) by WillFa

Message
Simpler test:
<triggers>
  <trigger
   back_colour="14"
   clipboard_arg="1"
   enabled="y"
   match="^(.*?)$"
   match_back_colour="y"
   match_text_colour="y"
   regexp="y"
   send_to="12"
   sequence="100"
   text_colour="15"
  >
  <send>print("Matched")</send>
  </trigger>
</triggers>

In the trigger test box, paste the below:

\1B[46mPassed\1B[0m
Failed

(be sure to have the trailing enter after "Failed")
"Matched" gets noted only once, as expected.
Press ctrl+v. "Failed" is pasted into your input box.

[Go to top] top

Posted by Nick Gammon   Australia  (21,323 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sun 19 Oct 2008 08:40 PM (UTC)
Message
Ah yes I see what you mean. That will be fixed in version 4.38. The code to copy the matching wildcard to the clipboard was after the test for the regular expression match, but before the test for the colour match. I have moved that and it works correctly now.

- Nick Gammon

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

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #4 on Sun 19 Oct 2008 11:31 PM (UTC)
Message
Cool. Thanks Nick. :)
[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,944 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]