mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2022
Posts: 2
P
Bowl of petunias
OP Offline
Bowl of petunias
P
Joined: Feb 2022
Posts: 2
I'm trying to retrieve the color automatically assigned to a given nick using $cnick, but some of the nicks have colors assigned to them using the 'Auto-color based on nick' option. If I use $cnick on those nicks, it just returns the default text color. Is there a way to retrieve the automatically generated nick-based code?

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
$nick( $chan , $nick ).color

Joined: Feb 2022
Posts: 2
P
Bowl of petunias
OP Offline
Bowl of petunias
P
Joined: Feb 2022
Posts: 2
Ah yeah, that works. And is shorter even. Thanks!

Joined: Jan 2012
Posts: 299
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2012
Posts: 299
Depending on which assigned numerical color code you want to know:
Code
//echo -a $cnick(NickName).color
//echo -a $nick(#chan,NickName).color

1.Assigned nickname color in "Address Book". Details here: https://en.wikichip.org/wiki/mirc/identifiers/$cnick
2.The actual color from the channel's nickname list. Details here: https://en.wikichip.org/wiki/mirc/identifiers/$nick


🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I retract my answer, and ask if anyone has a solution. I'm trying to create an echo that's a modification of the display of the ON TEXT event, and the solution only works in a channel.

The OP was correct that $cnick(nick).color is not returning the correct color number if that nick is being auto-colored to a random color. In those cases, it's instead returning:

Code
$cnick($nick,1).color returns $color(listbox text)
$cnick($nick  ).color returns $color(normal)
$cnick($nick  )       returns N for the Nth matching rule
$cnick($nick  ).auto  returns $true if the nick matches an autocolor rule (even if the nick's color is not actually coming from that auto-rule)


The $nick($chan,$nick).color is not a complete solution because $nick() won't work in a query window where the auto-nick rule is coloring the speaker, because $chan being $null in a query window makes it an invalid parameter error, and $nick($nick,1) won't work either.

Even if I share a channel with the nick, I can't steal the color from $nick($chan,$nick).color unless their color in that channel comes from the auto-color rule, instead of from some other rule.

If I use /cline to turn a nick red, $nick().color is the only one that gives me true info about the nicklist nick being red, and $cnick().auto continues telling me that their nick matches an auto-color rule, but doesn't tell me that the nick isn't actually being autocolored.


Link Copied to Clipboard