I was attempting to allow users of one of my plugins to enable a certain parts at their discretion. Enabling a section would load an assortment to triggers and aliases as well as associated script functions. I've tried this a couple different ways so far, but the problem is always that the triggers are matched, but they cannot find the script function to call in response. So, say user wants to load an extension called 'ext', then dofile('ext.lua') is called. ext.lua would look something like this:
This didn't work, so I tried placing the trigger function inside the ImportXML function using <script> tags as if in a plugin. Still no go. Any suggestions on a way to get this to work? I would technically like this to be removable, but since triggers and aliases I wish to load must have specific groups and names, I have no way to distinguish them from other triggers and aliases. Still, this is only a secondary and minor concern, first I'd like to get this to work. Thanks!
function called_by_trigger()
dostuff()
end
world.ImportXML(
[[
<triggers>
<trigger
enabled="n"
group="Group1"
match="^Match on this\.$"
regexp="y"
script="called_by_trigger"
sequence="100"
>
</trigger>
</triggers>
]]
)
This didn't work, so I tried placing the trigger function inside the ImportXML function using <script> tags as if in a plugin. Still no go. Any suggestions on a way to get this to work? I would technically like this to be removable, but since triggers and aliases I wish to load must have specific groups and names, I have no way to distinguish them from other triggers and aliases. Still, this is only a secondary and minor concern, first I'd like to get this to work. Thanks!