Originally Posted by CrazyDutchGuy
You can refactor all your old links to the new link style quite easily
Lua Code:
"|H2DC50E:item:30166:1:13:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|hwater hyacinth|h"
Just replace color H2DC50E with H1 (brackets) or H0 (no brackets) and (optionally) remove the text between |h tags
Lua Code:
"|H1:item:30166:1:13:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0|h|h"
|
Thanks, have been trying that but doesn't seem to work. I currently have this block running to see if that theory panned out but nada, the reworked link is still reported as broken.
Lua Code:
local linkData = { ZO_LinkHandler_ParseLink(itemLink) }
if account == "" then
CHAT_SYSTEM:AddMessage(string.format("Valid: Converting Account:%s Name:%s ID:%s Link:%s ",tostring(account),tostring(itemIndex),tostring(itemID),tostring(itemData["Link"])))
else
CHAT_SYSTEM:AddMessage(string.format("Before: Converting Account:%s Name:%s ID:%s",tostring(account),tostring(itemIndex),tostring(itemID)))
local newLink = "|H"
newLink = newLink..linkData[2]
for i = 3, 23 do
newLink = newLink..":"..linkData[i]
end
newLink = newLink.."|h|h"
CHAT_SYSTEM:AddMessage(string.format("After: Converting Account:%s Name:%s ID:%s Link:%s ",tostring(account),tostring(itemIndex),tostring(itemID),tostring(newLink)))
end
edit: D'oh .. must have been re-using the color value which, although was printing out as 0 must still be using it as the original color value. Changed it to |H1 and then the for loop and all is well.
edit2: Thanks for the tip with H0 and H1 for the different types.. Decided to change the H0 ones to H1 as well. A Much better display for links rofl.
Lua Code:
if linkData[2] ~= "0" and linkData[2] ~= "1" then
local newLink = "|H1"
for i = 3, 23 do
newLink = newLink..":"..linkData[i]
end
newLink = newLink.."|h|h"
itemLink = newLink
elseif linkData[2] == "0" then
local newLink = "|H1"
for i = 3, 23 do
newLink = newLink..":"..linkData[i]
end
newLink = newLink.."|h|h"
itemLink = newLink
end