mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#153705 21/07/06 11:40 AM
Joined: Jan 2006
Posts: 20
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2006
Posts: 20
Thanks for all your replies guys.
But I was just testing the script of KingTomato.

I was wondering if it was possible to NOT show the common channels line in a whois at myself.
Also, is it possible to NOT show the common channels line when I whois someone that hasn't got a common channel with me?

Thanks in advance.


Obey
#153706 21/07/06 03:54 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
The $nick i could ignore as a typo, he should have just used $1, but the %nick well he made that a VAR so its local only to the raw its in, should have been a SET frown

#153707 21/07/06 04:16 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
if all you want is to have the common channels show at the end of a whois and not show if there are no common channels then try this
Code:
raw 318:*: {
  var %a = 1, %b = $comchan($2,0)
  if (!%b) { return } 
  while %a <= %b {
    var %chan = $addtok(%chan,$comchan($2,%a),44)
    inc %a
  }
  echo -a $2 has the following channels common with you: %chan
}

#153708 21/07/06 05:08 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Not sure What you're looking for in the former request, but if I'm understanding properly, you do not want the common channels displayed if you whois yourself? This is easy to do if that's all you want.

Additionally, making the common channels absent when there are no channels is equally simple. Both items (as I've understood them) are resolved below:

Code:
raw 319:*: {
  var %nick = $2, %c = 1
  if ($1 == $2) return
  while ($gettok($3-,%c,32)) {
    var %chan = $v1
    .echo -q $regex(%chan,/^.*(\x23.*)$/)
    var %clist = $addtok(%clist,$regml(1),44)
    /inc %c
  }
  var %c = $comchan(%nick,0)
  while (%c > 0) {
    if ($istok(%clist,$comchan(%nick,%c),44)) var %common = $addtok(%common,$comchan(%nick,%c),44)
    /dec %c
  }
  if (%common) {
    if ($window(%nick)) /echo %nick %nick Common Channels: %common
    else /echo -a %nick Common Channels: %common
  }
}


-KingTomato
#153709 21/07/06 05:47 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
To have mIRC whois someone when they send you a query then go to the options - IRC and checkmark the "Whois on Query" option
if you must have it as part of the scripting you are using then use the on open event to whois the $nick
make sure that you do not have any other on open event in this script, if you do then add the command whois $nick $nick into that
Code:
on *:open:?:*:{ whois $nick $nick }
raw 319:*: {
  var %a = 1, %b = $comchan($2,0)
  if (!%b) { return } 
  while (%a <= %b) {
    var %chan = $comchan($2,%a)
    inc %a
  }
  echo $color(whois text) -a $2 Common Channels: %chan
}

#153710 21/07/06 10:02 PM
Joined: Jan 2006
Posts: 20
R
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Jan 2006
Posts: 20
Thanks everyone.. working fine now! great!


Obey
#153711 21/07/06 10:34 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The $nick was a typo, should've been %nick. Setting %nick to $2 sets the variable %nick to the nick that was whoised. As mentioned before I got to reply, that should've been done as a global variable, rather than a local. Not sure why I didn't catch that before I posted it, but easily altered in any case.

Page 2 of 2 1 2

Link Copied to Clipboard