Thing is, that their spambots/drones don't have a ctcp version reply.
So my question is this, how can I make it scan on join for ctcp version replies and IF we get one (or a certain reply for future use), then proceed to the timer and voice after the time set. Here's the script:
Code: Select all
#Set your maximum idletime here
set maxidle 60
bind time - * idlecheck
#Set your channel name Here
set voicechan "#channel"
bind join - "#channel *" av:join
bind part - "#channel *" av:part
bind mode - "#channel +v" av:mode
bind sign - "#channel *" av:part
proc av:join {nick host hand chan} {
set host [string trimleft $host ~]
global dontvoice
if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
if {[botisop $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
utimer 300 [list pushmode $chan +v $nick]
}
}
proc av:part {nick host hand chan {msg ""}} {
set host [string trimleft $host ~]
global dontvoice
if ![info exists dontvoice($chan)] { set dontvoice($chan) [list] }
if {![isbotnick $nick]&&![isvoice $nick $chan]&&![isop $nick $chan]&&[lsearch -exact $dontvoice($chan) $host]=="-1"} {
lappend dontvoice($chan) $host
timer 300 [list set dontvoice($chan) [lreplace $dontvoice($chan) [set foo [lsearch -exact $dontvoice($chan) $host]] $foo]]
}
}
proc av:mode {nick host hand chan mode {target ""}} {
set thost [string trimleft [getchanhost $target $chan] ~]
global dontvoice
if ![info exists dontvoice($chan)] return
if {[set foo [lsearch -exact $dontvoice($chan) $thost]]!="-1"} {
set dontvoice($chan) [lreplace $dontvoice($chan) $foo $foo]
}
}
proc idlecheck {min hour day month year} {
global botnick voicechan maxidle
foreach nick [chanlist $voicechan] {
if {$nick == $botnick} {continue}
if {[isop $nick $voicechan]} {continue}
if {![isvoice $nick $voicechan]} {continue}
if {[getchanidle $nick $voicechan] > $maxidle } {
putserv "MODE $voicechan -v-k $nick \00312Inactive.user(s)\00304"
}
}
}