Code: Select all
...............
....................
.......................
pushmode $chan -o $nick1
pushmode $chan -v $nick2
pushmode $chan +b *!ident@mask2.com
pushmode $chan -b *!*@mask1.com
flushmode $chan
.......................
....................
...............
Like here, when your done with all or suppose it is a loop then go ahead and "flushmode $chan" in the end, that is quite fast. Generally the same as compared to putquick.It will do something like this:
* bot sets mode: -ov+b-b nick1 nick2 *!ident@mask2.com *!*@mask1.com
Code: Select all
putquick "MODE $chan +oo-v+b-b nick1 nick2 nick3 *!ident@mask *!*@mask" -next
awyeah wrote:Code: Select all
putquick "MODE $chan +oo-v+b-b nick1 nick2 nick3 *!ident@mask *!*@mask" -next
Code: Select all
proc punish:flood { nickname BUZAout channel abuse } {
pushmode $channel +b $BUZAout
utimer 10 [list badall:kick "$nickname" "$channel" "$abuse" ]
return 0
}
There are limitations for the eggdrop and also limitations server administrators have placed.# F Can use umode +F (no flood limits)
Putquick will send every modechange in a singe line. Pushmode will take some seconds longer.[15:41:45] * haaaaaaaa2369 (Kimi96@pcp08025073pcs.dalect01.va.comcast.net) has joined #test22k
[15:41:45] * haaaaaaaa5635 (Carol60@pcp09279197pcs.eatntn01.nj.comcast.net) has joined #test22k
[15:41:45] * haaaaaaaa7347 (nobody@61.206.125.114.user.ip8.il24.net) has joined #test22k
[15:41:46] * Testdrop sets mode: +bbbb haaaaaaaa*!*@* *!*@pcp08025073pcs.dalect01.va.comcast.net *!*@pcp09279197pcs.eatntn01.nj.comcast.net *!*nobody@61.206.125.114.user.ip8.il24.net
Code: Select all
#
# put:quick - version 0.1 by sKy\
#
# usage:
# put:quick channel what ?target?
#
#
#
# returns - nothing (might me changed in next version)
#
# supports only mode. use this command instand of: putquick "MODE $channel $what" or putquick "MODE $channel $what $target"
# does not support +k $key / -k $key
# or +l $limit (might be changed in next version, but only maybe :P)
#
# - will not send any modechanges to the server if the bot isn`t opped
# - will not op people which are op / will not deop people which are allready deoped
# - will not set bans which are allready set / will not unban bans which are not set
#
set put_quick_refresh 201
proc putquick:op { channel target } {
if {! [info exists ::aoped($channel,$target) ] } {
set ::aoped($channel,$target) 1
utimer 5 [list unset ::aoped($channel,$target)]
if { ! [isop $target $channel] } {
put:quick:input $channel +o $target
}
}
}
proc putquick:deop { channel target } {
if {! [info exists ::adeoped($channel,$target) ] } {
set ::adeoped($channel,$target) 1
utimer 5 [list unset ::adeoped($channel,$target)]
if { [isop $target $channel] } {
put:quick:input $channel -o $target
}
}
}
proc putquick:ban { channel hostname } {
if {! [info exists ::apushed($channel,$hostname) ] } {
set ::apushed($channel,$hostname) 1
utimer 5 [list unset ::apushed($channel,$hostname)]
set resultISBAN [isban:test $hostname $channel]
if { $resultISBAN == "ISNOTBAN" } {
put:quick:input $channel +b $hostname
}
}
}
proc putquick:unban { channel hostname } {
if {! [info exists ::aunbanned($channel,$hostname) ] } {
set ::aunbanned($channel,$hostname) 1
utimer 5 [list unset ::aunbanned($channel,$hostname)]
set resultISBAN [isban:test $hostname $channel]
if { $resultISBAN == "ISBAN" } {
put:quick:input $channel -b $hostname
}
}
}
proc putquick:mode { channel what } {
if {! [info exists ::amode($channel,$what) ] } {
set ::amode($channel,$what) 1
utimer 5 [list unset ::amode($channel,$what)]
put:quick:input $channel $what
}
}
proc put:quick { channel what {target ""} } {
set plus_or_minus [string index $what 0]
set modechange [string index $what 1]
if { $plus_or_minus == "+" } {
if { $modechange == "o" } {
putquick:op $channel $target
return
}
if { $modechange == "b" } {
putquick:ban $channel $target
return
}
putquick:mode $channel $what
return
}
if { $plus_or_minus == "-" } {
if { $modechange == "o" } {
putquick:deop $channel $target
return
}
if { $modechange == "b" } {
putquick:unban $channel $target
return
}
putquick:mode $channel $what
return
}
return
}
proc put:quick:clearqueue { channel } {
if { [info exists ::put_quick_list($channel) ] } {
unset ::put_quick_list($channel)
}
if { [info exists ::put_quick_list_mode_plus($channel) ] } {
unset ::put_quick_list_mode_plus($channel)
}
if { [info exists ::put_quick_list_mode_minus($channel) ] } {
unset ::put_quick_list_mode_minus($channel)
}
if { [info exists ::put_quick_list_bans_plus($channel) ] } {
unset ::put_quick_list_bans_plus($channel)
}
if { [info exists ::put_quick_list_bans_minus($channel) ] } {
unset ::put_quick_list_bans_minus($channel)
}
if { [info exists ::put_quick_list_op_plus($channel) ] } {
set ::put_quick_list_op_plus($channel) ""
}
if { [info exists ::put_quick_list_op_minus($channel) ] } {
set ::put_quick_list_op_minus($channel) ""
}
return
}
proc put:quick:input { channel what {target ""} } {
# putlog "start. put:quick:input - $channel - $what - $target"
if { ! [info exists ::allreadystarted($channel)] } {
set ::allreadystarted($channel) 1
after 201 [list put:quick:pushnow $channel]
}
if { ! [info exists ::put_quick_list($channel) ] } {
set ::put_quick_list($channel) ""
}
if { ! [info exists ::put_quick_list_mode_plus($channel) ] } {
set ::put_quick_list_mode_plus($channel) ""
}
if { ! [info exists ::put_quick_list_mode_minus($channel) ] } {
set ::put_quick_list_mode_minus($channel) ""
}
if { ! [info exists ::put_quick_list_bans_plus($channel) ] } {
set ::put_quick_list_bans_plus($channel) ""
}
if { ! [info exists ::put_quick_list_bans_minus($channel) ] } {
set ::put_quick_list_bans_minus($channel) ""
}
if { ! [info exists ::put_quick_list_op_plus($channel) ] } {
set ::put_quick_list_op_plus($channel) ""
}
if { ! [info exists ::put_quick_list_op_minus($channel) ] } {
set ::put_quick_list_op_minus($channel) ""
}
set plus_or_minus [string index $what 0]
set modechange [string index $what 1]
if { $plus_or_minus == "+" || $plus_or_minus == "-" } {
if { $plus_or_minus == "+" } {
# putlog "plusmode $modechange"
if { $modechange == "t" || $modechange == "n" ||
$modechange == "i" || $modechange == "m" ||
$modechange == "k" || $modechange == "l" ||
$modechange == "p" || $modechange == "s" ||
$modechange == "c" || $modechange == "C" ||
$modechange == "N" || $modechange == "r" ||
$modechange == "D" || $modechange == "u" } {
append ::put_quick_list_mode_plus($channel) $modechange
# putlog "put:quick - ::put_quick_list_mode_plus($channel): $::put_quick_list_mode_plus($channel) - modechange: $modechange "
return
}
if { $modechange == "o" } {
append ::put_quick_list_op_plus($channel) "$target "
# putlog "put:quick - ::put_quick_list_op_plus($channel): $::put_quick_list_op_plus($channel) - modechange: $target "
}
if { $modechange == "b" } {
append ::put_quick_list_bans_plus($channel) "$target "
# putlog "put:quick - ::put_quick_list_bans_plus($channel): $::put_quick_list_bans_plus($channel) - modechange: $target "
}
}
if { $plus_or_minus == "-" } {
putlog "minusmode $modechange"
if { $modechange == "t" || $modechange == "n" ||
$modechange == "i" || $modechange == "m" ||
$modechange == "k" || $modechange == "l" ||
$modechange == "p" || $modechange == "s" ||
$modechange == "c" || $modechange == "C" ||
$modechange == "N" || $modechange == "r" ||
$modechange == "D" || $modechange == "u" } {
append ::put_quick_list_mode_minus($channel) $modechange
# putlog "put:quick - ::put_quick_list_mode_minus($channel): $::put_quick_list_mode_minus($channel) - modechange: $modechange "
return
}
if { $modechange == "o" } {
append ::put_quick_list_op_minus($channel) "$target "
# putlog "put:quick - ::put_quick_list_op_minus($channel): $::put_quick_list_op_minus($channel) - modechange: $target "
}
if { $modechange == "b" } {
append ::put_quick_list_bans_minus($channel) "$target "
# putlog "put:quick - ::put_quick_list_bans_minus($channel): $::put_quick_list_bans_minus($channel) - modechange: $target "
}
}
set oplist_lenght_plus [llength $::put_quick_list_op_plus($channel)]
# putlog "1. put:quick: - oplist_lenght_plus - $oplist_lenght_plus"
set oplist_lenght_minus [llength $::put_quick_list_op_minus($channel)]
# putlog "2. put:quick: - oplist_lenght_minus - $oplist_lenght_minus"
set banlist_lenght_plus [llength $::put_quick_list_bans_plus($channel)]
# putlog "3. put:quick: - banlist_lenght_plus - $banlist_lenght_plus"
set banlist_lenght_minus [llength $::put_quick_list_bans_minus($channel)]
# putlog "4. put:quick: - banlist_lenght_minus - $banlist_lenght_minus"
set lenght [expr $banlist_lenght_plus + $banlist_lenght_minus + $oplist_lenght_plus + $oplist_lenght_minus]
# putlog "END. put:quick - lenght - $lenght"
if { $lenght == 6 } {
putlog "6 there..."
put:quick:pushnow $channel
}
} else {
return "Error: illegal modechange"
}
return
}
proc put:quick:pushnow { channel } {
global put_quick_refresh botnick
if { ! [info exists ::put_quick_list($channel) ] } {
set ::put_quick_list($channel) ""
}
if { ! [info exists ::put_quick_list_mode_plus($channel) ] } {
set ::put_quick_list_mode_plus($channel) ""
}
if { ! [info exists ::put_quick_list_mode_minus($channel) ] } {
set ::put_quick_list_mode_minus($channel) ""
}
if { ! [info exists ::put_quick_list_bans_plus($channel) ] } {
set ::put_quick_list_bans_plus($channel) ""
}
if { ! [info exists ::put_quick_list_bans_minus($channel) ] } {
set ::put_quick_list_bans_minus($channel) ""
}
if { ! [info exists ::put_quick_list_op_plus($channel) ] } {
set ::put_quick_list_op_plus($channel) ""
}
if { ! [info exists ::put_quick_list_op_minus($channel) ] } {
set ::put_quick_list_op_minus($channel) ""
}
set change_plus "+$::put_quick_list_mode_plus($channel)[string repeat "b" [llength $::put_quick_list_bans_plus($channel)]][string repeat "o" [llength $::put_quick_list_op_plus($channel)]]"
set change_minus "-$::put_quick_list_mode_minus($channel)[string repeat "b" [llength $::put_quick_list_bans_minus($channel)]][string repeat "o" [llength $::put_quick_list_op_minus($channel)]]"
set change "$change_minus$change_plus $::put_quick_list_bans_minus($channel) $::put_quick_list_op_minus($channel) $::put_quick_list_bans_plus($channel) $::put_quick_list_op_plus($channel)"
set x [string map {" " ""} $change]
if { $x != "-+" } {
putlog "put:quick:pushnow - putquick MODE $channel $change"
if { [isop $botnick $channel] } {
putquick "MODE $channel $change" -next
}
put:quick:clearqueue $channel
after $put_quick_refresh [list put:quick:pushnow $channel]
return
}
after $put_quick_refresh [list put:quick:pushnow $channel]
return
}
###################################################################################################################################
# isban:test #
###################################################################################################################################
# isban:test $banmask $channel
# returns: ISBAN or ISNOTBAN
# if ban is allready in banlist will be not pushed
proc isban:test { ISBANin channel } {
foreach bans [chanbans $channel] {
set mask [lindex $bans 0]
set from [lindex $bans 1]
set since [lindex $bans 2]
if {[string match $ISBANin $mask]} {
return "ISBAN"
}
}
return "ISNOTBAN"
}