mIRC Home    About    Download    Register    News    Help

Print Thread
#145055 18/03/06 01:20 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello!

how can I set mirc to display whois in the query window of the nickname (if it doesnt exist, in status) ?

(not whois in active as the mirc option says, but in the same query)

thanks!

#145056 18/03/06 02:00 AM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
There is also an option "whois on query". You'll find it in the same place the "show in active" is in.

ALT-O -> IRC


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#145057 18/03/06 02:31 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
yes but its not what I want

"whois on query" just whoises the nickname that opened a new query...

#145058 18/03/06 04:29 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
You need to make a script that intercepts each whois raw. Here is some code that will display the whois information in a query window if that query window is open, otherwise it displays the info to a @whois window.

Code:
;Whois start, nick/ident/host/realname
raw 311:*:{
  ;<me> <nick> <ident> <host> <mode> <realname>

  if (!$hget(whois)) hmake whois 5
  hdel whois $+($cid,*)

  hadd whois $+($cid,.,whois) $2

  w.disp $2 $+(,$2,) is $+($3,@,$4) 
  w.disp $2 $w.i($2) is $6-
  halt
}

;Whowas start, nick/ident/host/realname
raw 314:*:{
  ;<me> <nick> <ident> <host> <mode> <realname>

  if (!$hget(whois)) hmake whois 5
  hdel whois $+($cid,*)

  hadd whois $+($cid,.,whowas) $2

  w.disp $2 $+(,$2,) was $+($3,@,$4) 
  w.disp $2 $w.i($2) was $6-
  halt
}

; Whois registered nick
raw 307:*:{
  ;<me> <nick> is a registered nick

  w.disp $2 $w.i($2) is using a registered nick
  halt
}

; Whois/whowas on server
raw 312:*:{
  ;<me> <nick> <server> <description/signoff>

  if ($hget(whois,$+($cid,.,whois))) {
    w.disp $2 $w.i($2) on $3 $+([,$4-,])
  }
  else {
    w.disp $2 $w.i($2) was on $3
    w.disp $2 $w.i($2) signed off: $asctime($4, h:nn:sstt mmm doo yyyy)
  }
  halt
}

; Whois is IRCop
raw 313:*:{
  ;<me> <nick> <IRCop Description>

  w.disp $2 $w.i($2) $iif(Beyondirc isin $network,$remove($3-,(is an IRC Operator)),$3-)
  halt
}

; Whois using modes (ircop)
raw 379:*:{
  ;<me> <nick> is using modes <modes>

  w.disp $2 $w.i($2) is using modes: $6
  halt
}

; Whois connecting from (ircop)
raw 378:*:{
  ;<me> <nick> is connecting from <host>

  w.disp $2 $w.i($2) is connecting from: $6
  halt
}

; Whois available for help (ircop)
raw 310:*:{
  ;<me> <nick> is available for help.

  w.disp $2 $w.i($2) is available for help
  halt
}

