mIRC Home    About    Download    Register    News    Help

Print Thread
Simple script to identify nick? #187203 01/10/07 12:26 PM
Joined: Jun 2007
Posts: 40
Q
Question Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2007
Posts: 40
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?

Re: Simple script to identify nick? [Re: Question] #187208 01/10/07 01:54 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Simple script to identify nick? [Re: Lpfix5] #187211 01/10/07 02:41 PM
Joined: Jun 2007
Posts: 40
Q
Question Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2007
Posts: 40
Thanks, where do i put that?

Also is there any way for it to work for EVERY server i connect to?

Last edited by Question; 01/10/07 03:57 PM.
Re: Simple script to identify nick? [Re: Question] #187216 01/10/07 04:32 PM
Joined: Jul 2004
Posts: 59
L
LittleJohn Offline
Babel fish
Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
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.

Re: Simple script to identify nick? [Re: Question] #187221 01/10/07 06:48 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline
Vogon poet
Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
[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
    }
  }
}


Last edited by kwell; 01/10/07 07:21 PM.
Re: Simple script to identify nick? [Re: Question] #187226 01/10/07 08:25 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Simple script to identify nick? [Re: Riamus2] #187269 02/10/07 02:33 PM
Joined: Jun 2007
Posts: 40
Q
Question Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2007
Posts: 40
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

Re: Simple script to identify nick? [Re: Question] #187270 02/10/07 02:48 PM
Joined: Jul 2004
Posts: 59
L
LittleJohn Offline
Babel fish
Offline
Babel fish
L
Joined: Jul 2004
Posts: 59
on 1:NOTICE:*:*: {
if ($nick == NickServ || NickOp) {
if ($strip(This nickname is registered) isin $1-) {
.msg nickserv identify password
}

Re: Simple script to identify nick? [Re: Question] #187271 02/10/07 02:48 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021
Code:

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


Re: Simple script to identify nick? [Re: Question] #187285 02/10/07 08:26 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Re: Simple script to identify nick? [Re: RoCk] #187382 04/10/07 12:47 PM
Joined: Jun 2007
Posts: 40
Q
Question Offline OP
Ameglian cow
OP Offline
Ameglian cow
Q
Joined: Jun 2007
Posts: 40
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.

Last edited by Question; 04/10/07 01:08 PM.
Re: Simple script to identify nick? [Re: Question] #187385 04/10/07 03:12 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline
Vogon poet
Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109

Code:

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