Code: Select all
##
# Commands
##
#
# chanset <#channel> <+/->limit
# This enables (+) or disables (-) the channel limiter for the particular channel.
# Pre-set to number of users in channel + 5.
# Command console: Dcc
setudef flag limit
bind time - "* * * * *" time:ChanLimit
# time:ChanLimit start
proc time:ChanLimit {min hour day month year} {
foreach chan [channels] {
if {![channel get $chan limit]} {
continue
}
set newlimit [expr [llength [chanlist $chan]] + 5]
set currentlimit [currentlimit $chan]
if {$currentlimit < [expr $newlimit - 1] || $currentlimit > [expr $newlimit + 1]} {
sendcmd "mode $chan +l $newlimit"
}
}
}
# time:ChanLimit end
# currentlimit start
proc currentlimit {chan} {
set currentmodes [getchanmode $chan]
if {[string match "*l*" [lindex $currentmodes 0]]} {
return [lindex $currentmodes end]
}
return 0
}
# end currentlimit
Yes, you can put it inside your conf file.cambodia wrote:Thanks for code but can let me know do i need to save as tcl or i can put it inside my conf file ?
and how about other two tcl ?
Code: Select all
bind kick - * relay:kick
proc relay:kick {nick uhost hand chan targ rsn} {
if {[string equal -nocase $::botnick $targ]} {
putlog "Kicked from $chan by $nick!$uhost with reason "$rsn""
}
}
Code: Select all
bind kick - * thirty:fourth
bind time - "00 00*" reset:kicked
proc thirty:fourth {nick uhost hand chan targ rsn} {
global kicked
set knick "[string tolower $nick]"
set chan "[string tolower $chan]"
if {![info exists kicked($knick:$chan)]} { set kicked($knick:$chan) 0 }
incr kicked($knick:$chan)
if {$kicked($knick:$chan) == 34} {
putserv "PRIVMSG $chan :$targ is the 34th nick to be kicked by $nick"
}
}
proc reset:kicked {args} {
global kicked
foreach kick [array names kicked] {
array unset kicked $kick
}
}
1. You still aren't clear about what you want your bot to docambodia wrote:ha ha ha you confuse with my purpose , i mean one kick they will save kick and count 1 then when another user got kick it will count 2 , and next it will increase ... and don't reset the kick and count will we use command !resetkick then it will reset
and the kick can it save to log file or message to channel instead of partyline ?
and i guess the autolimit not work maybe i will try again tomorrow when my channel crow .
Did you set .chanset #channel +limit via DCC with your bot?cambodia wrote:and i guess the autolimit not work maybe i will try again tomorrow when my channel crow .
Code: Select all
# sendcmd - sends a command to the server
proc sendcmd {text} {
putquick "$text"
}
# end sendcmd
As you can see, it works!* Estelle has quit (Ping timeout)
* Enfield sets channel limit to 44
* Zendal has quit (Ping timeout)
* Hours has quit (Ping timeout)
* Enfield sets channel limit to 43
Code: Select all
set bkickfile "bkick.log"
set bkickrelay "#channel"
bind kick - * relay:kick
proc relay:kick {nick uhost hand chan targ rsn} {
if {[string equal -nocase $::botnick $targ]} {
logbkick "Kicked from $chan by $nick!$uhost with reason: $rsn"
puthelp "PRIVMSG $::bkickrelay :Kicked from $chan by $nick!$uhost with reason: $rsn"
}
}
proc logbkick {text} {
puts [set fs [open $::bkickfile a]] "$text"
close $fs
}
Code: Select all
bind kick - * thirty:fourth
bind pub o !resetc reset:count
proc thirty:fourth {nick uhost hand chan targ rsn} {
global kicked
set chan "[string tolower $chan]"
if {![info exists kicked($chan)]} { set kicked($chan) 0 }
incr kicked($chan)
putserv "PRIVMSG $chan :$targ is user $kicked($chan) kicked by $nick"
}
proc reset:cout {nick uhost hand chan arg} {
global kicked
foreach kick [array names kicked] {
array unset kicked $kick
}
}
Code: Select all
setudef flag limit
bind join - * jp:ChanLimit
bind part - * jp:ChanLimit
proc jp:ChanLimit {nick uhost hand chan {arg ""}} {
if {![channel get $chan limit]} { return 0 }
set newlimit [expr [llength [chanlist $chan]] + 5]
putserv "mode $chan +l $newlimit"
}