Copy and paste into remotes, This is for irc.torn.com bots.
away/brb/bbiab/bbl/afk/bbs/breb [reason optional]
back/bk unsets away
;---- Away Script by Defenestration 271320, Thanks to Izzy, Onions, and Cloney for helping.
on *:TEXT:*:#: {
if ($regex($1,/(^b(rb|biab|bl|bs|reb)|away|afk)($|,$|.$|!$)/i)) {
if (!$2) {
write -s $+ $read(ids.txt,s,$nick) away.txt $read(ids.txt,s,$nick) $ctime $1
.msg $chan See you later $nick
}
else {
write -s $+ $read(ids.txt,s,$nick) away.txt $read(ids.txt,s,$nick) $ctime $2-
.msg $chan See you later $nick $+ , Enjoy $2-
}
}
if ($regex($1,(^back$)|(^back[\.\, ]))) || ($1 == bk) {
if (!$read(away.txt, s, $read(ids.txt,s,$nick))) {
.msg $chan You're back?? I didn't notice you even left $nick $+ ...
}
else {
.msg $chan Welcome back $nick - you were away for $duration($calc($ctime - $gettok($read(away.txt,s,$read(ids.txt,s,$nick)),1,32)))
write -ds $+ $read(ids.txt,s,$nick) away.txt
}
}
var %a = $numtok($1-,32), %b = 1
while (%b <= %a) {
if ($read(away.txt,s,$read(ids.txt,s,$gettok($1-,%b,32)))) {
.msg $chan $gettok($1-,%b,32) has been away $duration($calc($ctime - $gettok($read(away.txt,s,$read(ids.txt,s,$gettok($1-,%b,32))),1,32))) - Reason: $gettok($read(away.txt,s,$read(ids.txt,s,$gettok($1-,%b,32))),2-,32)
}
inc %b
}
}