mIRC Homepage
Posted By: doh pls help w/nick - 19/05/04 03:43 PM
hi,

i've never before created a script for mirc, but since it is getting more and more anoying to type the cmd over and over again manually, i'd like to ask for some help creating a simple script for this process.

i'd like to change my nick back to the primary nick which has been set in the mirc-options. you know, like when there's been a netsplit, you return to the channel with the secondary nick you've chosen in options and after some time the old nick pings out. then you have to type /nick .. to change it back. i'd like to automate this process instead of typing /nick .. all by myself.

furthermore it would be nice if there's a way to include identify process w/nickserv.

i know this might sound very easy to you, but please help a noobie out here.

thanks
Posted By: Cobra Re: pls help w/nick - 20/05/04 01:43 AM
there are a few ways u could go about doing this

the simplest is probably adding yourself to notify and useing the on unotify event

check to see if its your nick that has left, and if so change your nick to that niick and identify

the problem however will be if u ever wish to change your nick to something else, mIRC will automaticly change it back, perhaps u can add a flag in a /nick alias that unsets after 10 secs or so, that the on unotify event can read to see if it should change your nick back or not

this should be enough information to get you though, but if u require more speak up.

Cobra^
Posted By: LifeIsPain Re: pls help w/nick - 20/05/04 06:28 AM
I personally use the following, and will do a brief explanation:
Code:
on 1:quit:if ( $nick == $mnick && $me == $anick ) nick $mnick

ok, $mnick is your primary nick, $anick is your secondary nick, so if your primary nick quits, and you are as you secondary nick, you switch back to being the primary nick. This allows for you to change your nick to some 3rd nick, have your 1st nick disconnect, and you aren't automatically changed to your first nick. (I pasted this because I didn't think of this for a long time for some reason, and it is so simple!)

As far as auto identifying, a quick on notice does the job, have a look at: /help on notice
Posted By: doh Re: pls help w/nick - 20/05/04 11:19 AM
thx, on 1:quit:if.. works great

Quote:
As far as auto identifying, a quick on notice does the job,


well, problem is that it will msg nickserv on all networks, even those i'm not registered to. i'd like it more if its triggered by an event, like the /ctcp from nickserv "This nickname is registered*".

i already tried:

on 1:CTCP:This nickname is registered*:/msg nickserv identify <..>

but it won't work, any suggestions?
Posted By: bunar Re: pls help w/nick - 20/05/04 11:24 AM
i think that Nickserv gives NOTICE, not CTCP, so change on NOTICE instead on CTCP event...
Posted By: doh Re: pls help w/nick - 20/05/04 12:05 PM
hm..

on 1:notice:*/msg NickServ IDENTIFY password*:/msg nickserv identify <password>

won't work either. maybe theres sth wrong with the variables?
Posted By: bunar Re: pls help w/nick - 20/05/04 12:14 PM
try

on 1:notice:*/msg*NickServ*IDENTIFY*password*:/msg nickserv identify (yourpassword)
Posted By: doh Re: pls help w/nick - 20/05/04 12:33 PM
nope, no reaction when nickserv claims identify frown
Posted By: bunar Re: pls help w/nick - 20/05/04 12:52 PM
on 1:notice:*/msg NickServ IDENTIFY password*:*:{ /msg nickserv identify (yourpassword) }

this should work

ADD: this scriptie should make job easier

on 1:notice:*/msg NickServ IDENTIFY password*:*:{
if ($nick == NickServ) {
.timer 1 0 /msg nickserv identify (yourpassword)
halt
}
}


Posted By: doh Re: pls help w/nick - 20/05/04 01:12 PM
thx, i had to change a little, but finally it works:

on 1:notice:*/msg*NickServ*IDENTIFY*password*:*:{/msg nickserv identify <yourpassword>
Posted By: bunar Re: pls help w/nick - 20/05/04 01:18 PM
no problem
Posted By: LifeIsPain Re: pls help w/nick - 21/05/04 02:39 AM
It is very good to understand that this method is NOT really all that safe. The problems occurs when you are on some network where the nick NickServ isn't restricted (there aren't many now) and someone else takes the nick, and sends you the notice. Services Impersonations are many times a bit ugly.

If the network you are on supports "/ns" instead of "/msg nickserv" I would strongly recomend you use this thinstead, as /ns will not send to anyone other than the server, thus being more secure.

Also, on why you went with all the *s in the line, most services put bold around "IDENTIFY", or underline "password". So a more secure option (I thought about posting it with the on quit, but didn't) would be to use the message right before that:
Code:
on 1:notice:This nickname is registered*:?: if ($nick == NickServ) { ns identify &lt;yourpassword&gt; }

I also tossed in the $nick == NickServ so that some goofball doesn't try to get you to re-identify
Posted By: doh Re: pls help w/nick - 21/05/04 02:23 PM
i changed it according to your proposal & it works great.

thx for your support
Posted By: Kelder Re: pls help w/nick - 23/05/04 01:24 AM
Some suggestions to make it somewhat more secure. Just remember that your password is still in plain text on your computer, so anyone who uses your computer has access to it.

Code:
 on  [color:red]nickserv[/color]:notice:This nickname is registered*:?: {
if ( [color:purple]$network === MyNetIRC[/color] ) { ns identify &lt;yourpassword&gt; }
} 


Add this to your Users section (alt-R tab Users)
nickserv:NickServ!NickServ@services.yourircnet.com
(do a /whois nickserv and get the correct info)
More info: /help levels and /help $network

Just type $network<tab> (no not enter) in the status window to know what your network is called.
© mIRC Discussion Forums