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, 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 ➜ Plugins ➜ Mapper Woes 2: Electric Boogaloo (Xterm colours in triggers)

Mapper Woes 2: Electric Boogaloo (Xterm colours in triggers)

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


Posted by Xolorion   (2 posts)  Bio
Date Tue 20 Jul 2021 07:40 AM (UTC)
Message
I have been using the mapper plugin written for TI:Legacy in this thread: https://www.gammon.com.au/forum/bbshowpost.php?id=14139

It's wonderful and writing it for us was a great kindness. It works great right up until you enable xterm colours ingame. I quite enjoy xterm colours, so I took it upon myself to try to update the plugin to be compatible.

I've worked out that the problem lies with the "got_room_name" trigger not being triggered due to the text_colour flag. The trigger fires fine when text_colour is removed - unfortunately, its colour is the only identifying factor available to me when it comes to room names.


<trigger
   enabled="y"
   match="^([^[].*)$"
   match_text_colour="y"
   script="got_room_name"
   text_colour="9"
   keep_evaluating="y"
   sequence="90"
   regexp="y"
   name="room_name"
  >
  </trigger>


So is it possible to match triggers to colours with xterm enabled? I'm having trouble finding documentation on the topic.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Tue 20 Jul 2021 05:50 PM (UTC)

Amended on Tue 20 Jul 2021 05:58 PM (UTC) by Fiendish

Message
Unless MUSHclient is changed to accept values higher than 15 for the match color, you may have to instead have it match any color and then do the color check in the got_room_name function on the incoming styles table.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,070 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 21 Jul 2021 04:54 AM (UTC)
Message
Exactly. Something like:


function got_room_name (name, line, wildcards, styles)
  
  if styles [1].textcolour ~= ColourNameToRGB ("#ff0000") then
    return
  end -- if not the right colour

  -- usual processing here

end -- got_room_name


And then don't match on the colour in the trigger itself.

Of course you need to work out the RGB code for the xterm colour of the room name, but that should be easy enough.

Select an example room name (the first part, which is the colour you are testing on) and then go to Display Menu -> Text Attributes.

In the middle of that dialog box is the exact HTML colour code you need to copy/paste into the script.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Xolorion   (2 posts)  Bio
Date Reply #3 on Wed 21 Jul 2021 07:00 AM (UTC)
Message
Special thanks!

I was able to make the changes as you outlined. It seems to work regardless of whether xterm is enabled ingame or not. In case anyone else has the same curiosity or is trying to find this version of the plugin, my code is on pastebin at https://pastebin.com/0LKM6D9a
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.


11,025 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.