mIRC Home    About    Download    Register    News    Help

Print Thread
whois help please #183438 20/08/07 12:31 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
My @Whois window open a new window everytime a new user login...is it possible have the all the whois in the same window?

Code:
 
raw 311:*:{ 
  Window -a @Whois- $+ $2 100 100 490 180
  clear @Whois- $+ $2
  titlebar @Whois- $+ $2 ( $+ $3 $+ @ $+ $4 $+ )
  aline @Whois- $+ $2 $chr(160)
  aline @Whois- $+ $2 10Nick:4 $2 
  aline @Whois- $+ $2 10Real Name:4 $6 $+ 
  aline @Whois- $+ $2 10Address:4 $3 $+ @ $+ $4 $+  
  halt 
}
raw 319:*:{ aline @Whois- $+ $2 10Channels:4 $3- $+  | halt }
raw 312:*:{ aline @Whois- $+ $2 10Server:4 $3 10Network:4 $4- | halt }
raw 301:*:{ aline @Whois- $+ $2 10Away msg:4 $3- | halt }
raw 307:*:{ aline @Whois- $+ $2 10NickServ:4 $2 10has identified for this nick. | halt }
raw 313:*:{ aline @Whois- $+ $2 10IrcOp:4 yes | halt }
raw 317:*:{ aline @Whois- $+ $2 10Idle Time:4 $duration($3) 10Signed on @4 $asctime($4,dd/mm/yy HH:nn) | halt }
raw 318:*:{ aline @Whois- $+ $2 $chr(160) | halt }

menu @Whois* {
  query:query $$1
  -
  ctcp/dcc
  .ctcp
  ..ping:ctcp $$1 ping
  ..time:ctcp $$1 time
  ..version:ctcp $$1 version
  .dcc
  ..file:dcc send $$1
  ..chat:dcc chat $$1
  ignore 
  .+ignore:ignore $$1 3
  .- ignore:ignore -r $$1 3
  -
  close:window -c $window(@Whois*,1)
}




Re: whois help please [Re: Garou] #183446 20/08/07 01:03 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The main thing is to replace "@Whois- $+ $2" (creating a window title containing the nick of the whois'd user) with "@Whois" (creating a general whois window)
Code:
raw 311:*:{ 
  if (!$window(@whois)) { Window -a @Whois 100 100 490 180 }
  aline -p @Whois 10Nick:4 $2 10Address:4 $3 $+ @ $+ $4 $+ 
  aline -p @Whois 10Real Name:4 $6 $+ 
  haltdef
}
raw 319:*:{ aline -p @Whois 10Channels:4 $3- $+  | haltdef }
raw 312:*:{ aline -p @Whois 10Server:4 $3 10Network:4 $4- | haltdef }
raw 301:*:{ aline -p @Whois 10Away msg:4 $3- | haltdef }
raw 307:*:{ aline -p @Whois 10NickServ:4 $2 10has identified for this nick. | haltdef }
raw 313:*:{ aline -p @Whois 10IrcOp:4 yes | haltdef }
raw 317:*:{ aline -p @Whois 10Idle Time:4 $duration($3) 10Signed on @4 $asctime($4,dd/mm/yy HH:nn) | haltdef }
raw 318:*:{ aline -p @Whois $chr(160) | haltdef }

menu @Whois { close : window -c @Whois }

Re: whois help please [Re: Horstl] #183449 20/08/07 01:21 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
cool its working fine...is it possible to add a sepline with date and time?
Exemple:

[Whois]_____________________________________
[Sun Aug 19 21:18:51 2007]
Nick: BlackStones Address: ~eh_@58.69.14.204
Real Name: wtf?!
Channels: #chat
Server: redemption.ix.us.dal.net Network: DALnet IX Client Server
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

Re: whois help please [Re: Garou] #183450 20/08/07 01:39 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
raw 311:*:{ 
  if (!$window(@whois)) { Window -ak0 @Whois 100 100 490 260 }
  aline -p @whois $+(10,[Whois],$str(_,40))
  aline -p @whois $+(10,[,$asctime($ctime,ddd mmmm dd HH:nn:ss yyyy),])
  aline -p @Whois 10Nick:4 $2 10Address:4 $+($3,@,$4)
  aline -p @Whois 10Real Name:4 $6
  haltdef
}
raw 319:*:{ aline -p @Whois 10Channels:4 $3- | haltdef }
raw 312:*:{ aline -p @Whois 10Server:4 $3 10Network:4 $4- | haltdef }
raw 301:*:{ aline -p @Whois 10Away msg:4 $3- | haltdef }
raw 307:*:{ aline -p @Whois 10NickServ:4 $2 10has identified for this nick. | haltdef }
raw 313:*:{ aline -p @Whois 10IrcOp:4 yes | haltdef }
raw 317:*:{ aline -p @Whois 10Idle Time:4 $duration($3) 10Signed on @4 $asctime($4,dd/mm/yy HH:nn) | haltdef }
raw 318:*:{ aline -p @Whois $+(10,$str(_,47)) | haltdef }

menu @Whois { close : window -c @Whois }


With $asctime, you can format a "raw" numeric time (like the actual time: $ctime) to any text format you like smile

Re: whois help please [Re: Horstl] #183451 20/08/07 01:45 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Great stuff thx very much :P

Re: whois help please [Re: Horstl] #183453 20/08/07 02:25 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Anyway I can turn it off with something like this?
Will this work?

raw 311:*:{
if ( %whois == off ) || ( %whois == $null ) || { return }

Re: whois help please [Re: Garou] #183457 20/08/07 03:41 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The smartest way to toggle multiple events, like the raw events (raw replies of whois) in your script, would be a group.
Surround your raw lines with such a group:

Code:
#whoiswindow off
raw 311:*:{ 
  ...
  ... all the other raw lines here, too ...
  ...
raw 318:*:{ aline -p @Whois $+(10,$str(_,47)) | haltdef }
#whoiswindow end

We thus created a group called "#whoiswindow", all lines of code inside that group will be processed if the group is "on", or ignored if the group is "off".
If you want to stop the whois-ing itself, add the triggering command in that group as well (it's most likely a on join event).
Now we need a switch to toggle the group, e.g. a menu definition:
Code:
menu channel {
  Show whois in separate window $+([,$group(#whoiswindow),])
  .$iif(($group(#whoiswindow) == on),$style(1)) on : .enable #whoiswindow
  .$iif(($group(#whoiswindow) == off),$style(1)) off : .disable #whoiswindow
}


Re: whois help please [Re: Horstl] #183477 20/08/07 10:21 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Thx mate.