AutoAwayIDv1

By extio on Sep 16, 2011

Auto Away script that attempts to identify you when you change back to your name (automatically) , and set name correct when you join a room with an away name (automatically).

interesting features are you can change the away time till it sets you away on the fly, and change passwords easily. it will only activate automatically if you join a chat with the name you last used /as [time] with successfully.

not tested on multiple servers, but works fine on one. just dont use the optional password if you share the computer.

; Auto away and identify combo script, version 1.00  author, benjamin.
; In the alias ID you can replace enterpasswordhere with your password to be auto identified on return with.
; use is "/afk [reason]" or "/as [time] [password]" where time is the amount of time till it sets you away. and password is optional.
; any other suggestions?  extio msn com (or comment online)

Alias id {
  if (%password == $null) {
    ; ************** change the following to set a password hardcoded.  you *MUST* remove the semicolon in front!!!! ********
    ; msg nickserv identify enterpasswordhere
  }
  if (%password != $null) {
    msg nickserv identify %password
  }
}

Alias checkAway {
  if (($idle > %amountIdleMinutes) && ($away == $false)) {
    nick %nickVarAS $+ %Away
    away I am away after %amountIdleMinutes minutes.
  }
}

Alias AS {

  if ($1 == $null) || ($1 == help) {
    echo -a AwayScript Help Dislay.
    echo -a To use away script, the first time you use it you should use
    echo -a "/as [time] [password]" where password is optional.
    echo -a where the time is in minutes for the script to set to away
    echo -a and the password is your id password.  you will not need to
    echo -a set the password again unless you use the command "/as clear"
    echo -a to turn off awayscript temporarily, use "/as off", or clear to unset all.
    echo -a to set away immediatly, use "/afk [reason]"
    echo -a if you want your identity password to stick without using a variable
    echo -a edit the .ini file accordingly.  this script will then auto id you.
    echo -a if anyone else has access to the computer, make sure to clear
    echo -a variables with "/as clear" before getting off, or dont use the ID feature
  }

  if ($1 == clear) {
    unset %password
    unset %nickVarAS
    unset %amountIdleMinutes
    timerchkaway off
    echo -a AwayScript: Password, nick variable, and timer cleared.
  }

  if ($1 == off) {
    timerchkaway off
  }

  ;  *************** change the last word of the following line ( default |Away ) to whatever you want it to add on your name when you are set to away.  ************

  set %Away |Away

  if ($2 != $null) {
    set %password $2
  }

  if ($1 isnum) {
    set %amountIdleMinutes $calc(60*$1)
    set %nickVarAS $me
    timerChkAway 0 10 checkAway
  }
}

Alias afk {
  set %nickVarAS $me
  if ($1 != $null) {
    away afk: $1
  }
  else {
    away reason not given
  }
  nick %nickVarAS $+ %Away
}

on *:INPUT:#:{
  if (($nick == %nickVarAS $+ %Away) && ($away == $true)) {
    away
    nick %nickVarAS
  }
}

on *:text:*:?:{
  if ($away == $true) {
    msg $nick Sorry but I'm away for $idle seconds now, your message has been logged.
  }
}

on *:NOTICE:*:?:{
  if ($away == $true) {
    notice $nick Sorry but I'm away for $idle seconds now, your message has been logged.
  }
}

on *:NICK:{
  if ($nick == $me) {
    if ($newnick == %nickVarAS) { 
      id
    }
  }
}

on *:JOIN:#:{
  if (($nick == $me) && ($nick == %nickVarAS $+ %Away)) {
    nick %nickVarAS
  }
}

on 1:CONNECT:{
  if ($nick == %nickVarAS) {
    id
    as $calc(%amountIdleMinutes / 60)
  }
}

Comments

Sign in to comment.
jaytea   -  Sep 17, 2011
This snippet is not muti-server capable without the use of /scon command. Lastly, I'll use $awaytime rather than $idle.

that's not relevant. he just needs to use network specific timer/variable names.

 Respond  
extio   -  Sep 16, 2011

the only thing i like about the variable, is when you connect, if the variable matches your nick, it means the script has been run in the past, and then it loads again unless you cleared it last time. also it checks a lot of stuff based on the variable set as the current nick to see if it should be messing with your nickname, in case it wasnt what changed it lol. but the $awaytime thing is great to know ill see if i can put it to use.

i dont understand /scon enough to try for that, so i guess the script will be a single connection script for the time being.

 Respond  
Jethro   -  Sep 16, 2011

There is a /tnick command you can use, which saves you the trouble of setting a temporary nickname as a variable.> /tnick
Changes your nickname to a temporary nickname, without affecting your main or alternate nicknames.This snippet is not muti-server capable without the use of /scon command. Lastly, I'll use $awaytime rather than $idle. You can then calculate how long you've been away once back using:

$duration($awaytime)
 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.