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.