Fuzionx commented on a Page, alias awy  -  Oct 27, 2011

I improved your code a bit.

alias awy { 
  away $iif($1-, $1-, No reason specified)
  tnick $me $+ |Away
  amsg I'm Away now. Reason: $awaymsg
}

on *:text:$(* $+ $me $+ *):#: { 
  if ($away)  { 
    .notice $nick Sorry $nick but I am away. Reason: $awaymsg $+ . Leave a message if you want.
  } 
}
alias back {
  if (!$away) { echo $color(info) -a * You're not away | halt }
  amsg I am back from $awaymsg $+ . Been away for $duration($awaytime)
  away
  nick $mnick
}
  • Use of $away, $awaytime and $awaymsg instead of variables.
  • Use of tnick (temporary nick) and $mnick (main nick) for an away nickname.
  • Use of $me in the ON TEXT event so the user doesn't have to fill it in him/herself
  • Deleted the !page command since people rather message you themselves instead of using !page
  • Awaytime shown when you come back.
  • The alias bck renamed to back, makes more sense.
  • Check if you are away when the /back command is executed.

I hope this helps you. ;)

 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.