|
Joined: Jan 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 75 |
I was just wondering if this is possible, basically i'm on 3 to 5 server most of the time, is there a way to detect after 30 mins idle on all server i go /away and message all channel i'm idle and away? When i say that i mean it like if i'm typing on 1 server and 30 minutes has passed on another server it won't go /away, it'll only go away on all servers as soon as no activity has been put into mIRC by me ie; actually away from the pc for 30 minutes or more. thanks
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
$idle always returns 0 for me for some reason, so i'll have to assume $idle returns your idle time in seconds. alias idlecheck {
scon -at1 if ($idle < 900) { return }
scon -at1 away <message> $(|,) amsg I am away $ $+ awaymsg
} Just execute that on a timer.  Btw, the reason I use $ $+ awaymsg is so that any identifiers in $awaymsg aren't evaluated. /scon double evaluates stuff like /timer does.
New username: hixxy
|
|
|
|
Joined: Jan 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 75 |
ah hmm, i see this, ok this is the problem i have
on 1:connect:{
.timerchk 0 10 idlecheck
if ($hget(away,reason) != $null) { saway away, $hget(away,reason) [Msglog $hget(away,log) $+ ] | .timeraway -c 1800 _away
}
}
alias _away {
if ($1) { scon -a amsg i've died!! " $+ $hget(away,reason) $+ " [Msglog/ $+ $hget(away,log) $+ ] }
else { scon -a amsg i'm still dead!! " $+ $hget(away,reason) $+ " $dur($calc(($ticks - $hget(away,ticks)) / 1000)) }
}
alias saway { scon -a away $1- | hsave -i away scripts/hash.ini away }
;;your code
alias idlecheck {
scon -at1 if ($idle < 1800) { return }
scon -at1 away $hget(away,reason) [Msglog $hget(away,log) $+ ] $(|,) amsg I am away $ $+ awaymsg
}
I need to make it, show on the 30 minutes idle i've died!! "idle for 30 minutes" [Msglog/on] and have that echo every 30 minutes, until i come back obviously
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
if ($hget(away,reason) != $null) { saway away, $hget(away,reason) [Msglog $hget(away,log) $+ ] | .timeraway -c [color:red]0[/color] 1800 _away Then you need to add code to wherever you come back (/away) to turn timeraway off (/timeraway off) Edit: it's better to use /scon -at1 than /scon -a because /scon -a will try to perform /amsg on disconnected servers.
New username: hixxy
|
|
|
|
Joined: Jan 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 75 |
It seems to go away even if i'm chatting on another server, it's supposed to go /away when no activity has been put into mIRC at all 
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
$idle always returns 0 for me for some reason, so i'll have to assume $idle returns your idle time in seconds. Well duh! <snicker snicker>, no actually i had the same problem for a while tell i worked out what $idle ment, its the time since something was entered in a editbox (maybe a dialog also), so if you go //echo -a $idle you get 0 as it is the aproxamite time you have been idle for since requesting your idle time, which was just now, so its zero.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
I assumed $idle would return your server idle time 
New username: hixxy
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
alias idlecheck {
var %a,%b
scon -at1 inc % $+ $(a |,0) if ($idle > 1800) inc % $+ b
if %a == %b {
; Your away stuff here
}
}
BTW: There won't be an $awaymsg until you're set away 
|
|
|
|
Joined: Jan 2005
Posts: 75
Babel fish
|
OP
Babel fish
Joined: Jan 2005
Posts: 75 |
Cheers, nice one people, got that working, i just didn't see the point in going idle one server and not the others, if i'm away, i'm proper away like the pub or something 
|
|
|
|
|