I know the "traditional" way, but I tried for other alternative to be learning.
Code: Select all
proc noti_nolist {nick uhost handle chan arg} {
global canal_admin
if {[string tolower $chan] != [string tolower $canal_admin]} {
return
}
if {[file exist prohibidos.txt]} {
set file [open prohibidos.txt "r"]
set x 0
while {![eof $file]} {
set nickpr [gets $file]
if {([llength $nickpr] == 0) && ($x == 0)} { putmsg $chan "The list is empty."; return }
if {$nickpr == ""} { continue }
putmsg $chan "$nickpr"
set x [expr {$x + 1}]
}
close $file
putmsg $chan "The list contains $x prohibited nicks."
} else {
putmsg $canal_admin "Has not yet entered any nick,database is missing.!"
}
}