Here are the main two parts, the rest are in the link I sent you on Aard.
this toggless the channels on/off:
<alias
match="chancap:*"
send_to="12"
sequence="101"
enabled="y"
>
<send> local temp = channels["%1"]
if temp ~= nil then
temp = not(temp)
ColourTell( "white", "black", "ChanCap: ",
"lime", "black", "%1",
"white", "black", " turned " )
if temp == true then
ColourNote( "lime", "black", "on" )
else
ColourNote( "lime", "black", "off" )
end
SetVariable( "%1", tostring( temp ) )
channels["%1"] = temp
EnableTriggerGroup( "%1", temp )
else
ColourNote( "white", "black", "Invalid option. Please check ",
"lime", "black", "chancap:help",
"white", "black", " for a list of commands." )
end
</send>
</alias>
And here's the rest of the script. Anything that matches a channel is sent to the chancap function.
channels = { ["clantalk"] = GetVariable( "clantalk" ) == "true",
["ftalk"] = GetVariable( "ftalk" ) == "true",
["spouse"] = GetVariable( "spouse" ) == "true",
["gtell"] = GetVariable( "gtell" ) == "true",
["gossip"] = GetVariable( "gossip" ) == "true",
["tiertalk"] = GetVariable( "tiertalk" ) == "true",
["tech"] = GetVariable( "tech" ) == "true",
["barter"] = GetVariable( "barter" ) == "true",
["global"] = GetVariable( "global" ) == "true",
["curse"] = GetVariable( "curse" ) == "true",
["debate"] = GetVariable( "debate" ) == "true",
["gametalk"] = GetVariable( "gametalk" ) == "true",
["gratz"] = GetVariable( "gratz" ) == "true",
["immtalk"] = GetVariable( "immtalk" ) == "true",
-- class channels below
["commune"] = GetVariable( "commune" ) == "true"
}
for i,v in pairs( channels ) do
EnableTriggerGroup( i, v )
end
function chancap( TriggerName, trig_line, wildcards, style )
w = GetWorld( "chancap" ) -- get channel specific soon
if w then -- attempt to print only if channel window is open.
for i,v in pairs(style) do
w:ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), v.text)
end
w:Note( "" )
end
end -- chancap
|