mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2010
Posts: 59
A
Babel fish
OP Offline
Babel fish
A
Joined: Apr 2010
Posts: 59
Hello,

I have an idea for a simple script I want to write. I'd like to know if it's possible in mIRC. Disclaimer: it could be the script could be unfriendly or unwelcome, or interpreted as such if it's suspected; but it's also merely a recombination of existing information that the server makes available. Possible moral dilemma on that matter.

Regardless, mIRC isn't my primary programming language, so I'd like to express myself in a syntax which is more comfortable for me. The square brackets denote a hash lookup.

Code:
on 1:TEXT:*:*:{
  if $host not in $primarynicks {
    $primarynicks[ $host ]= $nick
    $primarynicks_q.append( $host )
    while len( $primarynicks_q )> 1000 {
      pop( $primarynicks_q, 0 )
    }
  } else if $primarynicks[ $host ]!= $nick {
    $nick = $nick ( $+ $primarynicks[ $host ] $+ )
  }
}


The effect of the script is to add a comment affixed to the user's nick in the chat window. The comment reveals any previous nicks that have originated from the same host in any of your channels, by associating them all with the first "observation" in that data set. $primarynicks is one of the possible definitions of a reverse IAL. The 'while' loop lines 5-7 merely limits the size of the hash to the N most recent entries (shown as 1000), and also could just be an 'if' in many cases.

Beyond the syntax, the issues I'm aware of are:
1) The absence of an array type, so the "queue" would need to be approximated with a hash.
2) $nick is a read-only variable (line 9)
3) If the hash is made persistent between sessions, it loses integrity. If not, a /who #channel must be executed, or the information is lost.
4) The "comments" could interfere with another user's privacy, if they are merely using the same machine, for example the web gateway, as someone who is already in your list.

How significant are the issues? Is there a workaround to display the usual line with the additional comment? The $host variable may cloud the point a little; that information appears as "$site" in Remote Identifiers ("$site Returns the portion of $address after the @") but ".host" in the properties of the IAL.



Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It is not uncommon for someone to use a script that lists previous nicks. However, most will put that information in the JOIN message instead of attached to the nick itself. Consider that some people change nicks frequently, so attaching it to the nick will make the nick very long. It's definitely better to have it on a join message.

The one thing I'm not sure of based on your description is whether or not you are referring to all previous nicks or only nicks currently connected from that host (as a way to see clones). Clone scanners can easily be found as there have been many written over the years. If you're talking about a clone scanner, then there usually won't be that many nicks on at a given time, so it might not be as bad if you're putting them all attached to the nick. Personally, I still wouldn't go that route because it will look really cluttered imo.

If you really want to get creative with either a previous nick or a clone scanner script, you can insert a symbol or combination of symbols (such as a [+]) before the nick on all messages and hotlink that so you can click on it to open a list of nicks. This lets you have instant access without searching for the JOIN message and it also doesn't take up much space. I haven't ever seen that done before, but it would probably work really well.

Regarding your question about $nick... you are correct that it cannot be changed. Nor should it. If you are editing (aka formatting or theming) your display, then you need to halt the default text and echo things the way you want them. Because you are using /echo, you can just echo $nick and the previous nicks in whatever format you want. You don't have to associate the previous nicks with $nick.

Keep in mind that these types of scripts aren't going to necessarily handle issues where someone's IP changes and they won't work with masked addresses. You can handle the IP changes if you decide to assume that any time you see NICK, then it's the same person and not another person using the same nickname. But that's not necessarily accurate. As for masked addresses, there really isn't a lot you can do other than to only use the nickname, which puts you in the same situation, where someone else might use the same nick.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2010
Posts: 59
A
Babel fish
OP Offline
Babel fish
A
Joined: Apr 2010
Posts: 59
The echo command is a little discouraging because it violates the DNRY strategy. However, a couple of angle brackets aren't unreasonable to add. However, I am a little mystified as to how to attach the symbol for the user's mode in the channel, such as @ or +. Also, I don't see it in the docs, but are "[[" and "]]" the escape characters for the square brackets?

I like your idea of just adding a mark to indicate additional information. That could work, combined with merely an echo to an auxiliary window, devoted to clone scanning or a combination of other things, instead of clicking. More like, "see below".

The effect I want is to associate all someone's nicks with the same identifier, which might as well just be the first nick they were observed to use. For example, I would appear as:

<castironpi|away (castironpi)> Hello!

I'm aware it's still not foolproof. You'll get at least one "false positive", which is if person X uses nick A, then switches to nick B, then person Y joins as nick A, then switches to nick C. Both people will have "A" in the tag:

<A> hello
<B (A)> hello again
<A> person two
<C (A)> person two again

In addition, you'll get a number of false negatives, which are the same person joining from different hosts, and not being linked to their first observed nick.

Maybe it would just be easier to just print the whole prefix! Currently, I think I'm favoring that option, with an auxiliary window for all chans combined:

Code:
on 1:TEXT:*:*:{
  if (!$window(@dev)) window @dev
  echo @dev [[ $+ $chan $+ ]] < $+ $fulladdress $+ > $1-
}


Also, I'd like to point out, that the degree to which the extra information makes the chan look cluttered, varies by the average distribution of line lengths, and to a lesser extent, composition.

Thanks for your reply.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
User modes is a setting in mIRC's options. Alt-O > IRC > Show Mode Prefix. Double brackets aren't an escape character. You'd see them as double brackets. []'s are treated as plain text when touching another character -- [*] would be displayed as plain text. If you need to display a bracket by itself, you can use $chr(91) and $chr(93). As a note, there are occasions when you can display them without $chr() and without touching other items. These are just basic guidelines.

You can create your own identifiers if you need them by just using an alias. Here's a basic example:
Code:
alias bracket {
  return « $+ $1 ( $+ %altnicks $+ ) $+ »
}


Use: //echo -a $bracket($me)
Output: «Riamus2 (Riamus,RiamusAFK)»
Note: %altnicks is filled with the alternate nicks that you obtain through your script. In this basic example, it's just a single variable and not necessarily based on what is in $1. This would need some adjusting based on how you're storing/accessing your data (for example, using a hash table) and is just meant to steer you in the right direction. You'll probably also want to set it up to hide the ()'s if there aren't any alternate nicks.
Usage in a script: //echo -a $bracket($nick) $1- | haltdef

*Edited the script example to something a little closer to what's being discussed.

Last edited by Riamus2; 04/10/11 12:16 PM.

Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard