Usage:
.chanset <#channel> +idlekick
.chanset <#channel> idlekick-time <time(minets)>
Code: Select all
# time in minets to check channels for idlers? (default: 10)
set idlekick_checktime "10"
# set your IRCd's kick length below (default: 150)
# -- note, some networks all 255. but 150 should be safe :)
set idlekick_kicklength "150"
# set the kick message
set idlekick_kickmsg "idle lamer"
# Set the warn message
set idlekick_warnmsg "how lame are you? Mr I idle in a help channel"
# warn the user a minet before the set idle time for the channel?
# -- this should allow you to inform the user better, that they will be kicked in a minet if they contine to idle. ;p
# 1/0 = yes/no
set idlekick_loseit "1"
# Punishments
# 1 = kick the user.
# 2 = kick and ban the user.
# 3 = warn and kick the user.
# 4 = warn, kick and ban the user.
# 5 = warn the user.
set idlekick_punish "4"
# code
proc time:idlekick {minuet hour day month year} {
global idlekick_loseit idlekick_punish
foreach channel [channels] {
if {[channel get $channel idlekick] == "+" && [botisop $channel]} {
foreach iu [chanlist $channel] {
if {![isbotnick $iu] && [onchan $iu $channel] && ![isop $iu $channel] && ![ishalfop $iu $channel] && ![isvoice $iu $channel]} {
if {$idlekick_loseit == 1 && [expr [channel get $channel idlekick-time] -1] == [getchanidle $iu $channel]} {
switch $idlekick_punish {
"1" {idle:kick "$channel $iu"}
"2" {idle:kickban "$channel $iu"}
"3" {idle:warnkick "$channel $iu"}
"4" {idle:warnkickban "$channel $iu"}
"5" {idle:warn "$channel $iu"}
}
}
if {$idlekick_loseit == 0 && [channel get $channel idlekick-time] == [getchanidle $iu $channel]} {
switch $idlekick_punish {
"1" {idle:kick "$channel $iu"}
"2" {idle:kickban "$channel $iu"}
"3" {idle:warnkick "$channel $iu"}
"4" {idle:warnkickban "$channel $iu"}
"5" {idle:warn "$channel $iu"}
}
}
}
}
}
}; return
}
proc idle:kick {text} {
global idlekick_kickmsg idlekick_kicklength
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan] && [botisop $chan]} {
putserv "KICK $chan $nick :[trimchars "$idlekick_kickmsg $idlekick_kicklength"]"
}; return
}
proc idle:kickban {text} {
global idlekick_kickmsg idlekick_kicklength
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan] && [botisop $chan]} {
putserv "MODE $chan +b "*!*@[lindex [split [getchanhost $nick] "@"] 1]"
putserv "KICK $chan $nick :[trimchars "$idlekick_kickmsg $idlekick_kicklength"]"
}; return
}
proc idle:warnkick {text} {
global idlekick_loseit
idle:warn "$text"
if {$idlekick_loseit == 1} {
utimer 54 {idle:kick "$text"}
} else {
idle:kick "$text"
}; return
}
proc idle:warnkickban {text} {
global idlekick_loseit
idle:warn "$text"
if {$idlekick_loseit == 1} {
utimer 54 {idle:kickban "$text"}
} else {
idle:kickban "$text"
}; return
}
proc idle:warn {text} {
global idlekick_warnmsg
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan]} {
puthelp "NOTICE $nick :$idlekick_warnmsg"
}; return
}
proc trimchars {text} {
set chars [lrange "$text" 0 [expr [llength "$text"] -1]]
set trim [lrange "$text" end end]
return [join [lrange "[split "$chars" {}]" 0 $trim] {}]
}
# channel options
setudef flag idlekick
setudef str idlekick-time
# binds
bind time - "$idlekick_checktime * * * *" time:idlekick
#end
putlog "loaded idlekick.tcl version 1.1 by TCL_no_TK"
return
Code: Select all
putserv "KICK $chan $nick :[trimchars $idlekick_kickmsg $idlekick_kicklength]"
...snipped irrelevant sections...
proc trimchars {text} {
Code: Select all
putserv "KICK $chan $nick :[trimchars "$idlekick_kickmsg $idlekick_kicklength"]"
Code: Select all
# idlekick.tcl version 1.1.1 by TCL_no_TK <ispmailsucks@googlemail.com>
#
# this script was written for user qetuoadgjl on egghelp.org forums
# Post: http://forum.egghelp.org/viewtopic.php?t=15543
#
# Kicks users after a set about of idle time, configurable via dcc chanset command.
# Ability to warn users before kicking and banning them, and other punishment options.
#
# Usage:
# .chanset <#channel> +idlekick
# .chanset <#channel> idlekick-time <time(minets)>
#
##
# time in minets to check channels for idlers? (default: 10)
set idlekick_checktime "2"
# set your IRCd's kick length below (default: 150)
# -- note, some networks all 255. but 150 should be safe :)
set idlekick_kicklength "10"
# set the kick message
set idlekick_kickmsg "3Idling is 4NOT4 3allowed"
# Set the warn message
set idlekick_warnmsg "3Ask your 4QUESTION "
# warn the user a minet before the set idle time for the channel?
# -- this should allow you to inform the user better, that they will be kicked in a minet if they contine to idle. ;p
# 1/0 = yes/no
set idlekick_loseit "1"
# Punishment Options
# 1 = kick the user.
# 2 = kick and ban the user.
# 3 = warn and kick the user.
# 4 = warn, kick and ban the user.
# 5 = warn the user.
set idlekick_punish "3"
#code
proc time:idlekick {minuet hour day month year} {
global idlekick_loseit idlekick_punish
foreach channel [channels] {
if {[channel get $channel idlekick] == "+" && [botisop $channel]} {
foreach iu [chanlist $channel] {
if {![isbotnick $iu] && [onchan $iu $channel] && ![isop $iu $channel] && ![ishalfop $iu $channel] && ![isvoice $iu $channel]} {
if {$idlekick_loseit == 1 && [expr [channel get $channel idlekick-time] -1] == [getchanidle $iu $channel]} {
switch $idlekick_punish {
"1" {idle:kick "$channel $iu"}
"2" {idle:kickban "$channel $iu"}
"3" {idle:warnkick "$channel $iu"}
"4" {idle:warnkickban "$channel $iu"}
"5" {idle:warn "$channel $iu"}
}
}
if {$idlekick_loseit == 0 && [channel get $channel idlekick-time] == [getchanidle $iu $channel]} {
switch $idlekick_punish {
"1" {idle:kick "$channel $iu"}
"2" {idle:kickban "$channel $iu"}
"3" {idle:warnkick "$channel $iu"}
"4" {idle:warnkickban "$channel $iu"}
"5" {idle:warn "$channel $iu"}
}
}
}
}
}
}; return
}
proc idle:kick {text} {
global idlekick_kickmsg idlekick_kicklength
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan] && [botisop $chan]} {
putserv "KICK $chan $nick :[trimchars "$idlekick_kickmsg $idlekick_kicklength"]"
}; return
}
proc idle:kickban {text} {
global idlekick_kickmsg idlekick_kicklength
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan] && [botisop $chan]} {
putserv "MODE $chan +b "*!*@[lindex [split [getchanhost $nick] "@"] 1]"
putserv "KICK $chan $nick :[trimchars "$idlekick_kickmsg $idlekick_kicklength"]"
}; return
}
proc idle:warnkick {text} {
global idlekick_loseit
idle:warn "$text"
if {$idlekick_loseit == 1} {
utimer 54 {idle:kick "$text"}
} else {
idle:kick "$text"
}; return
}
proc idle:warnkickban {text} {
global idlekick_loseit
idle:warn "$text"
if {$idlekick_loseit == 1} {
utimer 54 {idle:kickban "$text"}
} else {
idle:kickban "$text"
}; return
}
proc idle:warn {text} {
global idlekick_warnmsg
set chan [lindex [split $text] 0]
set nick [lindex [split $text] 1]
if {[onchan $nick $chan]} {
puthelp "NOTICE $nick :$idlekick_warnmsg"
}; return
}
proc trimchars {text} {
set chars [lrange "$text" 0 [expr [llength "$text"] -1]]
set trim [lrange "$text" end end]
return [join [lrange "[split "$chars" {}]" 0 $trim] {}]
}
#channel options
setudef flag idlekick
setudef str idlekick-time
#binds
bind time - "$idlekick_checktime * * * *" time:idlekick
#end
putlog "loaded idlekick.tcl version 1.1.1 by TCL_no_TK"
return
Code: Select all
bind join - "#help *" idknotice
proc idknotice {nick uhost handle chan} {
putserv "PRIVMSG $nick :You'll be kicked after [channel get $chan idlekick-time] minutes"
}
Code: Select all
bind join - "#help *" idknotice
proc idknotice {nick uhost handle chan} {
putserv "PRIVMSG $nick :You'll be kicked after [channel get $chan idlekick-time] minutes"
}
Code: Select all
[channel get $chan idlekick-time]
Code: Select all
You'll be kicked after minutes <= no time there
Code: Select all
\002[channel get $chan idlekick-checktime]\002