i have this little scripts who send a part msg when someone leave the channel. the problem is that the eggdrop say that message on everychannel he`s on and i`d like tio make it channel specific heres the code
set channel "#aide-moi.net"
bind part - "*" do_part
proc do_part {nick user hand chan arg} {
putserv "NOTICE $nick :Merci de ta présence parmis nous et à bientôt sur #Aide-Moi.Net"
return 0
}
set channel "#aide-moi.net"
bind part - "*" do_part
proc do_part {nick user hand chan arg} {
global channel
if {$chan != $channel} { return 0 }
putserv "NOTICE $nick :Merci de ta présence parmis nous et à bientôt sur #Aide-Moi.Net"
return 0
}
Certain IRCD's (Most?) have a tendancy of returning channel names in various case formats (as a result of a user joining the channel in a different case)... as such you will want to make it a case insensitive expression, to handle these occurances....
$channel is already lower-case so [string tolower $channel] wouldn't be needed ?
Yes but if you don't , and then later on you try to change that configuration variable (for a different channel) and slip in a capital letter, your code would be broken without the conversion.