Category Archives: internet

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.

  This article has been Digiproved

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.

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.

An efficient antispam and away autoreply script for mIRC

I add or update my scripts as it become needed. So, an antispam script is one among the first I did, since, no matter what channels you lurk in, there’s always a lamer sending ads of websites, channels, whatever.

An antispam script does nothing else that recognising some specified patterns in a query window, and ignoring it if it has the appearance of spam.

Briefly, you can download this addon to load from mIRC instead of adding the lines yourself. Instructions of use, along with possible changes you may need to make, are included in the TXT file itself. If you want to edit the lines yourself, or just want to know how the script works, continue reading.

The event in mIRC which triggers the opening of a query window is on OPEN, and the following lines will show how to use it:

on 1:OPEN:?:*:{....

The "?" specifies that the event will trigger only query windows, and the "*" specifies no particular text matches for now (we are going to include all the matches in the body of the script).

My script does 4 things: check if the messaging nick is an operator in one of the channels I am in, and in this case does not filter the message, otherwise it will be processed. If the user who sent you the message is in none of your channels, the message is ignored by default. If it is all ok, another procedure checks if I am away, and in that case tells the nick that I may not be at the computer, or, if it’s late, that I also may be sleeping. If the message is recognised as spam, the window is closed, and a minimized log window is open (if it doesn’t already exist), where you can check the supposed spam messages you received, so to correct te script if some of them weren’t spam.

Here’s the full text script (note: this script works under mIRC v5.9, don’t know about older versions):

on 1:OPEN:?:*:{
  var %Ghost
  set %Ghost 1
  var %Cnt
  set %Cnt 1
   :Loop
  //if ($nick isop $chan(%Cnt)) goto allok
  //if ($ialchan($nick,$chan(%Cnt),1) != $null) set %Ghost 0
  inc %Cnt
  //if (%Cnt < = $chan(0)) goto Loop
  //if (%Ghost == 1) goto absent
  if ($strip($1-) == hello,) goto lamer
  if ($strip($1-) == hello) goto lamer
  if ($strip($1-) === hi) goto lamer
  if ($strip($1-) == hallo) goto lamer
  if ($strip($1-) == holla) goto lamer
  if ($pos($strip($1-),#,1) != $null) goto lamer
  if ($pos($strip($1-),j o i n,1) != $null) goto lamer
  if ($pos($strip($1-),how are you,1) != $null) goto lamer
  if ($pos($strip($1-),how are u,1) != $null) goto lamer
  if ($pos($strip($1-),www.,1) != $null) goto lamer
  if ($pos($strip($1-),slm,1) != $null) goto lamer
  if ($pos($strip($1-),asl,1) != $null) goto lamer
  if ($pos($strip($1-),gamez,1) != $null) goto lamer
  if ($pos($strip($1-),leech,1) != $null) goto lamer
  if ($pos($strip($1-),join,1) != $null) goto lamer
  if ($pos($strip($1-),plz come,1) != $null) goto lamer
  if ($pos($strip($1-),pls come,1) != $null) goto lamer
  if ($pos($strip($1-),/server,1) != $null) goto lamer
  if ($pos($strip($1-),www.cheatos.com,1) != $null) goto lamer
  if ($pos($strip($1-),serv,1) != $null) goto lamer
  if ($pos($strip($1-),click here,1) != $null) goto lamer
  if ($pos($strip($1-),xguest,1) != $null) goto lamer
  if ($pos($strip($1-),/server,1) != $null) goto lamer
  if ($pos($strip($1-),check out my pics,1) != $null) goto lamer
  if ($pos($strip($1-),check my pics,1) != $null) goto lamer
  if ($pos($strip($1-),http://,1) != $null) goto lamer
  if ($pos($strip($1-),sex,1) != $null) goto lamer
  if ($pos($strip($1-),porn,1) != $null) goto lamer
  if ($pos($strip($1-),we need,1) != $null) goto lamer
  if ($pos($strip($1-),chat,1) != $null) goto lamer
  if ($pos($strip($1-),Matches for,1) == 1) goto Results
  goto allok
  :absent
  /query $nick Not in any of my channels. Message ignored.
  /close -m $nick
  goto end
  :lamer
  /query $nick This message's been detected as an invite/whatever else, so this window is being closed. My script can't be 100% accurate, so sorry if it's not your case.
  /close -m $nick
  //if ($window(@lamerz,1) == $null) /window -n @lamerz
  //aline -hp @lamerz 9 [ $time ] 7 < $nick > 8 $1-
  goto end
  :allok
  //if ($away == $true) {
    //if ($asctime(H) < 9) //query $nick [Automated Response] It is $asctime(H:nn) $+ $asctime(tt) here, and I am away ( $+ $duration($idle,2) idle), so I may be sleeping.
    else //query $nick [Automated Response] I am away ( $+ $duration($idle,2) idle). I could answer you if I'm here and the speakers are on ;-)
  }
  :end
}

HTML doesn't allow easy indenting, but when you'll copy/paste this in your mIRC/Remote panel, accessible by pressing the button , and then press the [OK] button, it will be automatically indented.

Important: check if your Remote Panel already contains an [on *:OPEN:?:...] event. In this case, either you did that script, so you don't need me to tell you how to modify it, or you had another script installed, like Polaris, Siralop, Invision, whatever and it probably includes an antispam routine itself, so you don't need this guide.

How you can customize this script:

  • Add new keywords: if you notice that some spam doesn't get filtered, you can add the peculiar words in it to the list, just by copying a line and substituting the keywords. For example, if they open a query window which starts like this: "Hello <yournick>," (while nobody usually opens such query windows just to chat), simply add a line like "if ($pos($1-,Hello <yournick>,,1) != $null) goto lamer" among the others.
  • Specify detailed patterns: you can also check case sensitive keywords. For example, if your nick is JoE^ and you want the above keywords to be case sentitive, put the same line, but substitute "$pos" with "$poscs" so it will become "if ($poscs($1-,Hello JoE^,,1) != $null) goto lamer". Also you can determine if the message must start with those keywords, and not just contain them. In that case, substitute "!= $null" with "= 1" so the line will become "if ($poscs($1-,Hello JoE^,,1) = 1) goto lamer".
  • Specify whole messages: you can as well filter exact sentences, instead of checking if a sentence contains some keywords. In that case simply add a line like "if ($1- == Hello,) goto lamer" which for example will trigger on evey query window equal to "Hello,". This is not case sensitive; if you want a case sensitive check substitute "==" with "===", like "if ($1- === Hello,) goto lamer".
  • Modify the sleep time: my supposed sleep time goes from 0:00 to 8:59; means that a query window received between these times will be answered with the "I am sleeping" message. You can correct this by modifying the Hour time, from 9 to 10 for example, if you want the interval to end at 9:59, or to 8, if you want instead 7:59. If you want to modify the first time, 0:00, you should also add some text to the script. It can be easily done, anyway I don't have right now the time to add a tutorial on this, plus I don't think it's of vital importance wheter the script guesses exactly wheter you are sleeping or not.