Explorando: ./tcl

Repositorio de scripts de irc.terrachat.cl desde los canales #TRAFFIC y #LATINWAREZ.

⬅️ Volver

Vista previa de: entroantes.tcl

# check_rejoin.tcl by dun_dacil@ircnet # Proc to check if a user leaves a chan and reenters it with a different # nick after a little time # Set the channels and the time elapsed as you wish, and tcl source it. # Good luck catch {unset -nocomplain -- dun_rejoin} # Channels you want the proc to be active "*" for all channels # aqui activas donde o en que canales estara activa la tcl ejemplo #micanal #miotrocanal # si quieres que sea global y reconozca todos los canales dejalo asi set dun_rejoin(chans) "*" set dun_rejoin(chans) "*" # Time elapsed to expire each entry, in seconds. If the nick left more than # $dun_rejoin(time) it is assumed he/she is not going back and forth # intervalo o tiempo en segundos la cual gravara los host o ips que ingresen bajo el mismo nickname # pasado estos segundos el bot eliminara dicho registro guardados en temporales set dun_rejoin(time) 540 # This will hold the info : host time_of_parting old_nick channel_parted set dun_rejoin(nicks) "" bind join - * dun:rejoin:check proc dun:rejoin:check {nick uhost hand channel} { global dun_rejoin # Check if the nick joined a channel of interest set found "" set chans [string tolower $dun_rejoin(chans)] if {$chans == "*"} {set chans [string tolower [channels]]} foreach j $chans { if {[string tolower $channel] == $j} { set found $j break } } if {$found == ""} {return 0} # Check if the host has been seen already set found -1 set host [lindex [split $uhost "@"] 1] for {set j 0} {$j < [llength $dun_rejoin(nicks)]} {incr j 4} { if {$host == [lindex $dun_rejoin(nicks) $j] && [string tolower $channel] == [lindex $dun_rejoin(nicks) [expr $j+3]]} {set found $j} } if {$found == -1} { dun:rejoin:clean return 0 } else { set previous [lindex $dun_rejoin(nicks) [expr $found+1]] if {$previous > [expr $dun_rejoin(time)+[unixtime]] || $nick == [lindex $dun_rejoin(nicks) [expr $found+2]]} { dun:rejoin:clean return 0 } else { puthelp "PRIVMSG $channel :\00304$nick\003 entro antes como \00303[lindex $dun_rejoin(nicks) [expr $found+2]]" -next dun:rejoin:clean return 0 } } } #cleans the array proc dun:rejoin:clean {} { global dun_rejoin for {set i 1} {$i < [llength $dun_rejoin(nicks)]} {incr i 4} { if {[unixtime] > [expr [lindex $dun_rejoin(nicks) $i]+$dun_rejoin(time)] } { set dun_rejoin(nicks) [lreplace $dun_rejoin(nicks) [expr $i-1] [expr $i+2]] } } return 0 } bind part - * dun:rejoin:add proc dun:rejoin:add {nick uhost hand channel reason} { global dun_rejoin # Check if the nick joined a channel of interest set found "" set chans [string tolower $dun_rejoin(chans)] if {$chans == "*"} {set chans [string tolower [channels]]} foreach j $chans { if {[string tolower $channel] == $j} {set found $j;break} } if {$found == ""} {return 0} # Check if the chap is there already set found -1 set host [lindex [split $uhost "@"] 1] for {set j 0} {$j < [llength $dun_rejoin(nicks)]} {incr j 4} { if {$host == [lindex $dun_rejoin(nicks) $j] && [string tolower $channel]==[lindex $dun_rejoin(nicks) [expr $j+3]]} {set found $j} } if {$found == -1} { set dun_rejoin(nicks) [lappend dun_rejoin(nicks) $host [unixtime] $nick [string tolower $channel]] dun:rejoin:clean return 0 } else { set dun_rejoin(nicks) [lreplace $dun_rejoin(nicks) $found [expr $found+3] $host [unixtime] $nick [string tolower $channel]] dun:rejoin:clean return 0 } } putlog "=== Entro Antes @ #TRAFFIC-HELP ==="

👁️ 4 vistas • 📥 0 descargas

⬆ Subir