Hello all mirc members. I researched and made automatic code connecting to multiple servers and automatically identifying nicknames for each server. However, the code does not work as I want, so I post here asking you to be familiar with the mirc code to help me make this code work. Thank you very much and hope to receive the code soon.

This is my code:
Code
on *:connect: {
  if ($network == DaVang) || ($network == Rizon) { autoconnect }
}
alias autoconnect {
on *:notice:*:?: {
  if ($network == DaVang) && ($nick == NickServ) {
    if (*nickname is registered* iswm $1-) { /ns identify passnickhere | timer 1 10 /join #davang,#party,#help }
  }
    if (*Nickname is already in use* iswm $1-) { /ns ghost NickName passnickhere | timer 1 1 /nick NickName | timer 1 5 /ns identify passnickhere | timer 1 20 /join #davang,#party }
  }
  elseif ($network == Rizon) && ($nick == NickServ) {
   /nick NickChat | timer 1 5 /join #party,#davang
}
}