Multi User Away/Back script for Bots

By Zaff on Mar 10, 2009

Sort of pointless and annoying but I've been bored and couldnt think of anything to add to my bot so here it is.

when you type

Gone
BBl
G2g
Brb
Afk

The bot makes you away

Then when you type 'Back' The bot removes you from the away list

Others can see if your idle and how long youve been idle.

!idle nick - notice
@idle nick - msg #

Simple Script and highly annoying 8-)

on $*:TEXT:/^(brb|gone|afk|bbl)/Si:#:{
  if (!$readini(idle.ini, $nick, time)) {
    if ($chan == #AlertScript) && ($me == AlertBot) {
      writeini idle.ini $nick time $ctime
      msg $chan 2 $nick is now away. Time left2 $time
    }
    elseif ($chan != #AlertScript) {
      %x 2 $+ $nick is now away. Time left2 $time
      writeini idle.ini $nick time $ctime
      msg $chan 2 $nick is now away. Time left2 $time
    }
  }
}
on *:text:back:#:{
  if ($readini(idle.ini, $nick, time) >= 1) {
    var %x $iif($left($1,1) == @,msg #,notice $nick)
    if ($chan == #AlertScript) && ($me == AlertBot) {
      msg $chan 2 $+ $nick has returned, Time gone2 $duration($calc($ctime -$readini(idle.ini, $nick, time) ))
      remini idle.ini $nick
    }
    elseif ($chan != #AlertScript) {
      msg $chan 2 $+ $nick has returned, Time gone2 $duration($calc($ctime -$readini(idle.ini, $nick, time) ))
      remini idle.ini $nick
    }
  }
}

on $*:TEXT:/^[!@](idle)/Si:#:{
  var %x $iif($left($1,1) == @,msg #,notice $nick)
  if ($chan == #Alertscript) && ($me == AlertBot) {
    if ($readini(idle.ini, $2, time) > 1) {
      %x 2 $+ $2 has been away for2 $duration($calc($ctime - $readini(idle.ini, $2, time) ))
    }
    else {
      %x 2 $+ $2 Is not idle.
    }
  }
  elseif ($chan != #AlertScript) {
    if ($readini(idle.ini, $2, time) > 1) {
      %x 2 $+ $2 has been away for2 $duration($calc($ctime - $readini(idle.ini, $2, time) ))
    }
    else {
      %x 2 $+ $2 Is not idle.
    }
  }
}

Comments

Sign in to comment.
PuNkTuReD   -  Mar 11, 2009

ignore me, im not thinking straight

 Respond  
Zaff   -  Mar 11, 2009

I havnt tried $Regex yet but ill look into it

 Respond  
Jethro   -  Mar 10, 2009

You can use if ($regex($1-,...or elseif $regex($1-,... to make multiple on text events into one.

 Respond  
PuNkTuReD   -  Mar 10, 2009

it doesnt always make it faster

 Respond  
Aucun50   -  Mar 10, 2009

ini files wear down your hard drive var don't it's just better to use them, putting them all in one one text makes it faster and neater to read.

 Respond  
Zaff   -  Mar 10, 2009

I dont like Variables I like to use ini files. And I dont like keeping the all in one on text event. Sorry.

 Respond  
Aucun50   -  Mar 10, 2009

No need for more then one on text event, also you could just use vars for this not ini files.

 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.