I have numerous Game & Channel Management scripts loaded on my Eggdrop (v 1.6.19). Some scripts have in-built functionality for specifying the respective #Channel the script should work on, and some don't. My bot sits on two Channels. #Games and #Help. We have some geniuses who activate the games on #Help.
1) As a counter-measure I was wondering if there is a "bind" syntax that limits the commands to one specific channel?
2) Alternatively, could there be a 'quick proc' at the beginning of each TCL script to check if the commands are being issued in the right channel? I want this proc to be more universal in nature, rather than being script specific.
set channels "#Games"
if {[lsearch -exact $channels $chan] == -1} {return 0}
else {
... execute rest of the script
}
Theoretically, I know what I want to do, but I am unable to implement it due to my lack of scripting knowledge. I tried playing around with "setudef flag" too, without much success. Thanks in advance for any replies.
If you only want your game to work in a single channel, the code provided by tueb is fine, but if you want a more flexible way to manage what channels your games work in, create a new channel setting using setudef: