addining item Id to bag item tooltip?

Talk about anything in Runes of Magic. This does not need to pertain to botting.
Post Reply
Message
Author
User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

addining item Id to bag item tooltip?

#1 Post by lolita » Tue Jun 25, 2013 6:54 pm

this is a part from Item preview addon that adding item id to item link tooltip

Code: Select all

function ItemPreview:ItemButton_OnEnter(button)
    if button.label:GetText() == "" then return end
    
    GameTooltip:SetOwner(button, "ANCHOR_BOTTOMRIGHT")
    GameTooltip:SetHyperLink(button.label:GetText())
    GameTooltip1:Hide()
    GameTooltip2:Hide()

    if not button.itemID then return end
    local item = self.itemList[button.itemID]
    
    if self.settings.ShowZone then
        local convertFn = function(zoneID)
            return GetZoneLocalName(zoneID)
        end
        local data = self:GetItemFieldString(item, "zones", convertFn)
        if data then
            GameTooltip:AddLine(" ")
            GameTooltip:AddLine("Seen in: " .. data)
        end
    end
    
    if self.settings.ShowMobs then
        local data = self:GetItemFieldString(item, "mobs")
        if data then
            GameTooltip:AddLine(" ")
            GameTooltip:AddLine("Dropped by: " .. data)
        end
    end
    
    GameTooltip:AddLine(" ")
    if self.settings.ShowUpdateTime then
        local date = item.date or self.itemList.originalRefreshDate
        if date then
            GameTooltip:AddLine("Updated on " .. date)
        end
    end
    GameTooltip:AddLine("Item ID: " .. button.itemID)
end
this is from Inventory viewer addon, part wich adding extra info to bag item tooltip

Code: Select all

function IV_AppendTooltipData( tooltip, itemLinkOrName )

    --IV_Log( "IV_AppendTooltipData( " ..tooltip:GetName().. ", " .. itemLinkOrName .. " )" );

    if ( IVConfig_ToolTips:IsChecked() == false ) then
        return;
    end

    -- Get text we want to insert (via itemLink or exact Name)
    local text = IV_GetListOfItems3( itemLinkOrName );

    --IV_Log( "text:" .. text );

    if ( text and text ~= "" ) then

        -- Figure out the position to put the separator and set it
        local scale = GetUIScale();
        local Separator4 = getglobal( tooltip:GetName() .. "Separator4" );
        Separator4:ClearAllAnchors();
        Separator4:SetAnchor("TOP", "TOP", tooltip, 0, (tooltip:GetBottom()/scale)-(tooltip:GetTop()/scale)-(3.25/scale) );
        tooltip:AddLine("\n");

        -- Insert the text
        --IV_Log( "Appending tooltipText: " .. text );
        tooltip:AddLine( text );

        -- Set width of the separator after we've added text (which could change the size of the tooltip
        Separator4:SetWidth(tooltip:GetWidth()-20);
        Separator4:Show();
    end
end
can we make something like that (stan alone addon, or edit one of those two addons) to add item ID to bag item tooltip,
it will be much easyer then searching in item preview.
i tryed but cant get it to work :? :cry:
Life is a journey, not destination :D

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: addining item Id to bag item tooltip?

#2 Post by lisa » Tue Jun 25, 2013 7:08 pm

So you want the ID on screen in the tooltip?

I just use this userfunction to get the item info.

Code: Select all

function lisa_printinventory()
	local bags = {}
	inventory:update()
	for slot = 61, 240 do
		item = inventory.BagSlot[slot]
 	    if item.Available and  item.Name ~= "<EMPTY>" then
			table.insert(bags, {Name = item.Name, Id = item.Id, Rlevel = item.RequiredLvl, stats = item.Stats})
		end;
	end;
	table.print(bags)
end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#3 Post by rock5 » Wed Jun 26, 2013 1:22 am

I'm lucky because I use the developer version of dailinotes that has a debug version that shows all item ids in the tooltips like you are describing.

It's a good idea. I'll have a look at what I can do.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#4 Post by rock5 » Wed Jun 26, 2013 8:40 am

I've added ids to bag item tooltips and skillbook skill tooltips. I also had the brilliant idea to add them to buffs/debuffs but for some reason it wont allow me to add the id to the tooltip so I print it to chat.

I had a look at trying to add ids to target tooltips but I'm not sure I'll be able to although I haven't finished trying yet.

Is there anything else that we need ids for?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: addining item Id to bag item tooltip?

#5 Post by lolita » Wed Jun 26, 2013 11:37 am

well idk, we need:
backpack,
itemshop,
itemshop backpack,
Arcan transmutor,
house bank,
guild bank,
skill book,
player bufs/debufs,
target bufs/debufs,
target Id

that's all i can think off
Life is a journey, not destination :D

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#6 Post by rock5 » Wed Jun 26, 2013 12:35 pm

I'm not sure of the necessity of all of those but most of them will be easy to add. The hard one is the target id. There really isn't any way to get a units ids. That's probably why ItemPreview doesn't include unit ids. But I've had a brilliant idea. I found that if I use the TEXT function and iterate through all the possible name strings eg. TEXT("Sys"..id.."_name") I can collect all the ids and names in about a second. I don't know if I can make it work yet, I'm having strange errors but the idea is sound. Wish me luck.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: addining item Id to bag item tooltip?

#7 Post by lolita » Wed Jun 26, 2013 1:12 pm

well basically , backpack , skills and buff's/debuff's is all we need, but if you can get target Id that will be awesome :D

and ofcourse Good luck ;)
Life is a journey, not destination :D

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#8 Post by rock5 » Wed Jun 26, 2013 2:17 pm

What's killing me is if I slot the code into yacit addon it works. I can't see any reason why it shouldn't work in my addon. This is for target ids. It might be because it registers the 'mouseover' event but I don't understand why it needs it.

Oh well... I'm still working on it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#9 Post by rock5 » Wed Jun 26, 2013 4:06 pm

Ok, I got target ids working good. It was pbinfo that was causing trouble. Only downside to the target ids is there can be more than one id with the same name so I have to show them all. No way to tell which is the right one. If it's important you will just have to use "rom/getid". The skill tooltips are working properly now too.

I'll add some of the other easier ones tomorrow and I'd also like to see what I can do for quests. It will be tricky because it doesn't show tooltips but I'll see what I can do.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lolita
Posts: 139
Joined: Thu Oct 20, 2011 5:39 am
Location: Serbia

Re: addining item Id to bag item tooltip?

#10 Post by lolita » Thu Jun 27, 2013 12:15 am

:idea: maybe titles to add too.
thay have tooltip, and easy to get ID.
Life is a journey, not destination :D

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: addining item Id to bag item tooltip?

#11 Post by rock5 » Mon Jul 01, 2013 9:46 am

I finished the addon. Check it out.
http://solarstrike.net/phpBB3/viewtopic ... 700#p50700
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest