mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2006
Posts: 5
A
anoxia Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Sep 2006
Posts: 5
Hi,

I decided to make a script that would check if a person is AFK på checking the idletime, and then sending me a /notice with a /beep 4, if it retuns a certain value.

So far I've got:
Code:
raw 317:*: {
  if ($3 < 600) {
    echo -a $2 is not AFK (less than 10 min idle time)
  }
}

This works great when I make a /whois $nick $nick on somebody, I see their idle time, and if they have an idle time less than 600 seconds, I see the "is not AFK" message in my active window, great.

Here is my problem. My mIRC scripting knowledge is very limited, so I am not sure how I can make command that checks this idletime, and sends me a notice. I'd like you guys to help me with that.
I came up with the following:
Code:
alias idlecheck {
  timer 0 10 whois $$1 $$1
  if ($3 <= 600) {
    notice $me user isn't AFK | beep 4
  }
}



My idea is to put this into a nicklist popup and then have options to start the timer, stop it etc.
An awesome idea would be to include the /gtalk command, but I can't seem to get that thing to work at the moment...

Joined: Aug 2007
Posts: 41
P
Ameglian cow
Offline
Ameglian cow
P
Joined: Aug 2007
Posts: 41
Hello

I am not very good at scripting but i was just looking why couldn't you make something along the lines of on /who $nick it would whois them and as well Idle time does not always say if they are afk sometimes they might just be doing other things

Thanks
Panic


CrazyMan IRC Bot Admin
IRC UnGoWa Support
NeoBlab Server-Admin
Chat Operator
Joined: Sep 2006
Posts: 5
A
anoxia Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Sep 2006
Posts: 5
Hi,

The idea is to get a notice when someone is back from not being active, this way I will be notified through four beeps, that a person I have been, well, watching, is back.

This is useful for keeping track of my writers and other people on IRC, so I can make sure they get their work done :-)


The on: only applies if they write some text on a channel where I'm at, where this script will check regulary if they are active or not on the entire network.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Well on the IRC server I am the idle time is in mins secs etc...

The alternative is to use $duration(token) to reverse it into seconds

Im not sure if this is what you want but I wrote it via menu nicklist

Code:
menu nicklist {
  .IdleCheck 
  ..Start:set %rep.a $?="How many seconds to check?:" | timerxc 0 10 whois $$1 $$1
  ..Stop:.timerxc off
}

raw 317:*: {
  if ($3 < %rep.a) {
    notice $2 is not AFK | beep 4  
  }
}


When you right click someone there will menu a menu called IdleCheck then in that menu is Start, soon you press start it ask for the amount of time you want to check for then sets a var.

The reason why I named the timer is to halt it because of you execute /timer without naming it it will create a random timer which cannot be halted unless A) you know the Nth value or B) You use /timers off.

So now if $3 in the raw check is not in seconds only rather then mins seconds etc... you will have to do something like $duration($3-4) to convert it.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Any network that I've connected to shows away time in hours:minutes:seconds format, but when checking the actual return using a debug window, it's actually returned in seconds only. The network automatically converts it to the format you see.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I see


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 51
T
Babel fish
Offline
Babel fish
T
Joined: Oct 2007
Posts: 51
It is returned in seconds, and mIRC converts it to that specific format, RusselB, not the network.


Link Copied to Clipboard