All pastes #472680 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-05 19:16 UTC
rendered paste body
on *:text:!away*:#:{
  if ($nick isop $chan) {
    set %away. [ $+ [ $nick ] ] $2-
    set %awaytm. [ $+ [ $nick ] ] $ctime
    set %awaynick. [ $+ [ $nick ] ] $nick
    amsg 4 $nick 10is now away at:4 $2- $+ 10.
  }
  else notice $nick your away :l
}
on *:text:!back:#:{
  if (%away. [ $+ [ $nick ] ] != $null) {
    amsg 4 $nick 10back from:4 %away. [ $+ [ $nick ] ] $+ 10. Time away:4 $duration($calc($ctime - $eval($+(%,awaytm.,$nick),2))) $+ 10.
    unset %away. [ $+ [ $nick ] ]
    unset %awaynick. [ $+ [ $nick ] ]
    unset %awaytm. [ $+ [ $nick ] ]
  }
  else notice $nick your not away
}
on $*:TEXT:/^(!|@)(listaway)/Si:#: { 
  var %output = $iif($left($1,1) == !,.notice $nick,.msg $chan) 
  var %i = 1,%x 
  while $var(%awaynick.*,%i) { 
    %x = $addtok(%x,$gettok($v1,2,46),44) 
    if ($numtok(%x,44) == 20) { 
      %output 10Users marked as away:4 %x
      %x = "" 
    } 
    inc %i 
  } 
  if (%x) %output 10Users marked as away:4 %x 
} 

on $*:TEXT:/^(!|@)(check) */Si:#: { 
  var %output = $iif($left($1,1) == !,.notice $nick,.msg $chan) 
  if (%away. [ $+ [ $2- ] ] != $null) {
    %output 4 $2- 10is away, reason:4 %away. [ $+ [ $2- ] ] $+ 10. Away for:4 $duration($calc($ctime - $eval($+(%,awaytm.,$nick),2))) $+ 10.
  }
  else %output 4 $2- 10is not away.
}