Scan your IRC channels for an IP, mIRC script

Maybe sometimes you wondered whose IP was the one, for example, you saw on your FTP server, or on the smurf attack list of your firewall. Maybe, that IP belongs to someone who is in one of your channels in IRC; how to find out? Using a made up command which scans the channels you are in for that IP or alias.

The routine looks lihe this:

/findip {
  //set %SearchedIP $1
  set %IPCheck 1
  var %NCanali
  //set %NCanali $chan(0)
  var %CrChan
  set %CrChan 1
  var %TempMask
  :ChanLoop
  //set %TempMask *!*@ $+ $1
  //if ($ialchan(%TempMask,$chan(%CrChan),1).nick != $null) //echo 9 $ialchan(%TempMask,$chan(%CrChan),1).nick in $chan(%CrChan)
  /inc %CrChan
  //if (%CrChan > %NCanali) goto end
  goto ChanLoop
  :end
  set %IPCheck 0
}
       

and you need to put it in the Aliases Panel (accessible by pressing the button in mIRC.

When you want to search for an IP, type, wherever (either in the status window, a channel window, or a chat window): /findip <IP.or.alias.here> … for example:

/findip 142.214.43.4

or

/findip ppp-31xq.nocs.springnets.pk

It is better to search for both, so, if you only got the IP, do a /dns IP, for example:

/dns 142.214.43.4

and in the status window you will find the result of the search. If it is positive, you will get something more like the example above, that is "ppp-31xq.nocs.springnets.pk", otherwise it may not be possible to find an alias for the IP, and in that case you’ll get a "Unable to resolve" message.

If, instead, you only have the alias, do a /dns alias, like:

/dns ppp-31xq.nocs.springnets.pk

and in the status window you will get the corresponding IP.

So, when you have the IP and the alias, use the /findip command on both. If the person is in one of your channels, you’ll see a green text telling you whose that IP/alias is, and in what channel is the nick. If there are no matches, you will get no results. You don’t have to wait long, since usually if in 4 seconds you see no matches, means that the person isn’t in one of your channels.

Script di mIRC per trovare l’IP di altre persone in un canale

In mIRC potete vedere quale IP appartiene ad un utente. Questo si ottiene col comando /dns, così ad esempio se volete sapere qual è l’IP di Jogi potete usare:

/dns Jogi

e vedrete, dopo pochi secondi, l’IP e l’alias (se ne esiste uno) di Jogi nella finestra Status. Allora qual è il punto vi chiederete, una pagina HTML per parlare di un singolo comando? Non esattamente. é un pò una scocciatura dover controllare sempre nella finestra di status per vedere se l’IP è stato risolto, così faremo uno script che invia le informazioni nella finestra attualmente aperta, qualunque essa sia.

Potete usare questo addon per caricare lo script in mIRC, scompattate lo ZIP e leggete le istruzioni nel TXT (inglese)

Qui di seguito è spiegato come funziona.

Nel pannello remote si aggiunge:

on *:DNS://echo -a Resolved $nick to: Name - $naddress , IP - $iaddress

e il risultato, dopo che avrete fatto un /dns sull’utente Joey42 apparirà nella finestra attuale nel formato:

Resolved Joey42 to: Name - co3061808-a.eburwd1.vic.optushome.com.au , IP - 203.164.127.151

Nel caso in cui l’IP non abbia un corrispondente indirizzo testuale, il campo dopo Name sarà vuoto.

Potete anche controllare a quale IP corrispondono indirizzi web, ad esempio www.microsoft.com:

/dns www.microsoft.com

il risultato sarà:

Resolved to: Name - www.microsoft.com , IP - 207.46.230.219

e anche vedere qual è l’indirizzo testuale corrispondente ad un IP:

/dns 65.92.216.192

con output:

Resolved to: Name - HSE-Montreal-ppp3473182.sympatico.ca , IP - 65.92.216.192

[Aggiornato il 15 Sett 2010]
Diversi visitatori nei commenti mi hanno chiesto perché, quando lanciano il comando /dns nomeutente, ricevono uno strano codice al posto dell’indirizzo IP (come ad esempio 5B26E798.A7F81C6C.2CF41D6B.IP); questo ovviamente non è né un IP né un alias nominativo, ma si tratta semplicemente del vostro server che è impostato su un alto livello di sicurezza, ed impedisce agli utenti di conoscere gli IP delle altre persone connesse, e quindi restituisce quel codice, che è univoco per il singolo utente, ma da cui non è possibile risalire all’indirizzo IP reale. Questa è una limitazione di per sé non aggirabile, anche se potete provare a richiedere una “query DCC” all’utente in questione, cioè una sessione di chat privata in cui i vostri PC sono collegati direttamente l’uno all’altro; se l’altro utente accetta la vostra richiesta, ognuno di voi due potrà vedere l’IP dell’altro, siccome i vostri computer sono collegati direttamente tra loro senza intermediazione del server.

Find the IP of other people in IRC channels, mIRC script

You can, on IRC, see which IP belongs to a user (whatever you need to know this for, obviously . This is achieved, inside mIRC, with the /dns command. So, for example, if you want to know what IP is using your channelmate Jogi you can do:

/dns Jogi

and you will see, after some time, the IP and the IP name (if there is one) of Jogi in the Status window. So, what’s he big deal you’ll ask, a page just for this command? Not actually, because it may be annoyng to switch to the Status window every time you need to check the IP of a user. So here we’ll make a script which will send a message to our current channel window with the regarding information.

You can use this addon to load the script from within mIRC, instead of writing the lines yourself.

If you want to add the lines yourself, here are the instructions.

Before we begin, let’s recall that you need to press the button in mIRC to access the Remote panel, that is where you edit scripts.

What you need to write there is:

on *:DNS://echo -a Resolved $nick to: Name - $naddress , IP - $iaddress

and the output, after you add this line, press OK, and issue the /dns command on a user, will appear in the active window, and resemble this:

Resolved Joey42 to: Name - co3061808-a.eburwd1.vic.optushome.com.au , IP - 203.164.127.151

In the case the IPname was not available, the field after “Name -” would simply be empty.

You can check with this also the IP corresponding to websites. For example, if you want to know what IP is associated with www.microsoft.com just do:

/dns www.microsoft.com

and the output will be:

Resolved to: Name - www.microsoft.com , IP - 207.46.230.219

and as well see what IP name belongs to an IP you run into:

/dns 65.92.216.192

the output being:

Resolved to: Name - HSE-Montreal-ppp3473182.sympatico.ca , IP - 65.92.216.192

clear enough I’d say.

Now go on IRC and play a bit.

[Updated 15th Sept 2010]
Several visitors have been asking in the comments why, when they do /dns username, they get a strange code instead of the numeric IP address (in the form of 5B26E798.A7F81C6C.2CF41D6B.IP); this is obviously not an IP address, nor a named alias, but just your server that has a “high security” policy, where it normally does not allow users to know each other’s IP addresses and instead outputs that string, which is univocally associated with the user, but cannot be used to determine the real IP. This is a limitation that cannot be worked around per se, still, you could try asking the user for a DCC query session, which is a special private chat where your computers are directly connected to each other, without passing through the server: if the other user accepts your DCC request, then you can see each other’s IP addresses, since your PC’s are directly connected.

Guida di base alla rete IRC di DALnet

Questa quida è stata pensata per tutti quelli che, appena installato mIRC, nel mio canale #Finestre&finestre su DALnet, ma anche altrove, mi (e si) chiedono “Come funziona qui??”

Per quanto io cerchi di essere gentile con tutti, diventa fastidioso rispondere SEMPRE alle stesse domande, e, visto che noi italiani siamo ignoranti, e non conosciamo l’inglese, mi è toccato scrivere questa pagina in italiano, al contrario di tutto il resto del sito

Sembro acido? Nooo è solo una vostra impressione…

Scherzi a parte, basta dire scempiaggini e cominciamo.

1) “Che roba è mIRC??

mIRC è solo un programma, nella fattispecie un “client”, e cioè un programma il cui mestiere è quello di collegarsi ad un server; non confondiamo quindi il programma (mIRC, non l’unico, ma il più famoso) con la rete di chat, che si chiama solo “IRC” (che significa Internet Relay Chat, cioè “Chat basata su Internet”, per tradurre in maniera piuttosto libera). La rete IRC che io uso è DALnet, ed è anche la rete “spiegata” in questa pagina, così come penso sia la rete alla quale voi siete collegati in questo momento (anche perché mIRC vi si collega automaticamente). Ogni rete IRC (quindi anche DALnet) è composta da un insieme di server, cioè computer, collegati tra loro, e ai quali sono a loro volta collegate tutte le persone che vi si trovano per chattare; per cui è possibile che io sia collegato al server “x” di DALnet, e voi siate collegati al server “y” di DALnet, e nonostante questo possiamo parlarci senza problemi, perché ogni server di DALnet manda a tutti gli altri le righe di testo che gli passano attraverso.

2) “Vabbé, ma ora che faccio??

