I have been trying to make a trigger so that it colours the name of my current target in red, and the rest in white. The trigger:
Basically, the name of my target can either be the first wildcard from the pattern, or the second. What I am having troubles with is leaving the line as it is if the name of my target isn't in that sentence. Here is the gagging script:
The problems I encounter are here:
I don't know how to transform the number from the textcolour field into a viable colour name for the ColourTell function. How do I do that? If anyone has a better idea about how to do this, I am more than willing to listen to any suggestions.
<trigger
enabled="y"
group="test"
match="^(.*)?([A-Z][a-z]+)(.*)?\.$"
omit_from_output="y"
regexp="y"
script="gagging"
send_to="14"
sequence="100"
>
</trigger>
Basically, the name of my target can either be the first wildcard from the pattern, or the second. What I am having troubles with is leaving the line as it is if the name of my target isn't in that sentence. Here is the gagging script:
function gagging (sName, sLine, wildcards, tStyle)
if (wildcards [1] == GetVariable ("target")) then
ColourTell ("red", "", wildcards [1])
ColourNote ("white", "", wildcards [2]..".")
elseif (wildcards [2] == GetVariable ("target")) then
ColourTell ("white", "", wildcards [1])
ColourTell ("red", "", wildcards [2])
if (wildcards [3]) then
ColourTell ("white", "", wildcards [3])
end --if
ColourNote ("white", "", ".")
else
for key, value in pairs (tStyle) do
if (key ~= #tStyle) then
ColourTell (value [textcolour], value [backcolour], value [text])
else
ColourNote (value.textcolour, value.backcolour, value.text)
end --if
end --for
end --if
end --function
The problems I encounter are here:
ColourTell (value [textcolour], value [backcolour], value [text])
I don't know how to transform the number from the textcolour field into a viable colour name for the ColourTell function. How do I do that? If anyone has a better idea about how to do this, I am more than willing to listen to any suggestions.