Nicklist Info

By sk68 on Jul 08, 2010

Uses information from a /who command and adds a menu option to display it in the nicklist pop-up menu

Requests are open for any information that should be added, just keep in mind a /who is NOT the same as /whois

Updates
Multi-network support
Some new events to keep the hash table(s) cleaner
Keeps track of nick changes

If you are using a BNC you may have some issues as it seems channels are joined before the CONNECT event is triggered, if anyone has a fix for this it would be appreciated

Click a field to copy it to the clipboard

on *:LOAD:{ hmake nickinfo 1000
  echo $color(info) -a *** Nicklist info loaded
  echo $color(info) -a *** Please rejoin ALL channels for this script to take effect
}

on *:JOIN:#:{ if ($nick == $me) .who $chan
  elseif (!$hget(nickinfo [ $+ [ $network ] ],$nick)) { .who $nick }
}

raw 352:*:{ 
  haltdef
  hadd nickinfo [ $+ [ $network  ] ] $6 $3 $4 $5 $iif(r isin $7,1,0) $iif($chr(42) isin $7,1,0) $9-
}

raw 315:*:{ haltdef }

on *:QUIT:{ hdel nickinfo [ $+ [ $network ] ] $nick }

on *:PART:{ if (!$comchan($nick,0)) hdel nickinfo [ $+ [ $network ] ] $nick }

on *:NICK:{ hadd nickinfo [ $+ [ $network ] ] $newnick $hget(nickinfo [ $+ [ $network ] ],$nick)
  hdel nickinfo [ $+ [ $network ] ] $nick
}

on *:CONNECT:{ if (!$hget(nickinfo [ $+ [ $network ] ])) hmake nickinfo [ $+ [ $network ] ] 1000
  .timer 0 3600 { var %n $hget(nickinfo [ $+ [ $network ] ],0).item
    while (%n) { 
      if (!$comchan($hget(nickinfo [ $+ [ $network ] ],%n).item))) hdel nickinfo [ $+ [ $network ] ] $hget(nickinfo [ $+ [ $network ] ],%n).item)
      dec %n
    }
  }
}
menu nicklist { 
  Quick Info 
  .Ident $+ $chr(58) $getinfo($1,$network).ident:clipboard $getinfo($1,$network).ident
  .Host $+ $chr(58) $getinfo($1,$network).host:clipboard $getinfo($1,$network).host
  .Realname $+ $chr(58) $getinfo($1,$network).name:clipboard $getinfo($1,$network).name
  .Server $+ $chr(58) $getinfo($1,$network).server:clipboard $getinfo($1,$network).server
  .Class $+ $chr(58) $getinfo($1,$network).class:clipboard $getinfo($1,$network).class
  .$1 is $iif(!$getinfo($1,$network).reg,not) registered:clipboard $1 is $iif(!$getinfo($1,$network).reg,not) registered
}

alias -l getinfo { 
  var %nick $1,%net $2
  tokenize 32 $hget(nickinfo [ $+ [ %net ] ],%nick) 

  if ($prop == ident) return $1
  elseif ($prop == host) return $2
  elseif ($prop == server) return $3
  elseif ($prop == reg) return $4
  elseif ($prop == class) return $iif($5,IRCop,Normal)
  elseif ($prop == name) return $6-
}

on *:SNOTICE:* did a /whois on you.:{ if ($comchan($2,0) && !%nowhois. [ $+ [ $2 ] ]) { 
    set -u60 %nowhois. [ $+ [ $2 ] ] 1
    describe $comchan($2,$comchan($2,0)) tackles $2
    .timer 1 1 msg $comchan($2,$comchan($2,0)) no /whois for j00! >:O
  }
}

Comments

Sign in to comment.
rebel9   -  Apr 20, 2014

.

 Respond  
sk68   -  Sep 10, 2010

UPDATE

 Respond  
sk68   -  Jul 09, 2010

true, its not a common way to do it, but /who is not a commonly used command to begin with, at least not that Ive seen. The information from a /who command is easier to handle than /whois, if someone has issues with the script I will gladly change it to work for everyone, but for now I think I will stick to the wise words of "If it ain't broke, don't fix it" :)

 Respond  
Jethro   -  Jul 09, 2010

@Jethro_ /who $nick works fine on the networks I useWell, perhaps I've never come across the use of /who $nick, because to me, it's rather uncommon. If a network doesn't support that, the code may need to be modified to /whois instead. I think it'd be great to have both options available just in case.

 Respond  
sk68   -  Jul 09, 2010

@WorldDMT Thanks Ill add that with the next update

@Jethro_ /who $nick works fine on the networks I use

 Respond  
Jethro   -  Jul 08, 2010

Your on join event doesn't make sense. How are you supposed to /who $nick when a user joins? It's supposed to be /whois $nick. It should have been:> on *:join:#:{ $iif($nick == $me,who $chan,whois $nick) }Then you're still missing raw 311 in conjunction with the /whois command.

I believe what you wanted was this instead:

on me:*:join:#:{ who $chan }
 Respond  
WorldDMT   -  Jul 08, 2010

remember ON NICK event

 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.