Hehe, I learned regex recently so I decided to try it out with something like this. The regex string isn't all mine, however, cause I had some help from the people at Quakenet (thankies!). Typo also helped me with a couple of things, so kudos to him too.
This highlight manager allows you to easily set options as to what you want to do when highlighted, and easily allows you to manage which words are activated.
Load into remotes and type /highlights
Any suggestions/errors (shouldn't be any) would be greatly appreciated.
#highlight on
on $*:TEXT:$(/\Q $replacexcs(%high.words,$chr(32),\E|\Q,\E,\E\\E\Q) \E/Six):#: {
if (%t.ip) { noop $tip(Highlight,Highlight,You have been highlighted! $crlf $+ Server: $server $crlf $+ Channel: $chan,5,,,,) }
if (%h.msg) { .msg $nick %h.msg }
}
#highlight end
dialog highlight {
title "Highlight Options"
size -1 -1 119 154
option dbu
check "Enable highlights", 1, 5 11 55 9
check "Make a tip when highlighted", 2, 15 21 85 8
check "Message the nick when highlighted:", 3, 15 32 97 8
edit "", 4, 14 44 100 10, autohs
box "Options", 5, 2 0 115 57
list 6, 6 69 107 70, hsbar vsbar size
button "Add", 7, 47 140 32 12
button "Remove", 8, 82 140 32 12
box "Words to activate on", 9, 2 59 115 94
}
on *:dialog:highlight:edit:4: { set %h.msg $did(4).text }
on *:dialog:highlight:init:0: {
if (!%high) { did -b $dname 2-9 }
if (%high) { did -c $dname 1 }
if (%t.ip) { did -c $dname 2 }
if (%h.msg) { did -c $dname 3 | did -a $dname 4 %h.msg }
tokenize 32 %high.words
var %a = 1
while (%a <= $numtok(%high.words,32)) {
did -a $dname 6 $gettok(%high.words,%a,32)
inc %a
}
}
on *:dialog:highlight:sclick:*: {
if ($did == 1) {
if ($did(1).state == 0) { unset %high | did -b $dname 2-9 | disable #highlight }
if ($did(1).state == 1) {
if (%h.msg) { did -e $dname 2-9 }
else { did -e $dname 2,3,5-9 }
set %high on
enable #highlight
}
}
if ($did == 2) {
if ($did(2).state == 0) { unset %t.ip }
if ($did(2).state == 1) { set %t.ip on }
}
if ($did == 3) {
if ($did(3).state == 0) { unset %h.msg | did -b $dname 4 }
if ($did(3).state == 1) { set %h.msg $did(4).text | did -e $dname 4 }
}
if ($did == 7) {
did -a $dname 6 $?="What word would you like to be highlighted on?"
var %a = 1
while (%a <= $did(6).lines) {
set %high.words $addtok(%high.words,$did($dname,6,%a).text,32)
inc %a
}
}
if ($did == 8) {
if (!$did(6).sel) { noop $input(You did not select anything to remove.,uwo,Error!) }
else {
unset %high.words
did -d $dname 6 $did(6).sel
var %a = 1
while (%a <= $did(6).lines) {
set %high.words $addtok(%high.words,$did($dname,6,%a).text,32)
inc %a
}
}
}
}
alias highlights { dialog $iif($dialog(highlight),-v,-m) highlight highlight }