I would like to replace this code with regex if possible??
alias BA.op return $qt($mircdirsys\BA.op)
on *:start:{
if (!$isdir($mircdirsys)) mkdir $qt($mircdirsys)
if !$hget(BA) { .hmake BA 100 }
if $isfile($BA.op) { .hload BA $BA.op }
}
on *:exit:{
.hsave -o BA $BA.op
}
on *:disconnect:{
.hsave -o BA $BA.op
}
raw 301:*:{
if (%away != off) && ($nick !isop #chat) {
var %a = 1, %b = $numtok($3-,32)
while %a <= %b {
if $hget(BA,$gettok($3-,%b,32)) {
ban -ku60 #chat $2 2 14Offensive Away Msg
%a = %b
}
inc %a
}
return $regsubex($1-,/\b( $+ %away $+ )\b/gi,$str(*,$len(\t)))
}
haltdef
}
menu status {
-
Add Bad Away
.Add Bad Away : away $?= "Add bad away" | echo $asctime([HH:nn]) * 4Bad Away Added.
.-
.Remove Bad Away : away $?= "Remove bad away" | echo $asctime([HH:nn]) * 4Bad Away Removed.
.-
.View Bad Away List: .hsave -o BA $BA.op | run $BA.op
.-
.Clear Bad Away List: .hfree BA | $iif($exists(BA.op),remove BA.op)
}
alias away {
if !$1 { .notice $nick No word specified }
else { .hadd -m BA $1 $iif($hget(BA,$1),$false,$true) }
}