View Single Post
07/13/14, 03:55 PM   #28
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
Originally Posted by CrazyDutchGuy View Post
You can refactor all your old links to the new link style quite easily

Lua Code:
  1. "|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:
  1. "|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:
  1. local linkData = { ZO_LinkHandler_ParseLink(itemLink) }
  2.     if account == "" then
  3.         CHAT_SYSTEM:AddMessage(string.format("Valid: Converting Account:%s Name:%s ID:%s Link:%s ",tostring(account),tostring(itemIndex),tostring(itemID),tostring(itemData["Link"])))
  4.     else
  5.         CHAT_SYSTEM:AddMessage(string.format("Before: Converting Account:%s Name:%s ID:%s",tostring(account),tostring(itemIndex),tostring(itemID)))
  6.         local newLink = "|H"   
  7.         newLink = newLink..linkData[2] 
  8.         for i = 3, 23 do           
  9.             newLink = newLink..":"..linkData[i]
  10.         end
  11.         newLink = newLink.."|h|h"
  12.         CHAT_SYSTEM:AddMessage(string.format("After: Converting Account:%s Name:%s ID:%s Link:%s ",tostring(account),tostring(itemIndex),tostring(itemID),tostring(newLink)))
  13.     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:
  1. if linkData[2] ~= "0" and linkData[2] ~= "1" then
  2.         local newLink = "|H1"  
  3.         for i = 3, 23 do           
  4.             newLink = newLink..":"..linkData[i]
  5.         end
  6.         newLink = newLink.."|h|h"
  7.         itemLink = newLink     
  8.     elseif linkData[2] == "0" then
  9.         local newLink = "|H1"  
  10.         for i = 3, 23 do           
  11.             newLink = newLink..":"..linkData[i]
  12.         end
  13.         newLink = newLink.."|h|h"
  14.         itemLink = newLink     
  15.     end

Last edited by Xrystal : 07/13/14 at 04:34 PM.
  Reply With Quote