04/11/2013, 13:24
Si je comprends bien, c'est la suite de la discussion http://www.ircz.fr/viewtopic.php?pid=30878
La bas, je te donnais comme code:
Peut-être le souci vient-il de la différence entre ma variable "op" et ta variable "salon" : je traite en entier (set op 0, if { $op == 0 }), alors que toi tu travailles avec une chaine (set salon "0", if { $salon == "0" }).
Essaye donc de travailler avec des entiers, et au cas où mets un putlog juste avant ton if { $salon == 0 }
La bas, je te donnais comme code:
tcl
set logchan "#staff"
bind mode - "% +o" opped
bind mode - "% -o" deopped
proc opped {nick uhost handle chan mode target} {
if { [string tolower $chan] == [string tolower $::logchan] } { return 0; }
if { ![onchan $target $::logchan] } { return 0; }
if { ![isvoice $target $::logchan] } {
pushmode $::logchan +v $target
}
putserv "PRIVMSG $::logchan :$target ([whois $target]) est @ sur $chan"
}
proc deopped {nick uhost handle chan mode target} {
if { [string tolower $chan] == [string tolower $::logchan] } { return 0; }
if { ![onchan $target $::logchan] } { return 0; }
if { [isvoice $target $::logchan] } {
set op 0
foreach vchan [chanlist] {
if { [isop $vchan $target] } incr op
}
if { $op == 0 } pushmode $::logchan -v $target
}
putserv "PRIVMSG $::logchan :$target ([whois $target]) n'est plus @ sur $chan"
}
proc whois { nick } {
set handle [nick2hand $nick]
if { $handle == "*" } return "Inconnu"
else return $handle
}
Peut-être le souci vient-il de la différence entre ma variable "op" et ta variable "salon" : je traite en entier (set op 0, if { $op == 0 }), alors que toi tu travailles avec une chaine (set salon "0", if { $salon == "0" }).
Essaye donc de travailler avec des entiers, et au cas où mets un putlog juste avant ton if { $salon == 0 }