Una volta collegati ad IRC (ed in particolare a DALnet) dovrete andare in qualche stanza, più comunemente chiamata “canale”, se volete parlare con qualcuno. Su DALnet ci sono moltissimi canali, circa 18000, ed ognuno può crearne di nuovi, per cui aumentano in continuazione. Voi potete sia vedere quali sono i canali che l’autore di mIRC (Khaled Mardam-Bey) ha deciso di includere nella lista del programma, e che si apre appena voi vi collegate, ma che potete richiamare anche premendo il pulsante “List Channels” (), oppure potete decidere (meglio) di scaricare la lista di TUTTI i canali, premendo il pulsante “List Channels”

Da questa finestra potete entrare in un canale facendo doppio click sul #nomecanale oppure selezionando un canale dalla lista e premendo il tasto “Join”. Se non volete che questa finestra compaia ogni volta che vi collegate, disabilitate la casella sul fondo, “Pop up folder on connect”
Questa è la finestra List Channels, basta premere “Get List!” (qui il pulsante è grigio perché non ero collegato a DALnet, voi lo vedrete accessibile) per scaricare la lista completa dei canali
Questa è la finestra che vedrete mentre prendete la lista. Aspettate che abbia smesso di scaricare la lista (ve ne accorgerete perché i numeri nel titolo della finestra smetteranno di aumentare)
Quando avrete finito di scaricare la lista, potrete premere di nuovo il pulsante “List Channels”, e scrivere una parola chiave nella casella “Match Text”. Io ho scritto “italia”, ma voi potete provare con “amici”, “calcio”, il nome della vostra città, eccetera. Premete “Apply” per vedere i canali che contengono “italia” nel nome o nella descrizione.
Questi sono i primi canali che compaiono cercando “italia”, basta fare doppio click sul nome del #canale per entrare. Il canale #italia è una bolgia infernale, non aspettatevi di potervi intavolare una discussione. Comunque, provateci Come vedete ci sono anche canali non italiani, starà a voi capire quando il risultato è poco pertinente.

