mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2015
Posts: 4
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2015
Posts: 4
I was playing with whispering (using mTwitch) and learned that localized display names (japanese, chinese, korean, etc.) messed with messaging using simply $nick as returning the nick returns the display name, which isn't what I need.

Is there anyway to return the username and not the display name of the person who sent the command?

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Thats my script; you can use $msgtags(user-name).key to get the original nick

Last edited by FroggieDaFrog; 25/10/16 10:44 PM.

I am SReject
My Stuff
Joined: Jun 2015
Posts: 4
C
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2015
Posts: 4
When I use that, the bot tries to whisper to itself instead of the person who has used the command that it needs to whisper the reply back to.

Joined: Apr 2016
Posts: 86
B
Babel fish
Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I would like to reopen this topic because I've ran into the same problem, whenever using $msgtags(user-name).key would always bounce back to me?

Reason I'm using is a cheer script which whenever someone with a localized display name, instead of awarding chat currency to the user (with the localized name) it would always give me it instead. This is the original code I'm working with:

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  if ($msgtags(bits).key <= 9) { return }
  if (($msgtags(room-id).key == 62729480) && ($msgtags(bits).key)) {
    msg # !bonus $msgtags(display-name).key $msgtags(bits).key
  }
}

Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
The reason that $msgtags(user-name).key returns your name, is because that is what the key is for. It returns YOUR name, not the name of the person sending the message.

So I had my first viewer today with a localized display name. I am using SReject's amazing mTwitch scripts as well. My bot returned the users name as being blank as well.

After spending some time trying to understand how mTwitch.DisplayName.mrc worked, I have come up with a fix/work-around that seems to work 100% for now until SReject releases an official fix.

On line 24 on mTwitch.DisplayName.mrc I simply changed:
Code:
    if ($len(%dnick) && %dnick !=== %nick) {

to:
Code:
    if ((%dnick == %nick) && (%dnick !=== %nick)) {


From what I understand, mIRC was trying to change the $nick of the user as long as their display name had a length (existed) and was a non-case sensitive match to their standard twitch user name. I believe the problem was that %dnick was using the foreign language display name which was completely different from the users english user name. I think mIRC didn't know how to handle a display name like "&#32032;&#26228;&#12425;&#12375;&#12356;&#12486;&#12473;&#12488;" so it just returned nothing. I changed the script so that mIRC will only try to change the users name if the display name is a non-case sensitive match to the user name and the display name is not a case sensitive match to the user name. This way, the script doesn't even try to change the user name to a "localized display name" and will just display the lower case english name.

Come to think of it, just "if (%dnick == %nick)" would probably have worked as well. Anyways, I'm sure SReject will come up with a much "cleaner" way of fixing this, but this appears to be working for me for now. smile


Link Copied to Clipboard