|
Joined: Jan 2006
Posts: 20
Ameglian cow
|
OP
Ameglian cow
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
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
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
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
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
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
}
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
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:
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
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
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
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
}
|
|
|
|
Joined: Jan 2006
Posts: 20
Ameglian cow
|
OP
Ameglian cow
Joined: Jan 2006
Posts: 20 |
Thanks everyone.. working fine now! great!
Obey
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
|