Se vi collegate di nuovo a DALnet, e volete rientrare nei canali che già conoscete, basterà scrivere, in qualunque finestra (Status, o anche le altre) /join #nomecanale, ad esempio /join #finestre, oppure, se volete entrare nel canale automaticamente ogni volta che vi collegate, potete aggiungere questo comando alla lista dei comandi che mIRC esegue quando si connette: premete il tasto “Options” e andate nel pannello “Perform”

Per abilitare l’esecuzione automatica dei comandi dovete attivare la casella “On connect, perform these commands” e scrivere nella finestre sottostante il comando che abbiamo visto prima, per esempio “/join #finestre“. Potete inserire più comandi di questo tipo, ad esempio si può aggiungere una riga per ogni canale che vi interessa.

3) Mi sono dimenticato cosa volevo scrivere

4) Ah! Mi sono ricordato!

5) “Perché dopo un po’ il mio nick diventa Guest6274638??

Questo succede perché, se è la prima volta che usate DALnet, e scegliete un nick “troppo facile”, è probabile che qualcuno l’abbia preso prima di voi (su DALnet non possono esserci due nick uguali, come in ICQ o MSN). A quel punto, dopo un pò “NickServ”, che è il server in DALnet che controlla la validità dei nick, ve lo toglierà, e vi darà un nick come “Guest6274648”. Rassegnatevi, dovrete sceglierne un altro, oppure modificare un po’ quello. Ad esempio, se “Antonio” è già preso, provate “Antonio^”, e se è preso anche quello, provate “^Antonio^” eccetera eccetera. Attenzione però, non tutti i caratteri sono accettabili: per esempio i segni di punteggiatura o l’apostrofo; provate con trattini, parentesi, e altri caratteri. Quando avrete scelto il nuovo nick, provate a usare il comando /nick nuovonick, ad esempio “/nick ^Antonio^“, e, se non c’è nessuno che lo sta già usando in quel momento, lo prenderete voi. Potete usare il comando /nick quante volte volete, ma non ripetetelo velocemente, altrimenti verrete messi in attesa come “punizione”

