I have my bot set to +bitch on all its channels. But after I added a public command tcl, I've noticed that any +o user can op anyone, regardless as to weather or not the user being op'ed has got the +o flag for that channel. If the just oped user then changes nick, the bot deops them.
I think whats happening is the public command script is giving a standard +o user 'pseudo' +m status as it were, and just opping anyone asked of it, rather than call an internal routine to see if the user should be op'ed in the first place.
I've tried 3 different public command scripts so far, and they all have this problem. Has anyone else encountered this? Or made a work around for it? Perhaps found a script which checks the user list before it ops someone?
Two questions though, can I add the line anywhere? Though I'm thinking it should go at the start of the script.
Also in your line of code, is the exclamation mark part of the code, or does it signify the command character used to op? eg !op. As I have mine set to a % character, so am thinking I need to change this maybe?
No need to change this, as you tried to guess, it's part of the code.
The "if" command, performs actions, based on a set of tests.
These tests can either equal TRUE or FALSE.
Running the command "[matchattr [nick2hand $text $chan] o]" is testing to see if the user, that might be opped (IE - %op ppslim - it tests ppslim). If he is +o in the userfile, the it returns TRUE, if not, FALSE.
Using ! negates a answer.
So, the above command becomes, if ppslim is NOT +o, then return TRUE, else, return FALSE.
As for where to place the line, it realy depends on the script you are using.
putserv "privmsg $nick :$tex"
}
proc op {www liquid2k com slash xzziroz} {
set nick [lindex $xzziroz 0]
if {$nick != ""}\
{putserv "mode $slash +o $nick" -next
} else {putserv "mode $slash +o $www" -next}
}
proc deop {www liquid2k com slash xzziroz} {
So would I be right in saying I can just add Papillon's line of code above the 'proc op' line? Or is my lack of tcl know how showing? Or might it have to be included into the current if argument?
While the code in there is rather up the wall, and inforrect (You would have to read toher threads to see why). You can simply add that line, below, the "proc op" line.
proc op {www liquid2k com slash xzziroz} {
if {![matchattr $com o $slash]} { return }
set nick [lindex $xzziroz 0]
if {$nick != ""}\
{putserv "mode $slash +o $nick" -next
} else {putserv "mode $slash +o $www" -next}
}
But I still have the same problem, the bot ops people it shouldn't be.
Pehaps though, as you have pointed out that the script is non too correct, maybe I should stop using it, and try altering another script..
Open to suggestions though.