Hi.
So I have a plugin.
It contains a simple alias which just passes parameters to lua function:
<alias
name="my_channel_set_pattern"
match="__channel_set_pattern * *"
enabled="y"
group="my_channels"
omit_from_log="y"
send_to="12"
omit_from_output="y"
sequence="100"
>
<send>channel_set_pattern("%1", "%2")</send>
</alias>
channel_set_pattern function just creates a trigger (details probably are irrelevant to the problem, but I'm posting code here just in case):
function channel_set_pattern(name, pattern)
local trigname = "my_channels_"..name.."_pattern"
local replacement = 'channel_add("'..name..'", "%1", "%2")'
check(AddTriggerEx(trigname, pattern, replacement, 1065, -1, 0, "", "", 12, 100))
check(SetTriggerOption(trigname, "group", "my_channels"))
Note("Name pattern for ", name, " set: ", pattern)
end
I add this plugin in global preferences, so that it's automatically installed in all worlds.
I create new world and type '__channel_set_pattern something something' to create trigger.
Everything works, trigger is added.
Then I save my world and close the client, and newly added trigger is not saved, neither in world file nor in plugin state.
Setting save_state="y" in the plugin header does not help.
So the main question here is: how to persist triggers created by plugins?
Thank you in advance!
[EDIT] Code tags added. |