|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Is it possible to change it to whois the nicklist in alfa order from a to z ?
alias randomnick {
if ( %op.random == off ) || ( %op.random == $null ) { return }
if ( !$timer(randomwhois) ) { timerrandomwhois 0 60 randomnick }
if ( $me isop #chat ) { whois $nick($v2,$rand(1,$nick($v2,0))) }
}
}
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Warning: This will fail on a channel with lots of names and/or long nicks. menu * {
Alphabetical Whois : who_is $input(Channel Name,e,,$iif($chan,$v1))
}
alias -l who_is {
if !$nick($1,$me) { echo -a Sorry you must be in $1 }
else {
var %a = 1, %b = $nick($1,0)
while %a <= %b {
set %alpha_nicks $addtok(%alpha_nicks,$nick($1,%a),32)
inc %a
}
set %alpha_nicks $sorttok(%alpha_nicks,32)
}
var %a = 1, %b = $numtok(%alpha_nicks,32)
while %a <= %b {
.enable #alpha_whois
whois $gettok(%alpha_nicks,%a,32)
inc %a
}
}
#alpha_whois off
raw *:*:{
if $numeric == 318 {
.disable #alpha_whois
}
elseif $int($calc($numeric / 100)) == 3 {
echo -s $1-
}
}
#alpha_whois end
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
Cool....can you add a timer in it to check one every 30 sec so that I dont seft flood?
Last edited by Garou; 02/08/07 05:18 PM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Unnecessary...the code should not proceed to the next /whois until the current one is complete.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
The code in fact might flood you off the server; I think the following is what RusselB had in mind: processing the next whois if the actual whois finished - thereby producing a dynamic delay without flooding too many /whois-requests at once. menu * {
Alphabetical Whois : who_is $input(Channel Name,e,,$iif($chan,$v1))
}
alias -l who_is {
if (!$nick(#$1,$me)) { echo -a Sorry you must be in #$1 }
else {
var %a = 1, %b = $nick(#$1,0)
while (%a <= %b) {
set %alpha_nicks $addtok(%alpha_nicks,$nick(#$1,%a),32)
inc %a
}
set %alpha_nicks $sorttok(%alpha_nicks,32)
}
.enable #alpha_whois
alpha_whois
}
alias -l alpha_whois {
whois $gettok(%alpha_nicks,1,32)
}
#alpha_whois off
raw *:*:{
if ($numeric == 318) {
if ($deltok(%alpha_nicks,1,32)) {
set %alpha_nicks $v1
alpha_whois
}
else { .disable #alpha_whois }
haltdef
}
elseif ($int($calc($numeric / 100)) == 3) {
echo -s $1-
haltdef
}
}
#alpha_whois end
I also added "haltdef", as the code already echoes the reply to the status window. btw: the line elseif ($int($calc($numeric / 100)) == 3) { is ingenious 
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Thanks, Horstl, for noting what I was trying to do (not sure why some of the code didn't post), and for the 'ingenious' compliment.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I get this error? * /set: line too long (line 10, dialog62.op)
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
You were warned that a channel with lots of names and/or long names might not work. That's what has happened.
The variable in that line, that's trying to be set, has reached a length greater than 950 characters. This is a known mIRC limitation. The only way that I'm aware of getting around it, is to use binary variables, but I haven't used them, and I don't know how they work.
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
I see then maybe I better keep my original random code also? Thank you both :P
|
|
|
|
Joined: Jan 2004
Posts: 509
Fjord artisan
|
Fjord artisan
Joined: Jan 2004
Posts: 509 |
The variable in that line, that's trying to be set, has reached a length greater than 950 characters. This is a known mIRC limitation. The only way that I'm aware of getting around it, is to use binary variables, but I haven't used them, and I don't know how they work. It would be nice if mIRC could stop at 950 then. Anyone wrote a snippet to $calc( $len(%variable) to be 950, and then cut it off, since, mIRC doesn't?
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
The problem with that, LostShadow, is that the number isn't exactly 950 characters.
I use 950 as a base, and most of the time it works fine, but the true limit, if I remember correctly, can be calculated as: 967 - (number of characters in variable name)
So the actual number of characters that you can have in a variable, also depends on the number of characters in the variable name.
Very few people work with variable names that are 17 characters (or more), which is why I normally use the 950.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
This solution uses (hidden) windows to store the nicks, and filter to sort the list menu * {
Alphabetical Whois : who_is $$input(Channel Name,e,,$iif($chan,$v1))
}
alias -l who_is {
if (!$nick(#$1,$me)) { echo -a Sorry you must be in #$1 to perform the alphabetical whois. }
else {
window -h @alphawhois.nicks
var %nr = 1
while ($nick(#$1,%nr)) { aline @alphawhois.nicks $v1 | inc %nr }
window -h @alphawhois.out
filter -wwct 1 32 @alphawhois.nicks @alphawhois.out
window -c @alphawhois.nicks
}
.enable #alpha_whois
alpha_whois
}
alias -l alpha_whois {
if ($line(@alphawhois.out,1)) { whois $v1 }
else {
window -c @alphawhois.out
.disable #alpha_whois
}
}
#alpha_whois off
raw *:*:{
if ($fline(@alphawhois.out,$2,1,32)) {
if ($numeric == 318) {
echo -s $str(-,15)
dline @alphawhois.out $fline(@alphawhois.out,$2,1,32)
alpha_whois
}
elseif ($int($calc($numeric / 100)) == 3) {
echo -s $2-
}
haltdef
}
}
#alpha_whois end
|
|
|
|
Joined: Aug 2006
Posts: 469
Fjord artisan
|
OP
Fjord artisan
Joined: Aug 2006
Posts: 469 |
WOW...worked fine on 125 users I only got up to a 2sec lag :P Thank You,
|
|
|
|
|