BRB Tracker

By UncleJohn on Oct 13, 2009

I have redone this script a bit since I first uplaoded it, the timer was having issues, and forgot to include the highlight coding. This script was done with the help of GrimReaper using his away script,and parts of others. I encourage feed back, let me know what you think. Thank you.

If you modify this script be very careful! Its rather fragile as I have come to find out.lol

NOTE: Monitor timers, not sure if the timers will clear correclty, they should. But I have yet to test the new timer arrangement. The %away unsets fine thou, so thats good news. I was getting stuck variables with the $+ $nick, due to the way it was set up the variables were being set as %awaynickhere, and not %away NICKHERE. Small but big difference. I also found out that my highlight WAS based on the variable, and that trying to do it based on the .ini file is the thing I was having issues with. But long as the variable and timer clear, im sure the read.ini file is of lil concern. If you DO know how to have a way of checking that in chat, let me know. IE: !checknick NICK, and have it return result based on read.ini status instead of %away.

Thanks again for the input.

on $*:TEXT:/^(brb|gone|afk)/Si:#:{
  if (!$readini(idle.ini, $nick, time)) {
    set %away $nick
    writeini idle.ini $nick time $ctime
    msg $chan Alright, ill start my stop watch..
      }
  elseif ($readini(idle.ini, $nick, time) >= 1) {
    msg $chan $nick $+ ,you are already marked as brb, Please say "back" when you return!
  }
}

on *:text:back:#:{
  if ($readini(idle.ini, $nick, time) >= 1) {
    unset %away
    msg $chan Welcome back $nick you were gone for $duration($calc($ctime -$readini(idle.ini, $nick, time) )) $+ , what took you so long?
    remini idle.ini $nick
  }
}
on *:TEXT:!ClearAway *:#:{
  if (!$2) { msg $chan Please specify a nick!
  }
  else { 
    unset %away
    remini idle.ini $2
    msg $chan $2 $+ 's brb time has been cleared.
  }
}
On *:TEXT:*:#: {
if (%away isin $1-) {
    msg $chan Sorry $nick but there marked as brb at this time, they will say back when they return.
  }
}

Comments

Sign in to comment.
dma   -  Jan 17, 2016

still working in 2016

 Respond  
turbuiance   -  Dec 05, 2011

how to make this so it triggers if someone writes something like " ok i'll brb going out" .. it doesnt seem to trigger then.. i know the * usually does it but i don't know what i'm doing with regex

Anyone?>?

 Respond  
Jethro   -  Jun 25, 2010

Xpl0reR, why so many text and action events? You can combine them using an alias so you don't repeat them unnecessarily. Also the %away isin $1- won't serve any purpose when someone calls your name when you are away. It simply won't work whatsoever. This is the improved, modified version of the code:

on $*:text:/^(brb|gone|afk)\b/Si:#:awaycheck $1-
on $*:action:/^(brb|gone|afk)\b/Si:#:awaycheck $1-
alias -l awaycheck {
  if (!$readini(idle.ini, $nick, time)) {
    set %away. $+ $nick $1-
    hadd -m awaynick $+(*,$nick,*) $true
    writeini idle.ini $nick time $ctime
    msg # (BRB): $nick is now Away: $1-
  }
}
on *:text:*:#:awaycheck2 $1-
on *:action:*:#:awaycheck2 $1-
alias -l awaycheck2 {
  if ($hfind(awaynick,$1-,1,W)) { 
    msg # Sorry $nick $+ , but the user $remove($v1,*) is not available to respond to you at this time!
  }
  elseif ($readini(idle.ini, $nick, time) >= 1) {
    msg # (BRB): $nick is now Back, you were gone for $&
      $duration($calc($ctime -$readini(idle.ini, $nick, time) )) :: $($+(%,away.,$nick),2)
    unset %away. $+ $nick | hdel awaynick $+(*,$nick,*) | remini idle.ini $nick
  }
}
brb in a moment Xpl0reR is now Away: brb in a moment is Xpl0reR here? Sorry Jethro, but the user Xpl0reR is not available to respond to you at this time!The whole modified script is much smaller in bytes compared to yours.
 Respond  
xplo   -  Jun 25, 2010

i just did this for simple fun, and this is what i did with your snippet for my bot:
i removed the clearaway, and i added the ACTION event, because sometimes people will /me brb and then just type HELLO when they are back, so.. as soon someone talks, and it was afk the script sees them as "back". and i saved their "brb" reason

