mIRC Homepage
Posted By: Chinshy nickname highlight - 20/11/11 06:42 PM
wanna ask that to make when i call any nickname on the chat

it appears between () and the nick be with color yellow

ty
Posted By: Thrull Re: nickname highlight - 21/11/11 07:14 AM
Meh, see below. blush
Posted By: Wims Re: nickname highlight - 21/11/11 09:38 AM
Code:
on *:INPUT:#: {
  if (!$istok(/ $readini(mirc.ini,text,commandchar),$left($1,1),32)) && (!$ctrlenter) {
    msg $chan $regsubex($1-,/(\S+)/g,$iif(\1 ison $chan,$+($chr(3),08,( $+ \1),$chr(3)),\1))
    haltdef
  }
}
Posted By: Chinshy Re: nickname highlight - 21/11/11 04:04 PM
im so thankful for you smile
Posted By: Chinshy Re: nickname highlight - 21/11/11 04:07 PM
sry another thing what if i wanna write with a font red and still have the same thing for highlight yellow nicknames between ()
Posted By: Wims Re: nickname highlight - 21/11/11 05:06 PM
Code:
on *:INPUT:#: {
  if (!$istok(/ $readini(mirc.ini,text,commandchar),$left($1,1),32)) && (!$ctrlenter) {
    var %hlnick $regsubex($1-,/(\S+)/g,$iif(\1 ison $chan,$+($chr(3),08,( $+ \1),$chr(3)),\1))
    msg $chan $+($chr(3),04,%hlnick)
    haltdef
  }
}
The same way we assumed that you were using 8 for yellow, I assume you're using 4 for red.
Posted By: Chinshy Re: nickname highlight - 21/11/11 10:52 PM
thanks again smile
Posted By: Chinshy Re: nickname highlight - 21/11/11 11:20 PM
okay i have an issue now

thats the commands start with ! doesnt work

i have to type /say !flags as a exmaple

any idea how it can be fixed
Posted By: Wims Re: nickname highlight - 21/11/11 11:39 PM
It is expected, you want to write in red so the 'red color' must be put before the text, here before the '!'.
In your case, a bot is probably looking for a '!' as the first character in your first word but can't handle the color.
To prevent the color from being added you can use control+enter instead of enter itself, you could also ask the person who is managing the bot to handle colors in general.
I spotted a little bug in the code anyway, use this one:
Code:
on *:INPUT:#: {
  if (!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) && (!$ctrlenter) {
    msg $chan $+($chr(3),04,$regsubex($1-,/(\S+)/g,$iif(\1 ison $chan,$+($chr(3),08,( $+ \1),$chr(3)),\1)))
    haltdef
  }
}
Posted By: Firstmate Re: nickname highlight - 23/11/11 07:19 PM
You can also modify Wims' script to account for things like bot commands, like so:

Code:
on *:INPUT:#: {
  if (!$istok(/ ! $readini($mircini,text,commandchar),$left($1,1),32)) && (!$ctrlenter) {
    msg $chan $+($chr(3),04,$regsubex($1-,/(\S+)/g,$iif(\1 ison $chan,$+($chr(3),08,( $+ \1),$chr(3)),\1)))
    haltdef
  }
}
Posted By: Chinshy Re: nickname highlight - 23/11/11 11:12 PM
i think there is something wrong also on Wims addon

only the first part get red but after i call the nick it goes black
Posted By: Wims Re: nickname highlight - 24/11/11 09:29 AM
Right, use this:
Code:
on *:INPUT:#: {
  if (!$istok(/ ! $readini($mircini,text,commandchar),$left($1,1),32)) && (!$ctrlenter) {
    msg $chan $+($chr(3),04,$regsubex($1-,/(\S+)/g,$iif(\1 ison $chan,$+($chr(3),08,( $+ \1),$chr(3),04),\1)))
    haltdef
  }
}
Posted By: Chinshy Re: nickname highlight - 24/11/11 10:31 AM
okay seems this one is working .. thanks
Posted By: arc123 Re: nickname highlight - 19/12/11 01:41 PM
i got some issue on it it doesnt work on pnplus

it give me nothing blank sentence
Posted By: Riamus2 Re: nickname highlight - 19/12/11 11:39 PM
You would have to disable or remove any theming that your current script(s) use or else merge this into what you already have. Themes very often do not simply work together if they weren't designed to do so.
© mIRC Discussion Forums