ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   color code at the end of player id (https://www.esoui.com/forums/showthread.php?t=6254)

cyxui 04/24/16 10:05 PM

color code at the end of player id
 
I have noticed that on some people's machine player id would have some color code string + some number at the end. specifically the seller field returned by GetTradingHouseSearchResultItemInfo function.

For example @exampleid|c000000;1;14 99|r

I wonder what is causing that?? is it from addon or ZOS? If it is from ZOS is there a function to remove the post fix? if it is from an addon is there a way I can get the original player ID?

Thanks.

Baertram 04/25/16 01:40 AM

To get the original player id just strip everything starting at "|". The shouldn't be a | in a player name if I'm correct.
You can use the lua string functions, especially

Lua Code:
  1. local startDelimiter = string.find(s, '|')

To find the "|" delimiter.

And then substring to get the string from the start until the found "|" character.
Assuming the total string including the color codes is in a variable called "accountName":
Lua Code:
  1. local accountName = string.sub(accountName ,  startDelimiter)

Maybe you need to male startDelimiter = startDelimiter -1 to strip the "|" character itsself. i'm not sure if the string.find function will give you the value before or including the "|"

sirinsidiator 04/25/16 05:32 AM

This is the result of one of the many bad practices used in Master Merchant. It would be better if this information was put into its own field on the data table of the entry instead of being attached to an existing field.

cyxui 04/25/16 07:05 PM

Quote:

Originally Posted by sirinsidiator (Post 26794)
This is the result of one of the many bad practices used in Master Merchant. It would be better if this information was put into its own field on the data table of the entry instead of being attached to an existing field.

I see. thanks!


All times are GMT -6. The time now is 09:33 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI