mIRC Homepage

$nick($chan, $nick).color

Posted By: Thels

$nick($chan, $nick).color - 26/08/10 07:06 PM

Hi,

Is there a way to check if a nickname should have a channel color, other than comparing it to "$color(listbox text)"?

Or is it impossible to differentiate between no color and the listbox text color?
Posted By: starbucks_mafia

Re: $nick($chan, $nick).color - 26/08/10 10:17 PM

You can use $cnick(nick) to tell if a nickname has a colour rule applied to it. It will return 0 if there is no colour rule for that nick.

See /help $cnick for the details.
Posted By: Thels

Re: $nick($chan, $nick).color - 26/08/10 10:20 PM

Yes, but that affects the nick specifically, regardless of channel, and does not include nicknames that receive a color due to a channel rank or idle time.

I'm using !$cnick for private messages. Just wondering if there was such an option for channel messages.

Thanks for the help, though.
Posted By: starbucks_mafia

Re: $nick($chan, $nick).color - 26/08/10 10:26 PM

$cnick() will account for any mode signs included with the nick given, so you can use $cnick($nick(#, nickname).pnick) to get the rank applied.

I must admit I don't know any simple way to apply the idle time to that though. The non-simple way being to loop through $cnick(n).idle [where n is a number in the range 1 - $cnick(0)] and compare it with $nick(#, nickname).idle divided by 60 ($nick().idle is in seconds, $cnick().idle is in minutes).
Posted By: Thels

Re: $nick($chan, $nick).color - 26/08/10 10:41 PM

Originally Posted By: starbucks_mafia
$cnick() will account for any mode signs included with the nick given, so you can use $cnick($nick(#, nickname).pnick) to get the rank applied.


Hmm, nice trick about the .pnick. Didn't know $cnick would pick that up. Your method is a tad more complex than what I want to script for this occasion. Quite possible, yes, but a little bloated, since after it also needs to be compared to the $cnick entry.

Thanks for the help, but I think I'll just stick to != $color(listbox text) and allow the occasional nickname that's identical to the listbox color to slip through.
© 2022 mIRC Discussion Forums