Jump to content

How to get green part info of item


libai

Recommended Posts

HearthstoneID: 6948
Binds when picked up
Unique
Use: Returns you to <Inn>. Speak to an Innkeeper in a different place to change your home location.

 

Hi,Is there any way to get where my current home is from Hearthstone?

I don't known how to get the green color part of The item(Use: Returns you to <Inn>. Speak to an Innkeeper in a different place to change your home location.)

it's nothing about green info  in itemlink

ItemLink - Wowpedia - Your wiki guide to the World of Warcraft (fandom.com)

thank you .

 

 

 

 

Link to comment
Share on other sites

local tooltip;

local function CreateToolTipFrame()
    tooltip = CreateFrame("GameTooltip", "MyTempTooltip", UIParent, "GameTooltipTemplate")
    tooltip:SetOwner(UIParent, "ANCHOR_NONE")
end

local function OnTooltipSetItemFromLink(itemLink)
    if itemLink then
        tooltip:SetHyperlink(itemLink)
        local numLines = tooltip:NumLines()
        if numLines > 0 then
            for i = 1, numLines do
                local line = _G[tooltip:GetName() .. "TextLeft" .. i]
                if line then
                    print(line:GetText())
                end
            end
        end
        tooltip:Hide()
    end
end

 

Link to comment
Share on other sites

thank you,  but is it  not work on 1.12? 

local tooltip;

local function CreateToolTipFrame()
    tooltip = CreateFrame("GameTooltip", "MyTempTooltip", UIParent, "GameTooltipTemplate")
    tooltip:SetOwner(UIParent, "ANCHOR_NONE")
end

local function OnTooltipSetItemFromLink(itemLink)
    if itemLink then
        tooltip:SetHyperlink(itemLink)
        local numLines = tooltip:NumLines()
        if numLines > 0 then
            for i = 1, numLines do
                local line = _G[tooltip:GetName() .. "TextLeft" .. i]
                if line then
                    print(line:GetText())
                end
            end
        end
        tooltip:Hide()
    end
end
-----------
local link = GetContainerItemLink(0,1) -- the hearthstone at 0,1
CreateToolTipFrame() -- create the frame
OnTooltipSetItemFromLink(link)  --then error says: [string "Areizogu.lua]:10 Unknown link type
 -- if i run it again error change to : Interface\FrameXML\MoneyFrame.lua:185: attempt to perform arithmetic on local `money'(a nil value)
On 2/27/2024 at 5:00 AM, Nax said:
local tooltip;

local function CreateToolTipFrame()
    tooltip = CreateFrame("GameTooltip", "MyTempTooltip", UIParent, "GameTooltipTemplate")
    tooltip:SetOwner(UIParent, "ANCHOR_NONE")
end

local function OnTooltipSetItemFromLink(itemLink)
    if itemLink then
        tooltip:SetHyperlink(itemLink)
        local numLines = tooltip:NumLines()
        if numLines > 0 then
            for i = 1, numLines do
                local line = _G[tooltip:GetName() .. "TextLeft" .. i]
                if line then
                    print(line:GetText())
                end
            end
        end
        tooltip:Hide()
    end
end

 

 

Link to comment
Share on other sites

local tooltip

local function CreateToolTipFrame()
    tooltip = CreateFrame("GameTooltip", "MyTempTooltip", UIParent, "GameTooltipTemplate")
    tooltip:SetOwner(UIParent, "ANCHOR_NONE")
end

local function OnTooltipSetItemFromLink(itemLink)
    if itemLink then
        CreateToolTipFrame() -- Ensure tooltip is created
        tooltip:SetHyperlink(itemLink)
        local numLines = tooltip:NumLines()
        if numLines > 0 then
            for i = 1, numLines do
                local line = getglobal(tooltip:GetName() .. "TextLeft" .. i)
                if line then
                    DEFAULT_CHAT_FRAME:AddMessage(line:GetText())
                end
            end
        end
        tooltip:Hide()
    end
end

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...