Public feed #888325

Spencer's Away Script

public text v1 · immutable
Raw Edit
·published 2008-02-02 00:37 UTC
rendered paste body
Alias away {
  var %x = 1
  var %y = $chan(0)
  if ($away == $true) {
    set %Away.Duration $duration($calc($ctime - $ctime(%Away.Ctime))) 
    while (%x <= %y) {
      if (E !isincs $chan(%x).mode || $me ireg # && m !isincs $chan(%x).mode) {
        describe $chan(%x) is now back from( $+ %Away.Reason (Left at: %Away.Time (Duration: %Away.Duration )))
      }
      inc %x
    }
    away
    unset %Away.Time
    unset %Away.Reason
    unset %Away.Ctime
    unset %Away.Duration
  }
  else {
    set %Away.Ctime $fulldate
    set %Away.Time $asctime(mmm dd) $+ , $time
    set %Away.Reason $1-
    away %Away.Reason
    while (%x <= %y) {
      if (E !isincs $chan(%x).mode || $me isreg # && m !isincs $chan(%x).mode) {
        describe $chan(%x) is now away for( $+ %Away.Reason (Time: %Away.Time ))
      }
      inc %x
    }
  }
}