bind pub n|n .templeave proc:templeave
proc proc:templeave {nick uhost hand chan arg} {
global duo templeave
putserv "PART $chan :I have temporarly left from $chan by demand of $nick. user comback to rejoin $chan"
eval channel set [list $chan] +inactive
}
bind msg n|n .comeback proc:comeback
proc proc:comeback {nick uhost hand arg} {
global duo templeave
putquick "privmsg $nick :i will try to comeback to $arg"
eval channel set $arg -inactive
}
but is a problem. For example somebody form chan #chan .templeave the egdrop. but if someone whith +n from #chan2 will comeback to #chan the gg listen to him. i wana disable that
i hope u understand me.
Two things... first there's no point to the "eval" bit. The normal way to call procs in tcl is
procname arg1 arg2
rather than
eval procname [list $arg1] [list $arg2]
Second, change your bind to -|-, since if a person has +n in #chan instead of #chan2, and no global +n, the bind won't trigger at all. Instead, do matchattr checking inside the proc, like this:
if {![matchattr $hand n|n $arg]} { return 0 }
Then you need to make sure that $arg is a valid channel before trying to use channel set. Or, another way to do it, would be to put channel set inside catch {} and msg the user something like "$arg1 is not a valid channel you fool!" if there's an error.