Actually, if the bot's nick was tempbot, then the op would be wanting
Code:
on *:quit:{
  if ($nick == tempbot) {
    ;script if tempbot quits
  }
  else {
    ;script if someone other than tempbot quits
  }
}


The only way
Code:
on tempbot:quit:{
would work is if the client running the code had a userlevel of tempbot assigned to the nick or address of tempbot.