auto away message v2.0

By Master-Of-Death on Aug 17, 2009

type /gone to turn on script
type /here to turn off script

enjoy simple and effective.

alias gone {
  set %away 1
  set %time $ctime
  set %reason $1-
  set %nick $me
  /nick $me $+ `afk
  /ame 9Has gone afk Reason: $1-
  /away $1-
}
alias here {
  set %away 2
  /nick %nick
  /ame 9Is Back left: $duration($calc($ctime - %time )) Reason: %reason
  /away 
}
on *:TEXT:*:#:{ if (%away = 1) && ($me isin $1-) { 
    set -u10 %h 1
    .msg # 9is currently away Reason: %reason Time: $duration($calc($ctime - %time ))
  }
  elseif (%away = 1) && (%nick isin $1-) { 
    .msg # 9is currently away Reason: %reason Time: $duration($calc($ctime - %time ))
  }
  elseif (%h !== $null) {
    halt
  }
}

Comments

Sign in to comment.
Master-Of-Death   -  Aug 18, 2009

ooo ty Jethro_

 Respond  
Jethro   -  Aug 18, 2009

/tnick changes your nickname to a temporary nickname, without affecting your main or alternate nicknames.

 Respond  
Master-Of-Death   -  Aug 18, 2009

what's /tnick ??

 Respond  
Jethro   -  Aug 17, 2009

Nice, gooshie. It literally crossed my mind about the use of /tnick command.

 Respond  
gooshie   -  Aug 17, 2009
alias gone {
  if ($right($me,4) != `afk) { tnick $me $+ `afk }
  ame has gone afk Reason: $$1-
  away $1-
}
alias here {
  if ($away) {
    if ($right($me,4) == `afk) { tnick $left($me,-4) }
    ame is back after: $duration($awaytime) Reason: $awaymsg
    away
  }
}
on *:TEXT:*:#:{
  if (($me isin $1-) || ($mnick isin $1-)) && ($away) && (!%floodnot) { 
    inc -u9 %floodnot
    describe # is currently away Reason: $awaymsg Time: $duration($awaytime)
  }
}
 Respond  
Jethro   -  Aug 17, 2009

Master-Of-Death, did you test your script's flood protection? By the look of it, you'll still get flooded. The reason being that the %h variable is set every time when your name is called, and your second elseif statement is redundant. If I were you, my approach would be:

on *:TEXT:*:#:{ if (%h) { halt }
  elseif ($me isin $1-) && (%away = 1) {
    inc -u10 %h
    .msg # 9is currently away Reason: %reason Time: $duration($calc($ctime - %time ))
  }
}
 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.