Code:
on *:active:*:{
  if [color:red]($appactive) &&[/color] ($cid != $lactivecid) ; I've changed networks.
}