; Whois channel list
raw 319:*:{
  ;<me> <nick> <channel> <channel> ...

  var %w.cur, %w.pre, %w.chan, %w.four
  var %w.chans = $3-

  while (%w.chans) {
    %w.cur = $gettok(%w.chans,1,032)
    %w.chans = $deltok(%w.chans,1,032)

    var %regex = $regex(whois,%w.cur,/^([^\s#]?)(#.*)$/)
    %w.four = %w.four $+ $iif(%w.four,$chr(044)) $iif($regml(whois,1),$ifmatch) $iif($me ison $regml(whois,2), $+ $regml(whois,2) $+ , $regml(whois,2))

    if (($gettok(%w.chans,1,032) == $null) || ($numtok(%w.four,044) >= 4)) {
      w.disp $2 $w.i($2) on %w.four
      %w.four = $null
    }
  }

  halt
}

; Whois connection time
raw 317:*:{
  ;<me> <nick> <idletime> <connecttime> seconds idle, signon time

  w.disp $2 $w.i($2) idle: $duration($3) $+ , signed on: $asctime($4, h:nn:sstt mmm doo yyyy) 
  halt
}

; Who 
raw 352:*:{
  ; <me> <channel> <ident> <host> <server> <nick> <modes> <hops> <realname->
  ; H = here; G = away; r = registered; * = IRCop; % = bot; @ = op on channel; + = voice on channel

  var %w.cmodes = $remove($7,G,H,r,*,%)
  var %w.desc = $addtok(%w.desc,$iif(G isin $7, Away, Here),032)
  if (r isin $7) %w.desc = $addtok(%w.desc,Reg'd,032)
  if (* isin $7) %w.desc = $addtok(%w.desc,IRCop,032)
  if (% isin $7) %w.desc = $addtok(%w.desc,Bot,032)

  w.disp $2 $+(,$6,) is $+($3,@,$4) $+ , on $+(%w.cmodes,$2) ( $+ $replace(%w.desc,$chr(032),$chr(044) $+ $chr(032)) $+ )
  w.disp $2 $w.i($6) is $9 on $5 ( $+ $8 hops)

  hinc whois $+($cid,.who.count) 1

  halt
}

; No such whois/whowas
raw 401:*:{
  ;<me> <nick> No such nick/channel

  echo -s $+([,$2,]) No such user or channel
  halt
}

; End of whois
raw 318:*:{
  ;<me> <nick> End of /WHOIS list.

  hdel whois $+($cid,.,whois)
  halt
}

; End of whowas
raw 369:*:{
  ;<me> <nick> End of /WHOWAS

  hdel whois $+($cid,.,whowas)
  halt
}

; End of who
raw 315:*:{
  ;<me> <nick> End of /WHO list.

  w.disp $2 End of WHO matching $2 - $iif($hget(whois,$+($cid,.who.count)),$v1,0) user $+ $iif($hget(whois,$+($cid,.who.count)) != 1,s) found
  hdel whois $+($cid,.who.count)
  halt
}

raw *:*:{
  if ((!$hget(whois,$+($cid,.,whois))) && (!$hget(whois,$+($cid,.,whowas)))) return
  w.disp $2 $w.i($2) $3-

  halt
}

alias w.i return $+(,$color(background),$chr(044),$color(background),$1-,)

alias w.disp {
  ;1=nick, 2-=display message
  if ($query($1)) echo -t $1 $2-
  else {
    if (!$window(@whois)) window -eniz @Whois -1 -1 -1 -1 /whois
    aline -hp $color(whois) @Whois $timestamp $2-
  }
}
;Whois Display by genius_at_work, 2006


This code will handle all raws returned by whois/whowas/who commands. Known raws are displayed with custom formatting, and any unknown raws that occur between 311 and 318 (whois) or 314 and 369 (whowas) are displayed with simple formatting (almost "as-is").

-genius_at_work

#145059 19/03/06 02:19 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks

although I was thinking of just:

Code:
 raw 401:*:{ //echo -s $$2- | halt }
raw 318:*:{ //echo -s $$2- | halt }
 

#145060 19/03/06 03:25 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
while yours is a lot simpler, those two raws would go the the status window, but you'd still get the normal /whois information in the normal location (for me that's the status window) for the rest of the information coming from the /whois event.

While not what you were literally asking for, you might be interested in this snippet of mine WhoIs/WhoWas dialog

Last edited by RusselB; 19/03/06 03:33 AM.
#145061 21/03/06 01:12 AM
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
sorry I didnt understand why actually those two raws wont do the job...

#145062 21/03/06 05:48 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Well, to start with, RAW 318 is only returned upon the finish of the /whois list. RAW 401 is returned if the nick doesn't exist.

For more information about raws and the actual values that are returned and when, take a look at mIRC.net/raws


Link Copied to Clipboard