Simple Away (/afk & /return)

By Cazz on Jul 21, 2009

This script is as simple as it gets.

/afk
/return

It will show how long you were gone and the reason for your absence when you return.

This does NOT work on all networks as I don't know how to do that. If the reviewer or someone else could tell, that'd be great.

Any other suggestions are welcome!

alias afk {
  if (%away) echo You are already away!
  else {
    set %away $iif($1,$1-,AFK)
    set %awaytimer $ctime
    away $iif($1,$1-,AFK)
    scid -a /amsg I am now away. Reason: %away
  }
}

alias return {
  if (!%away) echo You are not away!
  else {
  scid -a /amsg I have returned from being away. I was away for $duration($calc($ctime - %awaytimer)) $+ . I was gone for: %away
    unset %away*  
  }
}

Comments

Sign in to comment.
Aucun50   -  Jul 22, 2009

Something like this:

/scid -a amsg test

 Respond  
Cazz   -  Jul 22, 2009

Thanks to both of you, I'm amazed how simple the newer one is lol.

Anyone know how to do an /amsg on all networks?

 Respond  
Grant-   -  Jul 22, 2009
alias afk {
  if (%away) echo You are already away!
  else {
    set %away $iif($1,$1-,AFK)
    set %awaytimer $ctime
    away $iif($1,$1-,AFK)
    amsg I am now away. Reason: %away
  }
}

alias return {
  if (!%away) echo You are not away!
  else {
  amsg I have returned from being away. I was away for $duration($calc($ctime - %awaytimer)) $+ . I was gone for: %away
    unset %away*  
  }
}
 Respond  
Aucun50   -  Jul 22, 2009

No need for the timers, if you add away (reason) in there you can use $duration($awaytime) to get weeks, hours, minutes and seconds.

For the inc var you could have done inc -c %var to increase it one per seconds then $duration(%var) for the weeks, hours, minutes and seconds outcome.

For your %away var if you set a "away (reason)" when you go away then you can use if ($away == $true) { }

 Respond  
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.