02/04/2012, 17:16
C'est pourtant facile:
tcl
bind pub - "!delstaff" staff:del
proc staff:del {nick uhost handle chan args} {
if {[lindex $args 0] eq ""} {
return 0
} else {
set vict [lindex $args 0]
}
set fp [open $::base r]
set data [read -nonewline $fp]
close $fp
set fp [open $::base w]
foreach templine [split $data "\n"] {
if {[string equal -nocase $vict $templine] == 0} {
puts $fp $templine
}
}
close $fp
putserv "NOTICE $nick :\00312Le membre $vict a été suprimé de la liste Staff"
putserv "PRIVMSG #Control :\00312Del staff : \0034$nick"
}