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?
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.
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
alias idlers {
unset $+(%,#,-idlers)
var %i = 1
while $nick(#,%i) {
if $nick(#,%i).idle > [color:red]9[/color] { inc $+(%,#,-idlers) }
inc %i
}
}
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!
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?
Read the last three lines of the post.
Goodcall Nimue... Sry, i just woke up