Whois Dialog ( simple )

By Scakk on Nov 27, 2007

Simple whois dialog. It will send the whois of a person to the list box in the dialog. The title will also change to tell you who you are /whois'ing. The button " clear " will remove the information in the list box. Also if you /whois someone else the list box will only have the newest person /whois'ed.

Update: It will give you the list of nicks for the active channel. If you click a channel and then click " Nicks " it will give you the list of nicks for the active channel. By double clicking the nick on it will then /whois that person and update the /whois info in the dialog for that person. To get the new nicks if you choose another channel you will need to click the " Nicks " button.

Update: It will now give you a list of all the channels you are in. If you double click a channel it will list all the nicks in that channel.

dialog whoisd {
  title "Whois"
  size -1 -1 300 230
  list 1, 5 5 290 200, read vsbar hsbar
  button "Clear", 2, 25 200 50 25 
  button "Nicks", 3, 130 200 50 25
  button "Channel", 6, 230 200 50 25 
  list 4, 5 5 290 200, read vsbar hsbar
  list 5, 5 5 290 200, read vsbar hsbar
}
on *:dialog:whoisd:*:*: {
  if ($devent == init) { 
    .timer 1 1 did -z whoisd 1 250 250 
    did -h whoisd 4,5
    var %x = 1
    while (%x <= $chan(0)) {
      did -a whoisd 5 $chan(%x)
      inc %x  
    }
  }
  if ($devent == sclick) {
    if ($did == 2) { did -r $dname 1 | unset %whois* | dialog -t whoisd Whois | did -b whoisd 2,4,5 | did -ev whoisd 1 }
    if ($did == 3) { did -r $dname 4 | unset %whois* | dialog -t whoisd Whois -- Nicks / $active | whoisd3 | did -h whoisd 5 | did -b whoisd 1,2,5 | did -ev whoisd 4 } 
    if ($did == 6) { did -b whoisd 1,4 | did -ev whoisd 5 | dialog -t whoisd Whois -- Channels }
  }
  if ($devent == dclick) { 
    if ($did == 4) { whois $did(4).seltext | did -b whoisd 4,5 | did -v whoisd 1 | did -e whoisd 1-3 }
    if ($did == 5) { 
      did -b whoisd 1-3,5
      did -h whoisd 1,5
      did -ev whoisd 4 
      did -r whoisd 4
      dialog -t whoisd Whois -- $did(5).seltext
      var %i = 1
      while (%i <= $nick($did(5).seltext,0)) {
        did -a whoisd 4 $nick($did(5).seltext,%i) 
        inc %i 
      }
    }
  }
  if ($devent == close) { unset %whois* }
}

;Aliases ( borrowed idle from RusselB )
alias -l idle {
  var %idle = $duration($1)
  return $iif($numtok(%idle,32) < 4,$duration($1,3),$+($gettok(%idle,1--3,32),$chr(32),$duration($duration($gettok(%idle,-3-,32)),3)))
}
alias -l whoisd2 {
  if (%whois5) { 
    did -a whoisd 1 $( %whois1 %whois2 %whois3 %whois4 ( Usermodes ) %whois5 ( Snomask ) )
  }
  if (!%whois5) { unset %whois5 | did -a whoisd 1 $( %whois1 %whois2 %whois3 %whois4 ( Usermodes ) )
  }
}
alias -l whoisd3 {
  var %i = 1
  while (%i <= $nick($active,0)) {
    did -a whoisd 4 $nick($active,%i) 
  inc %i }
}
;Raws
raw 401 :*: { dialog $iif($dialog(whoisd),-v,-mied) whoisd whoisd  | dialog -t whoisd Whois - No Such Nick | did -ra whoisd 1 $3- | haltdef }
raw 311 :*: { dialog $iif($dialog(whoisd),-v,-mied) whoisd whoisd  | dialog -t whoisd Whois - $2 | did -ra whoisd 1 $3- | haltdef }
raw 379 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | set %whois1 is | set %whois2 using | set %whois3 modes | set %whois4 $6 | set %whois5 $7 | whoisd2 | haltdef }
raw 378 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 307 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 319 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 on $3- | haltdef }
raw 312 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 using $3- | haltdef }
raw 335 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 301 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 is away: $3- | haltdef }
raw 313 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 310 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 671 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 320 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 317 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 has been idle $idle($3) , signed on $asctime($4,ddd mmm d yyyy @ HH:nn:ss) | haltdef }
raw 318 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }
raw 316 :*: { dialog $iif($dialog(whoisd),-v,-ma) whoisd whoisd  | did -a whoisd 1 $3- | haltdef }

Comments

Sign in to comment.
montague   -  Mar 18, 2010

Hi scakk, could u add a clipboard button? so that i could copy all the nick info.

 Respond  
Scakk   -  Jan 17, 2008

Update: It will now give you a list of all the channels you are in. If you double click a channel it will list all the nicks in that channel.

 Respond  
Scakk   -  Dec 12, 2007

Hayate: You can now /whois anyone in the active channel by clicking the nicks button and then double clicking their nick on the list box. If you click another channel you will need to click \" Nicks \" to get the new nick list.

 Respond  
Hayate   -  Nov 27, 2007

Aye, I\'d just thought it would be nice to whois nicks through the dialog vs. typing /whois or clicking on the nick. Just would make everything easier to control.

 Respond  
Scakk   -  Nov 27, 2007

I changed the did -r whoisd 1 | did -a whoisd1 $3- to be did -ra whoisd 1 $3-

still would be nice to have that feature though.

What feature are you wanting? Not sure here.

 Respond  
Hayate   -  Nov 27, 2007

Very true, still would be nice to have that feature though. Also, in your 311 raw event, did -r whoisd 1 | did -a whoisd 1 etc could be did -ra whoisd 1 etc.

 Respond  
Scakk   -  Nov 27, 2007

Actually it will open if you click a nick and whois them that way as well.

 Respond  
Hayate   -  Nov 27, 2007

k, I\'d have to agree with mountaindew (not sure his code would work though, I\'d rather use isin). Easier for users to learn and check how to script things better. It would really make the code look neater, as thats really the only messy part about it. I really think you should make an option to select nicks from a channel, it\'d be much easier to click and go vs. typing /whois everytime. Other then that, looks good.

 Respond  
Scakk   -  Nov 27, 2007

1) I left them lined up so if people want to know what each did they could check easily.
2)The horizontal line will now activate without having to click anything.
3) Title will now say \" No Such Nick \" if there is no such nick.

 Respond  
guest598594   -  Nov 27, 2007

for the different raw #\'s that do the same function, u can simply do

raw *:*:{
  if ($istok(335 301 313 310 671 320,$numeric)) {
    dialog $iif($dialog(whoisd),-v,-ma) whoisd whoid
    did -a whoisd 1 $3-
    haltdef
  }
}

but it works fine the way it is

also, i think u shuold did -z b4 u sclick, and when u get \"... is no such nick\" i think u should update the title and say no such nick or something in the listbox :)

 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.