public away script

By Aaron on Feb 18, 2007

!away reason
!back
!@check
nick
!@listaway

**credit goes to Pariah for the entire listaway section :)

on *:text:!away*:#:{
  if (%away == $null) {
    set %away. [ $+ [ $nick ] ] $2-
    set %awaytm. [ $+ [ $nick ] ] $ctime
    set %awaynick. [ $+ [ $nick ] ] $nick
    msg $chan 4 $nick 10is now away at:4 $2- $+ 10.
  }
  else notice $nick your away :l
}
on *:text:!back:#:{
  if (%away. [ $+ [ $nick ] ] != $null) {
    msg $chan 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.
}

Comments

Sign in to comment.
fitzi01   -  Mar 04, 2007

I tryed it worked great till you do listaway If people dont type !back the names stay on the list maybe a way to clear the list :) Otherwise i think its a great script mate

 Respond  
Lindrian   -  Feb 20, 2007

Sorry, messed the nicks up xP

 Respond  
Aaron   -  Feb 19, 2007

i tried doing that, but id rather use a spread out script.

and Pariah wrote listaway part, not yoinx :P

 Respond  
Korvin   -  Feb 18, 2007

you should change the check away to what i have:
on :text::#: {
if ($1- == %away.nick) {
if ($readini(away.ini,away,$nick)) notice $nick Korvin is away right now because: 4 $+ %away.msg [ $+ [ $nick ] ] $+ , try again when hes back
else { halt }
}
}
unless u dont want to, i just like that one =]

 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.