This is a little tough to explain, so bare with me.
I am using a version of Nick's Chatgrabber miniwindow plugin, from http://www.gammon.com.au/forum/?id=10728.
I have modified it for a MUSH, so that you can select which custom channels you want to show up in your window, but it uses a generic trigger "<*> *", which is then passed through a function to determine if it's a channel we want in our window.
If it is a channel we want, great, we display it in the miniwindow, and the trigger omits it from the output window due to it's options.
The tricky part is, I'm finding many users want to clone the plugin with a new pluginID, so they can have more than one miniwindow and have different channels going to different windows.
If each uses the same trigger, but may or may not want that line depending on if the channel is enabled by the user... so if it doesn't want the line, the expected behavior is for the line to stay in the output window. However, since the trigger is set to omit from output, I need to echo it back manually.
If more than one instance of the plugin is running, and more than 1 window doesn't want to handle channel_x, I'll get more than one manually-echo'd copy of the line in the output window.
I'm kind of out of ideas and looking for input on how to handle this.
I'm thinking maybe adding some checks to see if more than one instance is loaded, and having the 'main' instance of the plugin handle all the triggers and passing it around using CallPlugin(), and the slaves will respond true or false if they wanted that line. If that slave doesn't want it, check others. If we're at the last slave, and no one wants it, go ahead and echo it back to the output.
But there may be an easier way to handle this.
Thanks in advance!
I am using a version of Nick's Chatgrabber miniwindow plugin, from http://www.gammon.com.au/forum/?id=10728.
I have modified it for a MUSH, so that you can select which custom channels you want to show up in your window, but it uses a generic trigger "<*> *", which is then passed through a function to determine if it's a channel we want in our window.
If it is a channel we want, great, we display it in the miniwindow, and the trigger omits it from the output window due to it's options.
The tricky part is, I'm finding many users want to clone the plugin with a new pluginID, so they can have more than one miniwindow and have different channels going to different windows.
If each uses the same trigger, but may or may not want that line depending on if the channel is enabled by the user... so if it doesn't want the line, the expected behavior is for the line to stay in the output window. However, since the trigger is set to omit from output, I need to echo it back manually.
If more than one instance of the plugin is running, and more than 1 window doesn't want to handle channel_x, I'll get more than one manually-echo'd copy of the line in the output window.
I'm kind of out of ideas and looking for input on how to handle this.
I'm thinking maybe adding some checks to see if more than one instance is loaded, and having the 'main' instance of the plugin handle all the triggers and passing it around using CallPlugin(), and the slaves will respond true or false if they wanted that line. If that slave doesn't want it, check others. If we're at the last slave, and no one wants it, go ahead and echo it back to the output.
But there may be an easier way to handle this.
Thanks in advance!