mIRC Homepage
Posted By: acemiles_ed Idle user count? - 06/05/03 01:39 AM
What would it take to make a script that lets you set a variable with the current count of idle users? So for example:

%#chat-idlers 10

Is this possible? And if so, how would one go about scripting that?
Posted By: KingTomato Re: Idle user count? - 06/05/03 01:46 AM
You need to whois each user on the channel, then take the raw from the event. If a idle time is returned on the user, then add their name to the list.
Posted By: Nimue Re: Idle user count? - 06/05/03 02:09 AM
If you want the users total idle time you need to do what KingTomato suggested.
You could check for 'idle longer than x secs' since you joined the channel
Code:
alias idlers {
  unset $+(%,#,-idlers)
  var %i = 1
  while $nick(#,%i) {
    if $nick(#,%i).idle > [color:red]9[/color] { inc $+(%,#,-idlers) } 
    inc %i
  }
}
Posted By: CloCkWeRX Re: Idle user count? - 06/05/03 05:44 AM
its a messy solution, the whois version - watch out flooding....

Perhaps a better solution (in some respects at least):

on *:text:*:#:{
set $+(%,idle.,#,.,$nick) $asctime
}
alias idlenicks {
;%idlelen is the varible which contains the time in ticks format for which someone has been idle. if (time - idlelen) is greater than idletime, incrment counter
if ($1) {
var %i = 1
;Count all varibles of where someone spoke in channel $1
while (%i <= $var($+(%,idle.,$1,.*),0) {
if ($eval($var($+(%,idle.,$1,.*),%i),2) > $calc($asctime - %idlelen)) { inc %idlenicks. $+ $1 }
inc %i
}
}
echo -s There are $eval(%idlenicks. $+ $1,2) nicks idle on $1
}

Untested and untried, and you'll have to unset %idle.*.* on exit otherwise its inefficient. Hope it gives you an inspiration
Problems:
-a user might not say anything at all, and won't come up on your radar with this alias
-A user might just be away and you'll never know\
-a user might be idling on your chan but active on another./..

*shrug*
Note:
*DOH*
I just reread the $nick().idle bit... I'm outta touch!
Posted By: KingTomato Re: Idle user count? - 06/05/03 03:34 PM
If that does what I think it does, clock, your trying to calculate the idle times of the users yourself with variables. You did see what Nimue posted with the .idle property...right?
Posted By: Nimue Re: Idle user count? - 06/05/03 03:39 PM
Read the last three lines of the post. laugh
Posted By: KingTomato Re: Idle user count? - 06/05/03 03:44 PM
Goodcall Nimue... Sry, i just woke up crazy
© mIRC Discussion Forums