Away System v1.2

By sk68 on Jun 23, 2009

Just a simple away system for anyone without. I had a little trouble debugging this one because of interfering scripts so if anyone has any problems I will try to fix them.

Commands:
/setupaway <default away message(will be used when you dont supply an away reason)>
/afk [reason] (set yourself as away)
/back ("unaway" yourself, you can also type a message to unset away)

Features:
nick change on away
logging of PMs, notices, and highlights while your away
some other stuff I cant think of right now

Updates:
v1.1
Notices and PMs sent from you(for whatever reason) will not be logged
Log is echo\'ed to a separate window instead of written to a txt file
Your status/active window wont get flooded with the automatic outgoing notices
%defaultnick setting cleaned up(facepalm on my part for not doing it like this to begin with)
Timestamps are better looking
v1.2
Setup done though popup menu
Away and Back can be set through alias or popup menu

/*
<:>:<:>:<:>:<:>:<:>:<:>:<:>
AWAY SYSTEM<:>:<:>:<:>:<:>:
BY SK68<:>:<:>:<:>:<:>:<:>:
<:>:<:>:<:>:<:>:<:>:<:>:<:>

Syntax:
/afk [reason]
/back
type a message to set back also
*/
#sk68away off
on *:TEXT:*:#: { if ($findtok($1-,%defaultnick,1,32) || $findtok($1-,$me,1,32)) { 
    .notice $nick Your message has been logged, I will get back to you when I return
    if (!@awaylog) {
      window @AwayLog
      titlebar @awaylog While you were out...
    }
    echo @awaylog $+($chr(3),4( $time ),$chr(15)) $nick said your name in $chan $+ : $1-
  }
}
on *:TEXT:*:?: { privmsg $nick your message has been logged, I will get back to you when I return
  if (!@awaylog) { 
    window @AwayLog
    titlebar @awaylog While you were out...
  }
  echo @awaylog $+($chr(3),4( $time ),$chr(15)) $nick sent you a PM: $1-
  close -m $nick
}

on *:NOTICE:*:*: {
  .notice $nick your message has been logged, I will get back to you when I return
  if (!@awaylog) { 
    window @AwayLog
    titlebar @awaylog While you were out...
  }
  echo @awaylog $+($chr(3),4( $time ),$chr(15)) $nick sent you a notice: $1-
}

on *:INPUT:*: { if ($away) {
    /back
  }
}
#sk68away end
menu channel,menubar { 
  Away System
  .Setup
  ..First Time Setup: { set %awaynick $$?="Away Nick:"
    set %defaultaway $$?="Default Away Message"
  }
  ..Set Away Nick: set %awaynick $$?="New Away Nick:"
  ..Set Away Message: set %defaultaway $$?="New Default Away Message:"
  .Set Away: /afk
  .Set Away...: /afk $$?="Away Reason"
  .Set Back: /back
}
alias afk { if (!$away) { 
    if (!$1) { 
      set %defaultnick $me
      /ame is away: %defaultaway
      away %defaultaway
      nick %awaynick
      .enable #sk68away
    }
    else { 
      set %defaultnick $me
      /ame is away: $1-
      away $1-
      nick %awaynick
      .enable #sk68away
    }
  }
  else { 
    echo -a You are already away
  }
}
alias back { if ($away) {
    away
    /ame is back
    nick %defaultnick
    .disable #sk68away
  }
  else { 
    echo -a You arent away
  }
}
on *:LOAD: { echo -a Please use the first time setup under Away System > Setup
  echo -a System will not function otherwise
}

Comments

Sign in to comment.
sk68   -  Aug 03, 2009

I changed it a while ago, or I thought I did o 0

 Respond  
Kirbeh_Pr0nz   -  Aug 02, 2009

Apparently x3

 Respond  
sk68   -  Aug 01, 2009

wtf, I changed it 0.0

 Respond  
Kirbeh_Pr0nz   -  Jul 31, 2009

A month later, still misspelled >.>

 Respond  
sk68   -  Jun 30, 2009

lol...heh...oops =p

 Respond  
Kirbeh_Pr0nz   -  Jun 30, 2009

u misspelled "function"
2nd to last line.
i dont really use /away that often but the coding looks neat and just by looking at it, it really organizes the /away feature.
6/10 =]

 Respond  
sk68   -  Jun 29, 2009

oops, it cut out the control codes, fyi: there is suppose to be [Ctrl+K]4( $time )[Ctrl+O]

 Respond  
WorldDMT   -  Jun 24, 2009

ok but u didnt change the isin that is wrong i told u why!!

must be like this

on *:text:*:#:{
  if ($findtok($1-,%defaultnick,1,32)) || ($findtok($1-,$me,1,32)) {
    notice $nick Your message has been logged, I will get back to you when I return
    write awaylog.txt $time -- $nick said your name: $1-
  }
}
 Respond  
sk68   -  Jun 24, 2009

I know I dont need the '/' but its my personal preference for aliases, as for the rest, Ill get to work

 Respond  
WorldDMT   -  Jun 24, 2009

very bad idea to use "isin" here

look my nick is bamboo an some one call an other nick "bam"

u'll reply!!! not good u have to youse $findtok better

if ($away == $true) u can type only if ($away) and if ($away == $false) = if (!$away)

finaly u can remove "/" before commands

 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.