Skip to content

Commit

Permalink
try to extend the color matching to vi buffer remote socials trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
fiendish committed Apr 28, 2023
1 parent 1ac64ae commit 64ec6ac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 7 additions & 2 deletions MUSHclient/worlds/plugins/aard_channels_fiendish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ USAGE:

<trigger
enabled="y"
match="^\*\S.+[^*]$"
match="^\*(?!.*[\]\*] *$).+$"
regexp="y"
script="rsocial"
name="remote_socials"
Expand Down Expand Up @@ -817,7 +817,12 @@ end
function rsocial (name, line, wildcards, styles)
-- Remote socials will always start with a dark cyan or bright magenta *
-- Checking color cuts down on non-socials ending up in the chat log...
if (styles[1].textcolour == GetNormalColour(7) or styles[1].textcolour == GetBoldColour(6)) then
if (
-- no colors, so plain white line
((#styles == 1) and (styles[1].textcolour == GetNormalColour(8)))
-- colors, so asterisk is either dark cyan or bright magenta
or ((styles[1].textcolour == GetNormalColour(7)) or (styles[1].textcolour == GetBoldColour(6)))
) then
local multiline_styles = ToMultilineStyles(styles, nil, nil, true)
storeNonChannel(multiline_styles, "remote_socials")
end
Expand Down
15 changes: 11 additions & 4 deletions MUSHclient/worlds/plugins/aard_vi_review_buffers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,22 @@ category. You could also create your own category.
<trigger
enabled="y"
group="Alert"
match="^\*(?!\*)(.*)[^*\]]$"
match="^\*(?!.*[\]\*] *$).+$"
name="GlobalEmoteTrigger"
regexp="y"
send_to="12"
send_to="14"
sequence="100"
>
<send>
review_addline("All", "%0")
review_addline("Say", "%0")
if (
-- no colors, so plain white line
((#TriggerStyleRuns == 1) and (TriggerStyleRuns[1].textcolour == GetNormalColour(8)))
-- colors, so asterisk is either dark cyan or bright magenta
or ((TriggerStyleRuns[1].textcolour == GetNormalColour(7)) or (TriggerStyleRuns[1].textcolour == GetBoldColour(6)))
) then
review_addline("All", "%0")
review_addline("Say", "%0")
end
</send>
</trigger>

Expand Down

0 comments on commit 64ec6ac

Please sign in to comment.