Code: Select all
bind mode - "*+o*" your_procedure
Code: Select all
if {($mode == "+o")}
Code: Select all
set totaltops 0; set list [list]
foreach user [chanlist $chan] {
if {[isop $user $chan]} {
inr totalops; lappend list $user
}
}
if {($totalops > 8)} {
then from there on you can deop the
last op nick found by: set deopnick [lindex $list 8]
or if there is more than one extra op then
you can deop all the extra ones by using:
set deopnicks [lrange $list 8 end]
if {([botisop $chan])} {
putserv "MODE $chan -o $deopnick" #(if there is one extra op)
putserv "MODE $chan -oooooo $deopnicks" #(if more than one extra op)
#For sending a message to the channel you can use:
putserv "PRIVMSG $chan :More than 8 ops arent allowed on $chan, so $deopnick has been deoped."
}
}
}
Code: Select all
putserv "PRIVMSG $chanservices :OP $channel $botnick"
so what i have to change on the autoreop.tcl to work...-irc.brasnet.org- For this service please use /ChanServ
Code: Select all
set chanservices "chanserv@services.dal.net"
Code: Select all
putserv "PRIVMSG $chanservices :OP $channel $botnick"
Code: Select all
putserv "$chanservices OP $channel $botnick"
Code: Select all
#Set channels for this script to work on.
#To use all channels the bot is on, set this as "*".
set checkchans "#chan1 #chan2"
#Set the maximum number of channel ops to allow.
#If they are greater than this, then the last one will be deoped.
set maxops "8"
bind mode - "*+o" check:ops
proc check:ops {nick uhost hand chan mode target} {
global botnick checkchans maxops
set totalops 0; set list [list]
if {($mode == "+o")} {
if {(([lsearch -exact [string tolower $checkchans] [string tolower $chan]] != -1) || ($checkchans == "*"))} {
foreach user [chanlist $chan] {
if {[isop $user $chan]} {
inr totalops; lappend list $user
}
}
if {($totalops > $maxops)} {
set deopnick [lindex $list 8]
if {([botisop $chan]) && ($deopnick != "")} {
putserv "MODE $chan -o $deopnick"
putserv "PRIVMSG $deopnick :<your message here>"
}
}
}
}
}
something rong ?Tcl error [check:ops]: invalid command name "inr"
Code: Select all
inr totalops; lappend list $user
Yah, change inr to incr.abuali wrote:something rong ?Tcl error [check:ops]: invalid command name "inr"Code: Select all
inr totalops; lappend list $user
Code: Select all
set deopnick [lindex $list 8]
Code: Select all
set deopnick [lindex $list $maxops]
Code: Select all
Use: set deopnicks [lrange $list $maxops end]
and: putserv "MODE $chan -oooooo $deopnicks"
I can see your thought process, and what you thought you were doing was what you were supposed to be doing, and was a nice attempt.. However, when the putserv is called, that text is (as you know) sent to server... and as I think you intended, deopnicks is a TCL List, which the server won't understand (when there are certain characters in a list, Tcl surrounds that list element with {}'s, and as such, the server will look for nicks with those {}'s around them, and won't find them)... As such, you'll want to make your list a string...awyeah wrote:Replace these lines:
This will deop more than one nick. If there areCode: Select all
Use: set deopnicks [lrange $list $maxops end] and: putserv "MODE $chan -oooooo $deopnicks"
supposingly 10 ops or more. It can deop upto
6 people at a time, which is sufficient I think.
That should do it.
Code: Select all
putserv "MODE $chan -oooooo [join $deopnicks]"
Code: Select all
set checkchans "#Channel"
set maxops "8"
bind mode - "*+o" check:ops
proc check:ops {nick uhost hand chan mode target} {
global botnick checkchans maxops
set totalops 0; set list [list]
if {(([lsearch -exact [string tolower $checkchans] [string tolower $chan]] != -1) || ($checkchans == "*"))} {
foreach user [chanlist $chan] {
if {[isop $user $chan]} {
incr totalops; lappend list $user
}
}
if {($totalops > $maxops)} {
set deopnick [lrange $list $maxops end]
if {([botisop $chan]) && ($deopnick != "")} {
putserv "MODE $chan -oooooo $deopnick"
putserv "PRIVMSG $chan :$deopnick O Limit de Operadores no Canal e $maxops "
}
}
}
}
putlog "OpLimit By awyeah - LOADED"