Away Script (For Bots)

By Roy911 on Jan 15, 2007

Bot Away Script V4.5.0 by Roy911

This is a script from my very own bot, RoyServ, Except the fact that I have taken out the dynamic prefix function. Therefore, besides editing the current prefix, (&), notify me before making any changes.

Usage:

This Script MUST be on a bot mIRC. I recommend you stick this into a .mrc file of it's own.

Type &away [Reason here] to change to being away.
Type anything afterwards to change to a back normal status.

/*
Bot Away Script V4.5.0 by Roy911
irc.abxy.org:#Roy911

This is a script from my very own bot, RoyServ, Except the fact that I have taken out the dynamic prefix function. Therefore, besides editing the current prefix, (&), notify me before making any changes.

Usage:

This Script MUST be on a bot mIRC. I recommend you stick this into a .mrc file of it's own.

Type &away [Reason here] to change to being away.
Type anything afterwards to change to a back normal status.
*/
on *:TEXT:*:#: {
  var %1 = $strip($1)
  var %2 = $strip($2)
  var %3 = $strip($3)
  if (%away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason) {
    var %time = $chr(45) $+ Gone for $duration($calc($ctime - %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time),3)
    var %dash = $chr(45)
    amsg $nick is 3Back from $qt([ %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason ]) %time [ $+ [ %dash ] ]
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time
  }
  if ($strip($1) == &Away) {
    var %reason = Away
    if ($2) { var %reason = $2- }
    set -e %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason %reason
    set -e %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time $ctime
    amsg $nick is 4Away. $chr(40) $+ %reason $+ $chr(41)
  }
  halt
  :error
  msg $chan $error
}

on *:NICK: {
  if (%away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason) { 
    set -e %away. [ $+ [ $network ] $+ ] . [ $+ [ $newnick ] $+ ] .reason [ %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason ]
    set -e %away. [ $+ [ $network ] $+ ] . [ $+ [ $newnick ] $+ ] .time [ %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time ]
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time
  }
}

on *:QUIT: {
  if (%away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason) { 
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time
  }
}

on *:PART: {
  if ((%away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason) && ($comchan($nick,0) == 0)) { 
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .reason
    unset %away. [ $+ [ $network ] $+ ] . [ $+ [ $nick ] $+ ] .time
  }
}

Comments

Sign in to comment.
Bouncer   -  Feb 22, 2007

It would be better to have it work on text brb, bbs, bbl, and bbiab so all users can partake of the away system and then when they type something into the channel it messages saying the person has returned.

 Respond  
Roy911   -  Jan 15, 2007

Okay, so I\'m not sure why there\'s two of this, so I would appreciate it if someone would delete the duplicate.

 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.