6) “Come mi accorgo se il nick che ho scelto non appartiene a nessuno??

Se scegliete un nick, ed entrate in DALnet per la prima volta, ci sono diverse possibilità: 1) il nick che avete scelto non è utilizzato, né appartenente aa un’altra persona che lo ha registrato, ed allora potrete tenerlo per tutto il tempo in cui siete connessi; 2) c’è già un’altra persona collegata che sta usando quel nick, quindi voi non potrete usarlo; 3) non c’è nessuna persona che sta già usando quel nick, ma qualcuno che non è connesso lo ha già registrato, e allora “NickServ” dopo un po’ ve lo cambierà ad esempio in “Guest482853”. Quando avrete cambiato nick (col comando /nick nuovonick), e NickServ non avrà nulla da ridire, significa che quel nick è “originale”, e potrete usarlo senza problemi.

7) OK, ma come faccio a registrare il mio nick per non farlo usare a nessun’altro??

Per registrare un nick dovrete fare una richiesta a NickServ, con un comando particolare con cui dovrete fornirgli un po’ di dati. Quando state usando il nick che volete registrare (e se siete sicuri che non è registrato a nessun’altro) usate questo comando: /nickserv register vostrapassword vostraemail (ad esempio, se volete usare come password il nome del vostro cane “ermenegildo”, e il vostro indirizzo di posta elettronica è “io.sono@sfigato.it”, dovrete scrivere: /nickserv register ermenegildo io.sono@sfigato.it).
Ed ora un pò di raccomandazioni: l’indirizzo di posta elettronica deve essere vero! NickServ vi manderà un messaggio con un indirizzo web che dovrete visitare per attivare definitivamente la registrazione. Se non lo fate, dopo 24 ore il nick perderà la registrazione. Dopo averlo definitivamente registrato, dovrete usarlo almeno una volta al mese, altrimenti la registrazione verrà comunque persa. Altra precauzione: quando scrivete il comando per la registrazione, anche se potete farlo in qualunque finestra, vi conviene usare la finestra Status, perché se vi sbagliate, e ad esempio dimenticate di scrivere “/” all’inizio, se siete in un canale tutte le altre persone vedranno la vostra password!

8) Passare al punto 10

9) “Ho già registrato il nick, ma divento sempre Guest36524!!! Perché????

NickServ purtroppo non è telepatico, per cui ogni volta che vi collegate a DALnet con un nick che avete registrato, se non volete che NickServ ve lo tolga, dovrete dimostrargli che è vostro, dicendogli la password con cui l’avete registrato. Per fare questo dovete usare il comando: /nickserv identify vostronick vostrapassword (ad esempio, se il vostro nick è “^gigilatrottola^” e la vostra password è il nome del vostro cane, “ermenegildo”, dovrete scrivere: /nickserv identify ^gigilatrottola^ ermenegildo). Anche in questo caso, se lo scrivete a mano, vi conviene usare la finestra Status. Altrimenti, potete aggiungere anche questo alla lista “Perform”… ve la ricordate vero?????

