i had this one made for me a while back which is useful for channels like this..
its alot more functional and has much easier interface for adding/removing channels
menu * {
Trap Channels
.Add : set %trap $addtok(%trap,$$?="Enter trap channel name",44)
.Remove : set %trap $remtok(%trap,$$?="Enter trap channel name",1,44)
.List : echo -ta Trap channels are %trap
}
on me:*:join:%trap:{
$+(.timer,part,$chan) -m 0 500 part $chan
}
on me:*:part:%trap:{
$+(.timer,part,$chan) off
}