this should help its easier to understand.
on 1:load: /set %username username | /set %password password
on 1:connect: if ($me == mainnick) { msg nickserv identify %username %password | echo -a your nickname matches with your main nickname and you are now identified on this network }
else { msg mainnick could you please change your nick that is my usual nickname. }
alias /Identify { msg nickserv identify %username %password }
you have to change username to your username and password to your password and change main nickname to your main nickname but this script should make things easier