mIRC Homepage
Posted By: Question Simple script to identify nick? - 01/10/07 12:26 PM
How do i write a simple script to identify my nick when i connect to a server? More importantly, where do i put the commands?
Posted By: Lpfix5 Re: Simple script to identify nick? - 01/10/07 01:54 PM
Originally Posted By: Question
How do i write a simple script to identify my nick when i connect to a server? More importantly, where do i put the commands?


on *:CONNECT:{
if ($server == SERVERHERE) { msg nickserv identify password }
}

make sure you change SERVERHERE to whatever the server is your connecting too example irc.mirc.com
Posted By: Question Re: Simple script to identify nick? - 01/10/07 02:41 PM
Thanks, where do i put that?

Also is there any way for it to work for EVERY server i connect to?
Posted By: LittleJohn Re: Simple script to identify nick? - 01/10/07 04:32 PM
on 1:NOTICE:*IDENTIFY*:?:{
if ($nick == nickserv) { .msg nickserv identify Yourpassword }
}

this is a varient I use, It checks for Nickserv to tell you that you need to identify in a notice.

Example:

[12:30] -NickServ- This nickname is registered and protected. If it is your
-
[12:30] -NickServ- nick, type /msg NickServ IDENTIFY password.

As Long as the Notice comes from Nickserv and the Word Identify is in the notice it will not matter what server you are on.
Posted By: kwell Re: Simple script to identify nick? - 01/10/07 06:48 PM
[12:30] -NickServ- This nickname is registered and protected. If it is your
-
[12:30] -NickServ- nick, type /msg NickServ IDENTIFY password.


Code:


on 1:NOTICE:*:*: {
  if ($nick == NickServ) {
    if ($strip(This nickname is registered) isin $1-) {
      .msg nickserv identify Yourpassword
    }
  }
}

Posted By: Riamus2 Re: Simple script to identify nick? - 01/10/07 08:25 PM
You'll want to put whichever script you use in your Remotes (Alt-R, click Remotes tab). Make sure that you do File>New so that you don't have conflicts with any other scripts that are running.

Here's one that can work for multiple networks that have different passwords.

Code:
on *:NOTICE:*:*: {
  if ($nick == NickServ) {
    if ($strip(This nickname is registered) isin $1-) {
      if ($network == network1) { msg nickserv identify password1 }
      elseif ($network == network2) { msg nickserv identify password2 }
      elseif ($network == network3) { msg nickserv identify password3 }
    }
  }
}


Just change the network names and passwords and repeat the elseif lines to add more networks. If you don't know the correct network name, connect to the network and type //echo -a $network . That will give you what you need for the network name in the script above.
Posted By: Question Re: Simple script to identify nick? - 02/10/07 02:33 PM
on 1:NOTICE:*:*: {
if ($nick == NickServ) {
if ($strip(This nickname is registered) isin $1-) {
.msg nickserv identify password
}
}
else if ($nick == NickOp) {
if ($strip(This nickname is registered) isin $1-) {
.msg nickserv identify password
}

}
Is this script correct? I want it to identify if the bot is named either NickServ or NickOp
Posted By: LittleJohn Re: Simple script to identify nick? - 02/10/07 02:48 PM
on 1:NOTICE:*:*: {
if ($nick == NickServ || NickOp) {
if ($strip(This nickname is registered) isin $1-) {
.msg nickserv identify password
}
Posted By: RoCk Re: Simple script to identify nick? - 02/10/07 02:48 PM
Code:

on *:NOTICE:*This nickname is registered*:?: {
  if (($nick == NickServ) || ($nick == NickOp)) {
    .msg $nick identify password
  }
}

Posted By: Riamus2 Re: Simple script to identify nick? - 02/10/07 08:26 PM
Yours would work, but RoCk's is a bit better in that it doesn't duplicate code unnecessarily.

LittleJohn, you can't do comparisons like that. The way you have it, it would check if $nick == NickServ OR NickOp... meaning that it doesn't check if $nick == NickOp. It's similar to saying if (NickOp) { }, which will always be true.

It may sound right doing a comparison that way if you say it out loud, but in logic operations, it's incorrect.
Posted By: Question Re: Simple script to identify nick? - 04/10/07 12:47 PM
Originally Posted By: RoCk
Code:

on *:NOTICE:*This nickname is registered*:?: {
  if (($nick == NickServ) || ($nick == NickOp)) {
    .msg $nick identify password
  }
}



Awesome, that works, well partly.

[21:59] -NickOP- This nickname is registered and protected. If it is your nickname, type /msg NickOP IDENTIFY password. Otherwise, please choose a different nickname.
-
[21:59] -NickOP- Password incorrect.

Password is correct though....

Edit : Weird, it works now o.O.
Posted By: kwell Re: Simple script to identify nick? - 04/10/07 03:12 PM

Code:

on 1:NOTICE:*:*: {
  if ($nick == NickServ) || ($nick == NickOP) {
    if ($strip(nickname is registered) isin $1-) {
      .msg $nick IDENTIFY <Your-password>
    }
  }
}

© mIRC Discussion Forums