mIRC Home    About    Download    Register    News    Help

Print Thread
Page 3 of 3 1 2 3
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
may be i misspoke i wanted to say like this
Code:
on *:input:*:{
  if $away {
    away
    ;if used /tnick NickAw
    nick $anick
    ame back
  }
}


WorldDMT
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Here's How I did it -shrugg-

Code:
alias away.system.auto {
  scon -a if (%away.system.auto == on && $idle >= %away.system.auto.check) inc %away.system.check.idle
  var %x = $scon(%x)
  while (%x) {
    scon %x if ($away) && (%away.system.check.idle != $scon(0)) { away $chr(124) echo -a unset }
    scon %x if (!$away) && (%away.system.check.idle == $scon(0)) { away Auto away after $duration(%away.system.auto.check,2) of idle $chr(124) echo -a unset }
    dec %x
  }
  unset %away.system.check.idle
}



I am SReject
My Stuff
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Ok, the first post I did was basically an away check across all networks and what not but didn't account for you being disconnected. This one accounts for that, and has the events to start/stop the checks

Code:
on *:INPUT:#,?:{ away.system.auto }
on *:CONNECT:{ if (!$timer(.Auto.Away) { .timer -oi .Auto.Away 0 1 away.system.auto } }

alias away.system.auto {
  var %x = $scon(0)
  while ($scon(%x)) {
    if ($scon(%x).status == Connected) { inc %Away.Connection.Check }
    dec %x
  }
  if (!%Away.Connection.Check) { 
    .timer.Auto.Away off 
  }
  else {
    if (!$timer(.Auto.Away)) { .timer -oi .Auto.Away 0 1 away.system.auto }
    scon -a if ($status == Connected && %away.system.auto == on && $idle >= %away.system.auto.check) inc %away.system.check.idle
    var %x = $scon(%x)
    while (%x) {
      scon %x if ($status == Connected) && ($away) && (%away.system.check.idle != %Away.Connection.Check) { away $chr(124) echo -a unset }
      scon %x if ($status == Connected) && (!$away) && (%away.system.check.idle == %Away.Connection.Check) { away Auto away after $duration(%away.system.auto.check,2) of idle $chr(124) echo -a unset }
      dec %x
    }
  }
  unset %Away.Connection.Check
  unset %away.system.check.idle
}


I am SReject
My Stuff
Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
so every on input that will execute the alias? too bad!


WorldDMT
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Yes on any input to channel or query it will activate. Considering most ppl don't have more than 3-5 active connections the loops shouldn't be an issue

but, I see you're point:
Code:
on *:INPUT:#,?:{
  scon -a if ($status == connected && $away) { away }
}

Last edited by FroggieDaFrog; 19/04/10 12:50 PM.

I am SReject
My Stuff
Joined: Feb 2011
Posts: 1
J
Mostly harmless
Offline
Mostly harmless
J
Joined: Feb 2011
Posts: 1
Where i set auto away time in this script?

Page 3 of 3 1 2 3

Link Copied to Clipboard