Info on Query

By IllogicTC on Jan 23, 2011

This code is a simple snippet designed to give you information you might want to know about a person when they PM you. Right now it has a basic setup and will return in the following format:

Query from IllogicTC. Full address: IllogicTC!~IllogicTC@Swift-617BE073.random.stuff.net. Common channels: #msl.

(Includes nickname, full address [$address 5], and common channels.)

The layout is straightforward, and easy to change for your own purposes should you require more (or less) information.

on *:OPEN:?:*: {
  var %x 0
  var %y $comchan($nick,0)
  while (%x < %y) {
    inc %x
    var %a %a $+ $chr(32) $+ $comchan($nick,%x)
  }
  echo $nick Query from $nick $+ . Full address: $address($nick,5) $+ . Common channels: %a $+ .
}

Comments

Sign in to comment.
jaytea   -  Jan 23, 2011

consider:

a b c

in on OPEN, $1- = a b c and $0 = 3.

while $comchan($nick,$0) { tokenize 32 $1- $v1 } 

the loop starts at $comchan($nick, 3) with $0 strictly increasing. $comchan($nick, 1) and $comchan($nick, 2) are never added to the list.

 Respond  
Jethro   -  Jan 23, 2011

Incorrect, how? Are you suggesting the tokenize loop is unsuitable than using:

on *:open:?:*:{
  var %y, %x 1 
  while $comchan($nick,%x) { 
    %y = %y $v1 
    inc %x
  } 
  echo -a %y
}

I always thought they were the same thing. Did I miss something?

 Respond  
jaytea   -  Jan 23, 2011

Jethro, that code returns incorrect common channels if $0 > 1. those 'tokenize loops' are only suitable if you know the value of $0 in advance.

 Respond  
IllogicTC   -  Jan 23, 2011

Jethro_: Yeah good point, I never thought to tokenize :(

jcrosb94: Where? I see it nowhere. I do know you can /whois on Query, but that involves having a whole whois list down, and there is no changing what that whois says. With this, it gives some basic info, and is customizable for anyone's own purposes.

 Respond  
jcrosb94   -  Jan 23, 2011

Seeing as how mIRC has a built-in setting for this, there is really no need for this script.

 Respond  
Jethro   -  Jan 23, 2011

You can also do it like so:

on *:open:?:*:{
  while $comchan($nick,$0) { tokenize 32 $1- $v1 } 
  echo $nick Query from $nick $+ . Full address: $fulladdress $+ . Common channels: $2-.
}
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.