I am using the following to color channels and recently tried to add code to handle the new 'other_text_colour' and 'other_back_colour' options, but it fails:
The 'normal' ones work, but here is what seems to happen with the new 'druid' trigger (numbered lines):
1. Tries to set new trigger to be the same as the 'druid' one.
2. Checks to see if this is a special color.
3. Shows the setting that the 'colorcode' trigger got, which shows -1???
4-5 Do nothing as a result.
The problem gets worse if you set a trigger up to use such a color. gettriggeroption(trigname, "other_text_colour") would return the 'correct' color, but if you set 'other_text_colour' or 'other_back_colour' it always ends up with Black, this is setting it directly like above (which is probably bad anyway), using a color name like "Red" or using HTML like "#FF0000". All color types set it from whatever you wanted to 0. Please tell me I am just doing something wrong here...
<triggers>
<trigger
custom_colour="17"
enabled="y"
keep_evaluating="y"
match="^(\d\d:\d\d\s)?(\[druid\])(.*)"
name="druid"
regexp="y"
script="setcolorgrab"
sequence="5"
other_text_colour="#25C29B"
other_back_colour="black"
>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^()(\S{1,})(.*)"
name="General2"
regexp="y"
script="setcolorgrab"
sequence="6"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
<trigger
enabled="y"
keep_evaluating="y"
match="^()(\[(gossip|bs|aod|events|healer|bardic|cleric)\])(.*)"
name="General"
regexp="y"
script="setcolorgrab"
sequence="7"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
</triggers>
sub setcolorgrab (trigname, output, wildcards)
dim exptemp, exptemp2
dim CheckList
CheckList = "[gossip],[bs],[aod],[events],[druid],[healer],[bardic],[newbie],[sales],[hero]"
exptemp = "^ ([ ]*)(.*)"
'exptemp2 = "^\S{1,}(.*)"
dim temp, temp2, count
temp = split(CheckList,",")
temp2 = 1
if instr(wildcards(2), ":") then
temp2 = 0
else
for count = 0 to ubound(temp)
if instr(wildcards(2),temp(count)) then
temp2 = 0
exit for
end if
next
end if
if trigname <> "General2" or (trigname = "General2" and temp2) then
1 world.addtrigger "colorcode", exptemp, "", 1065, world.gettriggerinfo(trigname,19), 0, "", ""
2 if gettriggerinfo(trigname,19) = 16 then
3 note gettriggerinfo("colorcode",19)
4 settriggeroption "colorcode", "other_text_colour", gettriggeroption(trigname, "other_text_colour")
5 settriggeroption "colorcode", "other_back_colour", gettriggeroption(trigname, "other_back_colour")
end if
end if
world.enabletrigger "General2", 1
end subThe 'normal' ones work, but here is what seems to happen with the new 'druid' trigger (numbered lines):
1. Tries to set new trigger to be the same as the 'druid' one.
2. Checks to see if this is a special color.
3. Shows the setting that the 'colorcode' trigger got, which shows -1???
4-5 Do nothing as a result.
The problem gets worse if you set a trigger up to use such a color. gettriggeroption(trigname, "other_text_colour") would return the 'correct' color, but if you set 'other_text_colour' or 'other_back_colour' it always ends up with Black, this is setting it directly like above (which is probably bad anyway), using a color name like "Red" or using HTML like "#FF0000". All color types set it from whatever you wanted to 0. Please tell me I am just doing something wrong here...