Hi there, I need a Tcl script wich will make a Bot to keep three different channel modes to three different channels (Bot should return predefined channel modes if an channel mod change detect). Each mode for each channes.
DarkRaptor is 100% correct. You do not need any script to set channel modes, use .chanset to set them. Also be aware, if you have preset channels in the conf file under the channel add section, you might want to set them to the same modes you are wishing to enforce in your channels.
I asked for Tcl script, not module based solution, coz I know that module based is better solution, but I already tryed that, and it did not work. However I will try to figure out why did'nt work, or ill made my very own, i guess very simple, Tcl script, wich should be just triggered on channel mode change, and set them back to +nt-lpmisk. Whatever i do, i will post here when i'm done
I think this is the easiest and fastest way to do it....the command .chanset require to load the module channels, which anyway you need to load, coz without it, you won't be able to make the bot join a channel or save channel specific userfile information.
you asked for a tcl script, but as we already told you, a tcl is not needed to enforce modes in a channel. If you say you already tried that, and it didn't work, then you must have a conflict in your conf file, or another tcl script in interfering.
Before using .chanset to enforce the modes in a certain channel, are you sure that the bot is already in that channel ? the command .+chan make the bot join the channel, and .-chan part that channel, and has nothing to do with modes, so first : do
This _does_ work. You might have chanset unbound in your eggdrop.conf, or you might not have priveleges to set these 'aka your not known as the bot owner'. If your using a network with services, why not just have Chanserv keep these modes enforced?
You don't think you could post the actual error message?
The only case in which I can see that code causing any kind of error would be if the channels-module isn't loaded - but if that's the case, your bot really would'nt be joining the channel in the first case, and .+chan and similar commands would not be available either.
Edit: Also worth noting, users with master and higher access, aswell as the bot itself may override the chanmode settings with their own settings.