View Single Post
02/11/17, 10:17 AM   #3
Klingo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 16
Originally Posted by ArtOfShred View Post
Code:
GetLastCraftingResultItemInfo(number resultIndex)
    Returns: string name, textureName icon, number stack, number sellPrice, boolean meetsUsageRequirement, number equipType, number ItemType itemType, number itemStyle, number quality, number ItemUISoundCategory soundCategory, number itemInstanceId
It's extremely useful because I can interate through resultIndex numbers to find all the items that were produced as a result of the last construct/deconstruct, but there's no way I'm aware of to generate an itemlink with any of this information provided.
If I understand you correct, you want the ItemLink of the most recent crafted item?
For that I also don't see an easy/simple way to do, but the function you mentioned returns you the ItemType as well as the name of it. So theoretically you could loop through all items in the backpack and check if the ItemType and name do match. If they do, you can get the itemLink with the below function since you know the bagId (i.e. the backpack) as well as the slotIndex (from the loop). Alternative, you might also be able to use "GetItemInstanceId(number bagId, number slotIndex) Returns: number:nilable id" and then companre the id with the one from your method.
Code:
GetItemLink(number bagId, number slotIndex, number LinkStyle linkStyle)
    Returns: string link
It's not the nicest solution, but I can't think of a better alternative, off the top of my head.

Originally Posted by ArtOfShred View Post
I also tried to look into adding the same functionality for Banking and couldn't find anything at all I thought would work, doesn't seem to be any event we can use for adding or removing items from the bank. Any chance it would be possible to add these events for bank item withdraw/deposits and expand the Guild Bank ones?
Just an idea: with the following three events, you know when the player has the bank open and when any inventory slot was updated. Witht his you could make some deductions on whether an item was deposited or withdrawn from the bank (based on the "stackCountChange"). The only problem I see here is with splitting or merging item stacks, as these would also trigger the event. Maybe you could use "GetNumBagFreeSlots(number Bag bagId) Returns: number freeSlots" to also also check whether the number of free slots in the bank changed.
Code:
EVENT_OPEN_BANK (number eventCode) 
EVENT_CLOSE_BANK (number eventCode)
EVENT_INVENTORY_SINGLE_SLOT_UPDATE (integer eventCode,number bagId, number slotId, boolean isNewItem, number itemSoundCategory, number inventoryUpdateReason, number stackCountChange)