Auto-AFK

By NiveusLuna on Feb 21, 2009

THIS DOESN'T WORK, DON'T USE IT. I can't figure out how to get the post deleted!

One of my online friends often forgets to change his nick when he goes to bed, so I thought I'd make this for him.
Credit for the code goes to SCAKK, though I pointed out that "timer 1 1" doesn't work very well for something that's supposed to run repeatedly.
I was thinking of making a thirty minute timer to change nicks that's reset on input, but this is more effective.
This is for you, Brink! :P

Change AWAYNICK to whatever you want your away nick to be.

on *:CONNECT:{
  idlecheck
}

alias idlecheck {
  timeridlecheck 0 30 idlechecker
}

alias idlechecker {
  var %t 1
  var %lowestidle 1800
  var %notaway 0
  while (%t <= $scon(0)) {
    if ($scon(%t).idle < %lowestidle) {
      %lowestidle = $scon(%t).idle
    }
    if ($scon(%t).me != AWAYNICK) {
      inc %notaway
    }
  inc %t
  }
  if (%lowestidle >= 1800) {
    if (%notaway > 0) {
      scon -a nick AWAYNICK
    }
  }
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.