[11:59:35] * @xplo brb in a moment
[11:59:35] <@Ubot[02]> (BRB): xplo is now Away: brb in a moment
[11:59:39] <@xplo> Hello!
[11:59:40] <@Ubot[02]> (BRB): xplo is now Back, you were gone for 4secs :: brb in a moment

on $*:TEXT:/^(brb|gone|afk)/Si:#:{
  if (!$readini(idle.ini, $nick, time)) {
    set %away. $+ $nick $1-
    writeini idle.ini $nick time $ctime
    msg $chan (BRB): $nick is now Away: $1-
  }
}

on *:text:*:#:{
  if ($readini(idle.ini, $nick, time) >= 1) {
    msg $chan (BRB): $nick is now Back, you were gone for $duration($calc($ctime -$readini(idle.ini, $nick, time) )) :: $($+(%,away.,$nick),2)
    unset %away. $+ $nick
    remini idle.ini $nick
  }
}
On *:TEXT:*:#: {
  if (%away isin $1-) { msg $chan Sorry $nick but there marked as brb at this time, they will say back when they return. }
}

on $*:action:/^(brb|gone|afk)/Si:#:{
  if (!$readini(idle.ini, $nick, time)) {
    set %away. $+ $nick $1-
    writeini idle.ini $nick time $ctime
    msg $chan (BRB): $nick is now Away: $1-
  }
}

on *:action:*:#:{
  if ($readini(idle.ini, $nick, time) >= 1) {
    msg $chan (BRB): $nick is now Back, you were gone for $duration($calc($ctime -$readini(idle.ini, $nick, time) )) :: $($+(%,away.,$nick),2)
    unset %away. $+ $nick
    remini idle.ini $nick
  }
}
On *:action:*:#: {
  if (%away isin $1-) { msg $chan Sorry $nick but there marked as brb at this time, they will say back when they return. }
}

Your base code is nice, it gave me an idea, and i liked it.
+like
8/10

 Respond  
Haksu   -  Jan 31, 2010

how can set reason on it?

 Respond  
UncleJohn   -  Oct 16, 2009

Hmm well thanks for the feedback from those using the script

UPDATE: I had to remove the timed clear, apparently the timer was not clearing when the remini command was used, so it would fill the server with outstanding timers. There for this function has been removed.

 Respond  
Zerg   -  Oct 15, 2009

thanks, and it wasn't meant for highlight.

 Respond  
UncleJohn   -  Oct 14, 2009

Zerg I tried that, but then the highlight wouldnt work, and that was one the features I wanted for my channel. Its very easy to modify to work with multiple users, but doing so makes it rather hard to get it to allow you to do highlights by %away due to $+ $nick sets it so the away is set as %awayuser, instead of %away user, I guess one could do $nick without the $+ I might try that soon. Love your snippet btw!

 Respond  
Zerg   -  Oct 13, 2009

I had the same idea When i Scripted Terran on SwiftIRC. IF you would like to see a related code that works for more than one person,
http://www.hawkee.com/snippet/6811/

 Respond  
DragonHeart   -  Oct 13, 2009

Great script. Finally got it working in my channel.

 Respond  
Jethro   -  Oct 13, 2009

ohhh I see.

One more thing I'd like to add is that you can incorporate your back and !clearaway command into the regex match and then use the

if ($regeml(1) == back) {

and

if ($regml(1) == !clearaway)

to trigger the second and last on text event:

on $*:TEXT:/^(b(rb|ack)|gone|afk|[!]clearaway)/Si:#: {

This way you only use one text event instead of three, excluding the one for %away.

 Respond  
UncleJohn   -  Oct 13, 2009

Jethro_ exactly it will work if some one types brb gone to the bathroom..etc As designed.

However you didnt mention that with $+ $Nick that if (%away isin $1-) wont work for highlighting, so I have removed the $+ +nick and returned to the older version which seems far more stable.

Your point is duely noted and thank you, but that was on purpose. :)

 Respond  
Jethro   -  Oct 13, 2009

Your regex needs to be added with a $ at the end. The current one you have will get triggered if any letter or words are attached after afk, brb, and gone.> on $*:TEXT:/^(afk|brb|gone)$/Si:#: { This will match exactly for afk, brb, and gone.

 Respond  
UncleJohn   -  Oct 13, 2009

LOL Thanks GrimReaper, well you helped more then you know. I used parts of many of your scripts to figure out how to get it to act a certain way here and there..hehe

 Respond  
GrimReaper   -  Oct 13, 2009

Good work on the script UncleJohn.

i'm not just saying that as i helped.. i'm saying it. because i was AFK for half the time of making it.. lol

 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.