mIRC Home    About    Download    Register    News    Help

Print Thread
#90763 17/07/04 12:42 AM
Joined: Jul 2004
Posts: 8
J
john510 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jul 2004
Posts: 8
Is there anything I can do that will highlight or color certian words. Right now I seen the highlight area in the options but that highlights the entire message or username. Im looking for something that will highlight CERTIAN words.

Thanks

#90764 17/07/04 09:23 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Code:
on *:TEXT:*:[color:orange]#channelname1,#chan2[/color]: {
  var %res = $strip($1-,mo)
  if ($regsub(%res,/\w([color:purple]word1[/color]|[color:purple]badword[/color]|[color:purple]hate you[/color])\w/ig[color:red]S[/color],[color:red]04[/color]\1,%res)) {
    echo -i2ltbfc Normal $chan %res
    haltdef
  }
}

Put the above code in your Remotes section (alt-R tab remote)

The purple text are the words you want to hilight; preferrably complete words, you could put sentences in but don't use special characters like .,?+*^$|. Also don't put spaces around them or it will not work.

You can replace the orange channels with just a # for all channels, with a list of channels separated by commas or with a ? for queries or a * for both all queries and channels.

If you choose to keep the red S all control codes will be stripped out of messages with bad words in them, so people won't get away with putting a ctrl-k halfway in those words. Messagew without matching words are not changed.

The color 04 is red.

Hope this helps.

#90765 17/07/04 02:22 PM
Joined: Jul 2004
Posts: 8
J
john510 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jul 2004
Posts: 8
I must be doing something wrong, I can t get it to work..

#90766 17/07/04 08:11 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
on ^*:TEXT:*:#: {
var %res = $strip($1-,mo)
if ($regsub(%res,/\b(word1|badword|hate you)\b/igS,04\1,%res)) {
echo -i2ltbfc Normal $chan $+(<,$nick,>) %res
haltdef
}
}

oops sorry blush blush I made some errors in the script, try it now...
You'll have to change word1, badword and hate you by the words you actually want to hilight. Make sure they are separated by | and there are no spaces around it.
Like above, it whould work in all #channels, but you can replace the # by your own channel or channels.

If it still doesn't work:

Open your remotes with Alt-R then create a new remotes file and paste the above in it. Make sure it looks like above, so it must be on 7 lines, not just one very long one. Also make sure your remote scripts are on by typing /remote on in a status window.

Also note that you cannot test this yourself. Either ask someone to type those words or open a new connection to your server (/server -m or new mIRC).

#90767 19/07/04 12:09 AM
Joined: Jul 2004
Posts: 8
J
john510 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
J
Joined: Jul 2004
Posts: 8
Nope that failed also... Sorry


Link Copied to Clipboard