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*
}
}
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*
}
}
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) { }