Looking into it, the trigger wasn't even matching. But I just realized a new problem. It'll be a bit.. complex to figure out how to "splice" some content into a line without throwing off the line styles. If we didn't have to worry about the line styles, we could have two more captures in the trigger - one for stuff before the insertion point, and one for stuff after it - and just Note it out. But we're relying on the styles list to re-print the line, and there's no shared context between it and the trigger matches.
If you're okay with the line being one solid color, that's very easy.
Also, I rewrote the match pattern. Seems to work fine now.
<triggers>
<trigger
enabled="y"
match="^((?:\(\s*\d+\))?\s*(.*?) scroll) (\(new\))$"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>ScrollTypes = {
["a glossy lime"] = "ARMOR",
["an ivory-yellow papyrus"] = "BLINDNESS",
["a charcoal lambskin"] = "REVEAL",
["a copper-colored"] = "IDENTIFY",
}
if ScrollTypes["%2"] then
ColourNote("white", "black", "%1 " .. ScrollTypes["%2"] .. " %3")
else
for _,v in ipairs(TriggerStyleRuns) do
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), v.text)
end
Note() -- finish the line
end</send>
</trigger>
</triggers>
EDIT: Fixed an issue that was, in retrospect, a bit obvious: the textcolour and backcolor items are numbers in RGB format, but ColourTell only accepts color names. Fixed above. |