mIRC Home    About    Download    Register    News    Help

Print Thread
$idle #111061 12/02/05 05:13 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
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

Re: $idle #111062 12/02/05 05:40 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
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.

Code:
alias idlecheck {
  scon -at1 if ($idle < 900) { return }
  scon -at1 away <message> $(|,) amsg I am away $ $+ awaymsg
}


Just execute that on a timer. smile

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
Re: $idle #111063 12/02/05 06:07 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
Joined: Jan 2005
Posts: 75
ah hmm, i see this, ok this is the problem i have

Code:
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

Re: $idle #111064 12/02/05 06:24 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
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
Re: $idle #111065 12/02/05 07:16 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
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 crazy

Re: $idle #111066 12/02/05 07:55 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
$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.

Re: $idle #111067 12/02/05 08:22 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
I assumed $idle would return your server idle time crazy


New username: hixxy
Re: $idle #111068 14/02/05 06:46 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
alias idlecheck {
  var %a,%b
  scon -at1 inc % $+ $(a |,0) if ($idle &gt; 1800) inc % $+ b
  if %a == %b { 
    ; Your away stuff here
  }
}


BTW: There won't be an $awaymsg until you're set away grin

Re: $idle #111069 14/02/05 04:11 PM
Joined: Jan 2005
Posts: 75
Z
ztnaraM Offline OP
Babel fish
OP Offline
Babel fish
Z
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 grin