mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2007
Posts: 40
Q
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?

Joined: Aug 2005
Posts: 1,052
L
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* }
Joined: Jun 2007
Posts: 40
Q
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.
Joined: Jul 2004
Posts: 59
L
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.

Joined: Sep 2007
Posts: 109
K
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.
Joined: Oct 2004
Posts: 8,330
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
Joined: Jun 2007
Posts: 40
Q
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

Joined: Jul 2004
Posts: 59
L
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
}

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
Code:

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


Joined: Oct 2004
Posts: 8,330
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
Joined: Jun 2007
Posts: 40
Q
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.
Joined: Sep 2007
Posts: 109
K
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>
    }
  }
}



Link Copied to Clipboard