Questa è come apparirà la finestra “Perform” dopo aver aggiunto il secondo comando per identificarsi con NickServ appena vi collegate a DALnet. Non dimenticate che, quando avrete imparato un po’ di comandi, potrete aggiungere qui tutti quelli che volete vengano eseguiti appena vi collegate!!!

A questo punto potete senz’altro passare al punto 11

10) Questo punto è vuoto. Voltarsi, fare una capriola mortale, e lanciare di nuovo i dadi. Dopo di ciò, tornare indietro al punto 9

11) Ora mi sono veramente stufato. Se volete che aggiunga qualcosa, scrivetemelo in e-mail, oppure venite a chiederlo nel mio canale #finestre (basta che non arriviate la sera tardi, perché mi piace dormire 8 ore al giorno)

Script di autoaway per mIRC

Questo è uno script piccolissimo ma funzionale, che va d’accordissimo con la funzionalità di "segreteria" del mio script antispam. Succede spesso che si lasci il PC acceso a scaricare, e potendo controllare in mIRC quanto tempo è passato dall’ultima volta che avete inviato una riga di testo si ricava il tempo durante il quale si è stati "away". Se questo supera una certa soglia, si può impostare l’away ocn il comando /away.

Potete usare questo addon per caricare lo script in mIRC, scomprimete lo ZIP e leggete le istruzioni (in inglese) presenti nel TXT. Per avere maggiori dettagli sullo script potete continuare a leggere.

Questo è quello che va aggiunto agli alias:

/CheckAway {
  //if (($idle > 300) && ($away == $false)) //away 8,2 I am away after 5 idle minutes
  //if (($idle < 300) && ($away == $true)) /away
}
       

Potete cambiare il tempo prestabilito come volete, io l’ho impostato a 5 minuti (300 secondi), e per cambiare il messaggio di away sbizzarritevi come volete."8,2" serve a cambiare il colore del messaggio, se non vi piace modificatelo o toglietelo.

Questo è quello che dovete aggiungere al pannello Remote:

on *:CONNECT:/timerChkAway 0 10 /CheckAway
       

Autoaway script for mIRC

The away flag is a very useful one, lets you be “justified” if you don’t answer someone’s query, or even lurk in incognito, so the pesters you don’t want to chat with, think you are not at the computer. In the first case, it often happens that you simply leave the PC connected, being AFK, but forget to activate the away. A simple script can check for how long you’ve been “idle” with mIRC (the idle time in mIRC represents the time from the last stroke on the Enter key, no matter if it’s been used to send a line to a channel or a chat window, or just to identify to NickServ, or something else).

You need to set both an alias and a script (this will work fine enough if you just installed a clean mIRC, or anyway if you’re not using other scripts).

You can use this addon to load the script without adding the lines yourself. All the instructions are in the TXT file, follow them. I suggest you to continue reading anyway, so you can have more details about the script.

Here’s what you need to add in the Aliases Panel (accessible pressing the button):

/CheckAway {
  //if (($idle > 300) && ($away == $false)) //away 8,2 I am away after 5 idle minutes
  //if (($idle < 300) && ($away == $true)) /away
}

