Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Bug reports ➜ Trigger "Copy wildcard to Clipboard" happens on failed matches

Trigger "Copy wildcard to Clipboard" happens on failed matches

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


Posted by WillFa   USA  (525 posts)  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! :)
Top

Posted by Nick Gammon   Australia  (23,120 posts)  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
Top

Posted by WillFa   USA  (525 posts)  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.

Top

Posted by Nick Gammon   Australia  (23,120 posts)  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
Top

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


14,871 views.

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

Go to topic:           Search the forum


[Go to top] top

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