Code:
ON *ME:JOIN:#: {
  echo -ta I have entered # $+ .
}
ON *ME:PART:#: {
  .timer 1 1 echo -ta I have left # $+ .
}