Customize this alias by changing the idle time with the one you prefer (I setted it to turn on the away flag after 5 minutes – 300 seconds; just put your preferred idle time, in seconds, instead of the two “300” you find there), and putting a message you like instead of “I am away after 5 idle minutes” (the “8,2” is used to set the colour of the message. If you don’t know how to use colour codes in mIRC, leave it as it is, or remove it if you don’t like the colours I use .

Here’s instead what you need to add in the Remote Panel (accessible pressing the button):

on *:CONNECT:/timerChkAway 0 10 /CheckAway

If you followed the instructions in the other pages of this section, and already added an on CONNECT line, add the “/timerChkAway 0 10 /CheckAway” line as well to the routine. If you instead want to add the other scripts in these pages, then do the same, by using something like:

on *: CONNECT:{
  line1
  line2
  line3
  ...
  ...
}

and putting the proper commands where you find “line1” “line2” and so on.

Now, using this script togheter with the AutoAnswerer script you can find in this section, you will have a complete set of away scripts.

Script di mIRC per Auto Identify e Auto Op su DALnet

Se siete in DALnet da diverso tempo avrete imparato ad usare il comando /nickserv identify password oppure /msg nickserv@services.dal.net identify password per poter usare il vostro nick registrato. Però primo, è una cosa noiosa da fare ogni volta, e secondo, anche se avete un piccolo script che lo fa appena vi connettete non sempre vi andrà bene, perché sia NickServ che ChanServ a volte si disconnettono, si resettano, si drogano, e chi più ne ha più ne metta. Insomma, poteste ritrovarvi come Guest quando meno ve lo aspettate.

Vi spiegherò qui come risolvere queste vicissitudini con uno script che non sarà perfetto, ma che tuttora mi va a genio.

Potete usare questo addon per caricare lo script in mIRC invece di scrivere il codice a mano nella finestra Remote. Scaricato lo ZIP, leggete il TXT per le istruzioni (in inglese, quelle non mi andava di tradurle). Se volete essere in grado anche di modificarlo voi stessi, oppure siete curiosi di sapere come funziona, continuate a leggere.

(Nota) Lo script è stato recentemente aggiornato per correggere una debolezza che in alcuni casi comportava il flood dei servizi, richiedendo continuamente l’identificazione e l’op fino a generare un avviso di NickServ e ChanServ. Una volta sono persino stato buttato fuori da un IRCop. Non ci sono commenti alle suddette modifiche nei successivi paragrafi, ma quello che fanno è sostituire la richesta diretta di identify e op con una procedura intermedia. Questa controlla dei flag (una variabile per ogni nick e ogni canale), e se non sono impostati richiede l’op o l’identify, impostandole per 60 secondi, nei quali non saranno possibili ulteriori richieste.

I messaggi che vi manda NickServ quando vi connettete, "This nick is owned by someone else…" "If this is your nick…" "Password accepted for…" si chiamano notices. Lo script aspetta che ne arrivi una, e se viene da NickServ allora controllerà se vuole la password, se la password è stata accettata, o ancora se ha cambiato il vostro nick perché non gli è arrivata la password nel tempo prestabilito (e succede).

on *:CONNECT:{
  /dcc packetsize = 4096
  /pdcc 2147483647
  /fsend on
  /joinall
}


on 1:START:/timerIdent 0 40 /ident

on *:NOTICE:*:*:{
  if (($pos($strip($1-),Password accepted for,1) != $null) && ($nick == NickServ)) {
    //if $pos($strip($1-),YourMainNick,1) != $null) {
      /timer 1 20 /autoop 
      /nick YourMainNick
    }
    goto bother
  }
  if (($pos($strip($1-),This nick is owned by someone else. Please choose another.,1) != $null) && ($nick == NickServ)) /id
  if (($pos($strip($1-),Your nick has been changed to Guest,1) != $null) && ($nick == NickServ)) {
    /id
    /nick YourNick^_^
  }
  if ((($pos($strip($1-),You do not have access to op people on #YourChannel.,1) != $null) || ($pos($strip($1-),#YourChannel is operated by ChanServ,1) != $null)) && ($nick == ChanServ) && ($me !isop #YourChannel)) /id
  :bother
}

dove/joinall /autoop /ident e /id sono alias definiti come:

/joinall {
  /join #channelone
  /join #channeltwo
  /join #channelthree
  ...
}


/autoop {
  /timer 1 0 //chanserv op #ChannelOne $me
  /timer 1 5 //chanserv op #ChannelTwo $me
  /timer 1 10 //chanserv op #ChannelThree $me
  ...
}


/ident {
  //if (($me == YourNick^_^) || ($me == YourAltNick) || (Guest isin $me)) /nick YourNick

}


/id {
  //if ($me != YourNick) /timer 1 0 /nickserv ghost YourNick yourpassword
  /timer 1 5 /nickserv identify YourNick password
  /timer 1 10 /nickserv identify NickTwo password
  ...
}

Ovviamente dovrete cambiare YourNick, YourChannel, yourpassword con i dati reali. "YourMainNick", se ne avete registrati più di uno, è quello che usate di preferenza e con il quale siete operatori nei canali di vostra appartenenza. Se avetesolo un nick, metteteci quello. "YourNick^_^" è il vostro nick con aggiunto "^_^" (e che si suppone non sia registrato), e funzione come backup se il vostro nick viene cambiato in Guest; "YourAltNick" è il nick che avete scritto nel campo "Alternative" di mIRC [File > Options > Connect].

Dove leggete "You do not have access to op people on #YourChannel" e "#YourChannel is operated by ChanServ" dovrete inserire il nome del canale nel quale entrate per ultimo e contemporaneamente nel quale siete operatori.

I comandi aggiuntivi dopo on CONNECT accelerano un pò i DCC, vi consiglio di lasciarceli.

Ed ora spieghiamo come funziona. Aspetta che nickserv gli chieda di identificarsi, e quindi invia la password; quando siete identificati nickerv manda la conferma così lo script sa che può cominciare a chiedere a chanserv di farvi operatori nei canali neiquali siete entrati. Ogni volta che nickserv o chanserv si resettano e vi richiedono la password, lo script la reinvia e provvede a cambiarvi nick se il vostro solito viene modificato a Guest.

DALnet Auto Identify and Auto Op mIRC script

You may think all it’s needed to shut up NickServ when you login on DALnet is putting a /nickserv identify password or /msg nickserv@services.dal.net identify command in the [File > Options > Perform] panel of mIRC… well… actually, it would. As in a perfect world there would be no wars nor poverty nor starvation, but NickServ isn’t perfect (ChanServ isn’t as well, that’s why we are going to speak about him as well, later), so you need to prevent all those situations which may determine NickServ to forget you identified some time bfore, and kicking you to a shameful status of Guest*****.

We’ll explain here how to get rid of these unpleasant situations with a script, not too long, not too short, not perfetc as well, but there is room for betterings.

You can use this addon to load the script instead of writing the lines yourself. Faster, easier, no conflicts with other scripts. Instructions are included in the TXT file, follow them. If you want to edit the script yourself, or just know how it works, continue reading (suggested).

(Note) The script has been lately updated to be more reliable in avoiding the flood of services. In some cases it c0uld, especially if you registered 4 nicks or more, lead to many repeated identification requests, up to making the services upset. Once I even got banned by an IRCop, so I finally decided to put my hands on the old code.
The comments to these upgrades aren’t in the paragraphs below, but what they do is adding another procedure to request both the identification and the ops instead of doing it directly. This procedure checks on a flag (one variable allocated for each nick and each channel), and if the flag is unsetted it requests either the identification or the ops, then sets the flag, which avoid successive repeated requests to be accepted. The flag is unsetted after 60 seconds, making it possible to request identification or ops again.

The messages you see NickServ sends you when you join, telling you "This nick is owned by someone else…" "If this is your nick…" "Password accepted for…" are called "notices". You’ll set a listener for notices coming from NickServ and containing specified patterns of text, so to act depending on what NickServ wants from you.

Enuf talking, let’s come to action:

on *:CONNECT:{
  /dcc packetsize = 4096
  /pdcc 2147483647
  /fsend on
  /joinall
}


on 1:START:/timerIdent 0 40 /ident

on *:NOTICE:*:*:{
  if (($pos($strip($1-),Password accepted for,1) != $null) && ($nick == NickServ)) {
    //if $pos($strip($1-),YourMainNick,1) != $null) {
      /timer 1 20 /autoop 
      /nick YourMainNick
    }
    goto bother
  }
  if (($pos($strip($1-),This nick is owned by someone else. Please choose another.,1) != $null) && ($nick == NickServ)) /id
  if (($pos($strip($1-),Your nick has been changed to Guest,1) != $null) && ($nick == NickServ)) {
    /id
    /nick YourNick^_^
  }
  if ((($pos($strip($1-),You do not have access to op people on #YourChannel.,1) != $null) || ($pos($strip($1-),#YourChannel is operated by ChanServ,1) != $null)) && ($nick == ChanServ) && ($me !isop #YourChannel)) /id
  :bother
}

where /joinall /autoop /ident
and /id are aliases defined as:

/joinall {
  /join #channelone
  /join #channeltwo
  /join #channelthree
  ...
}

/autoop {
  /timer 1 0 //chanserv op #ChannelOne $me
  /timer 1 5 //chanserv op #ChannelTwo $me
  /timer 1 10 //chanserv op #ChannelThree $me
  ...
}


/ident {
  //if (($me == YourNick^_^) || ($me == YourAltNick) || (Guest isin $me)) /nick YourNick

}

/id {
  //if ($me != YourNick) /timer 1 0 /nickserv ghost YourNick yourpassword
  /timer 1 5 /nickserv identify YourNick password
  /timer 1 10 /nickserv identify NickTwo password
  ...
}

Those lines must be added to the Remote and Aliases panels in mIRC (the on CONNECT, on START and on NOTICE must go in the Remote Panel, the /joinall /autoop /ident and /id must go in the Aliases Panel), accessible pressing the buttons and . Check those panels for other occurences of the routines. If you find there’s already an on CONNECT and/or on START and/or on NOTICE in the Remote Panel, you may have installed a script like Polaris, i², Siralop, Invision, or another script (in this case, if you don’t know what that part of the script does, better not to mess, simply stop reading this page and wait to be more acquanted with scripting), so you need to modify/extend the routines adding the lines; if you instead did those scripts yourself, you should know how to modify them properly. In the same way, if there are already aliases named joinall autoop and id in the Aliases Panel, follow the same directives (don’t touch anything if you don’t know what it is, or modify the aliases as you need).

 

Obviously you need to change YourNick, YourChannel, yourpassword with the real ones. "YourMainNick", if you own more than one nick, is the nick, you are operator with, in your channels; if you own only one nick, simply put that one. "YourNick^_^" is your actual nick with a "^_^" after it (supposing it is not registered), so to make you have a real nick while you wait for nickserv to confirm your identification; "YourAltNick" is the nick you wrote as "Alternative" in the mIRC [File > Options > Connect] panel.

The "…" must not be included, but you can add or remove other similar lines in case you are op in more channels or own more nicks. The delayed commands (/timer 1 …) are needed to avoid to flood services which may ignore you if you issue too many requests all togheter (just keep adding the right amount of seconds for each line you add).

In the main script, where you see the lines "You do not have access to op people on #YourChannel." and "#YourChannel is operated by ChanServ" you should write the name of the channel, you are op in, that you join last.

The additional commands on the on CONNECT script should accelerate DCC sends, I suggest you to leave them there.

 

You didn’t get the hidden meaning? Ok, let’s explain what this script does. It waits for NickServ to ask you to identify, then sends the identify command(s); when you are identified, it asks chanserv to op you in the channels you are operator in, and repeats asking this until chanserv does op you. Whenever nickserv or chanserv forget you are identified and operator, it re-issues the identify and op commands, and in the dreaded case nickserv is badly lagged, and you get renamed to Guest, it gives you another temporary nick, until the identification is done. In the case you get disconnected by peer, and you reconnect while you ghost is still "online", it waits for nickserv to confirm the identification, and if your current nick is different from your usual one (that is, the ghost is already using it, and you are named after your alternative nick), it issues a kill ghost command.