mIRC Home    About    Download    Register    News    Help

Print Thread
#22649 06/05/03 01:39 AM
Joined: Dec 2002
Posts: 83
A
Babel fish
OP Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
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?

#22650 06/05/03 01:46 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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.


-KingTomato
#22651 06/05/03 02:09 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
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
  }
}

#22652 06/05/03 05:44 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
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!

Last edited by CloCkWeRX; 06/05/03 05:45 AM.
#22653 06/05/03 03:34 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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?


-KingTomato
#22654 06/05/03 03:39 PM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Read the last three lines of the post. laugh

#22655 06/05/03 03:44 PM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Goodcall Nimue... Sry, i just woke up crazy


-KingTomato

Link Copied to Clipboard