Simple Away Script
Posted by snang
Saturday, March 06, 2004
Description: Just a simple away script I coded to help a guy out.


; Very simple away script by snang
; I love boobs.
; Usage: /afk <reason>
afk {
  ; Checking to see if the %away.status variable exists.  If it doesn't, we're setting it here.
  if (!%away.status) { set %away.status 0 }

  ; Checking the status to see if we're currently here (0), or away (1)
  ; If we're here (0), we process these commands.  If we're away (1) we goto the next if statement below.
  if (%away.status == 0) {

    ; If we're here, we're going to set us away.
    set %away.status 1

    ; We then set a variable containing the time we set ourselves away.
    set %away.time $ctime

    ; Checking to see if anything was typed after /afk and setting it to a variable.
    ; If not, we use the default reason of "AFK"
    if ($1) { set %away.reason $1- }
    else { set %away.reason AFK }

    ; Display the away message, reason, and time in all the channels using /ame
    ame -away- : reason: %away.reason : time: $asctime(hh:nnTT)

    ; Setting this variable to remember our original nick
    set %away.nick $me

    ; Change our nickname to show we're AFK
    nick $me $+ -afk

    ; Stop the script, we're done.
    halt
  }

  ; Checking the status to see if we're currently here (0), or away (1)
  if (%away.status == 1) {

    ; If we're away, we're going to set us back.
    set %away.status 0

    ; Display the away message, reason, and time gone in all the channels using /ame
    ame -back- : reason: %away.reason : gone: $duration($calc($ctime - %away.time))

    ; Change our nickname back to the original.
    nick %away.nick

    ; Stop the script, we're done.
    halt
  }
}
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world