mIRC Homepage
I'd like to highlight a single word - 'new' - in green and another single word - 'done' - in blue.

It seems the built in highlight function only permits a whole line/string to be highlighted.

Is there a way to highlight a single word - ideally in a specific channel, not across all channels?
Not with the Highlight feature, but you could do it with an on ^text script.
/help halting default text
/help on text
PLEASE explain ur answer is all greek to a newb like me ty.
You can use somthing like this. (Untested)
Code:
on ^*:text:*:#: {
 if (word iswmcs $1-) { haltdef | echo -mt This is a new text. }
 elseif (word2 iswmcs $1-) { haltdef | echo -mt This is a new text. }
}

You can look at the commands by type in mirc:

/help halting default text
/help on text
O.K. Feast your eyes on some more greek smile
Code:
on $&^*:text:/\b(new|done)\b/Si:*:{
  var %a = $regsubex($1-,/\b(new)\b/gi,3\t)
  var %a = $regsubex(%a,/\b(done)\b/gi,4\t)
  echo -mirctbfl normal $iif(#,#,$nick) $+(<,$nick,>) %a
  haltdef
}


This line checks for the words "new" or "done" in a message.
on $&^*:text:/\b(new|done)\b/Si:*:{

Replace all instances of "new" with (coloured) "new"
var %a = $regsubex($1-,/\b(new)\b/gi,3\t)

Replace the word(s) "done" with "done"
var %a = $regsubex(%a,/\b(done)\b/gi,12\t)

Display the line
echo -mirctbfl normal $iif(#,#,$nick) $+(<,$nick,>) %a

Halt the default output
haltdef

The end of the script
}
Hi there,

I just found this script after searching for a script to highlight only single words in mIRC.

I am not sure if anyone follows this thread any longer, but I have two questions.

1: Is it possible to adjust the script to match for the proper capitalization of the word aswell, so it only matches New ?

2: I tried to add a word followed by colon, like New: but the script would not work. Is there a way to make the script do this ?

Thanks in advance
Code:
on $&^*:text:/\b(New|Done)\x3A\b/S:*:{
  var %a = $regsubex($1-,/\b(New):\b/g,3\t)
  var %a = $regsubex(%a,/\b(Done):\b/g,4\t)
  echo -mirctbfl normal $iif(#,#,$nick) $+(<,$nick,>) %a
  haltdef
}


Remove the "i" modifier to force case sensitivity, ":" is meaningful in event headers, so escape it as \x3A
I removed the i-modifier, and case sensitivity works now, thanks.

Although, the changes involving colon does not work. I just copy/pasted your code and New: and Done: are not colored.
I see, it was the word boundaries. You can try either of these, the former will color the colon and the latter will not.

Code:
on $&^*:text:/\b(New|Done)\x3A/S:*:{
  var %a = $regsubex($1-,/\b(New:)/g,3\t)
  var %a = $regsubex(%a,/\b(Done:)/g,4\t)
  echo -mirctbfl normal $iif(#,#,$nick) $+(<,$nick,>) %a
  haltdef
}


Code:
on $&^*:text:/\b(New|Done)\x3A/S:*:{
  var %a = $regsubex($1-,/\b(New)(?=:)/g,3\t)
  var %a = $regsubex(%a,/\b(Done)(?=:)/g,4\t)
  echo -mirctbfl normal $iif(#,#,$nick) $+(<,$nick,>) %a
  haltdef
}
Works like a charm, thank you so much (=
© mIRC Discussion Forums