ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Extra Characters after output to debug window (https://www.esoui.com/forums/showthread.php?t=2286)

Argusus 09/28/14 04:18 PM

Extra Characters after output to debug window
 
Hello,

i'm seeing extra chars like "^p" and "^n" or "^Mx" when I output Item links or play names via the "d()" method. i'm also see this if I stored a custom variable. is there a way to prevent this or what are these extra charactersa

Garkin 09/28/14 04:28 PM

Quote:

Originally Posted by skobyjay (Post 12388)
Hello,

i'm seeing extra chars like "^p" and "^n" or "^Mx" when I output Item links or play names via the "d()" method. i'm also see this if I stored a custom variable. is there a way to prevent this or what are these extra charactersa

Use function zo_strformat(pattern, ...). For names is usually used pattern SI_UNIT_NAME or "<<C:1>>".

Lua Code:
  1. d(zo_strformat(SI_UNIT_NAME, name))

A bit more about zo_strformat, its patterns and control characters like "^p" or "^n":
http://www.esoui.com/forums/showthread.php?t=1443

Argusus 09/28/14 04:53 PM

awesome thanks. is there an similar function for an Item LInk? I can't seem to find in the API.

Garkin 09/28/14 07:42 PM

Quote:

Originally Posted by skobyjay (Post 12390)
awesome thanks. is there an similar function for an Item LInk? I can't seem to find in the API.

Function zo_strformat works for item links the same way as for regular strings.

Example:
lua Code:
  1. local itemLink = "|H1:item:16424:1:50:0:0:0:0:0:0:0:0:0:0:0:0:7:0:0:0:0|h|h"
  2. d(zo_strformat("ItemLink: <<t:1>>", itemLink))
Prints:
ItemLink: [Racial Motifs 1: The High Elves]


All times are GMT -6. The time now is 04:51 PM.

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