Afk Snippet

By Jamiie on Jul 05, 2008

This is a simple afk script.

Type /afk to go away.
Type /bk to come back.

Also logs highlights while afk.

alias afk {
  if (!%away.check) {
    set %away.check on
    set %away.reason $1-
    set %away.tme $ctime
    set %away.time 0
    set %away.msg.total 0
    inc -c %away.time
    scid -a away $1-
    scid -a amsg 7[14::7AmSg14::7] 14I am now 7[7AFK:14 %away.reason 7]
  }
  else {
    echo -a You are already away!

  }
}
alias bk {
  if (%away.check == on) {
    unset %away.check
    if (%away.reason) {
      scid -a amsg 14I am no longer 7[7AFK:14 %away.reason 7]14 after 7[14 $duration(%away.time) 7]
      if (%away.msg.total == 0) { echo -a There are $chr(2) $+ 0 $+ $chr(2) messages recorded in your away box. }
      else {
        echo -a There are $chr(2) $+ %away.msg.total $+ $chr(2) messages recorded in your away box.
        var %away.x = 1
        while (%away.x <= %away.msg.total) {
          echo -a Message $chr(2) $+ %away.x $+ $chr(2) from $chr(2) $+ $gettok($($+(%,away.msg.,%away.x),2),2,32) $+ $chr(2) in $chr(2) $+ $gettok($($+(%,away.msg.,%away.x),2),1,32) $+ $chr(2) $+ : $gettok($($+(%,away.msg.,%away.x),2),3-,32)
          inc %away.x
        }
        echo -a End of messages.
      }
      unset %away.*
      away
    }
  }
  else {
    echo -a You are not away!
  }
}

on *:TEXT:*:#: {
  if ($me isin $1-) || ($anick isin $1-) || ($mnick isin $1-) {
    if (%away.reason) {
      notice $nick I am away ( $+ %away.reason $+ ). I left $duration($calc($ctime - %away.tme)) ago. This message will be saved for when I come back.
      inc %away.msg.total
      set $+(%,away.msg.,%away.msg.total) $chan $nick $1-
    }
  }
}

Comments

Sign in to comment.
Jamiie   -  Sep 16, 2008

Yeah Eugenio I edited it on mIRC just haven't had time to update it on here, will do so now.

And thanks Abtehi, even though I know this isn't the best. :)

 Respond  
Eugenio   -  Aug 20, 2008

Make it so that if your already set away it tells you .....and the same for if you are not away and you do /bk an error comes up or it echos .....or something ;x

@Abtehi: well we can tell your still new around here =/

 Respond  
Abtehi   -  Aug 20, 2008

10/10 rated best afk snippet :)

 Respond  
napa182   -  Jul 05, 2008

look into useing $awaytime and $awaymsg and on ur highlite try checking if you are $away

 Respond  
Jamiie   -  Jul 05, 2008

Exactly Eugenio lol.

 Respond  
Eugenio   -  Jul 05, 2008

Hawkee should let you choose if you want your scripts rated......or maybe you have to approve certain comments before they are put on your profile/snippets.
Also you should have the option that the person cant rate unless you have approved their comment.

 Respond  
Jamiie   -  Jul 05, 2008

Would be nice to get some feedback instead of rating without a comment >_<

 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.