Identify items that can be traded to other players in the same instance.
Hi all
I am the author of a small addon Aardvark. I am trying to find a way to identify those items in my bags that can be traded to other players in the same instance. Right now my addon sells items listed on the player curated sell list. The issue is that items that can be traded to other players in the same instance starts an addon breaking loop. When the item is to be sold it brings up the confirmation that selling will make it non-tradable. With items that have a refund cooldown I can filter them out so it will not sell until the time runs out; I test each item for a refund cooldown; Lua Code:
I would like to be able to identify and filter those items that are still on the trade cooldown. It would also be helpful to have the confirmation button could be avoided and have the item sell even though it is still on trade cooldown. Cheers |
Possibly a combination of these two functions will help you
https://wow.gamepedia.com/API_GetItemInfo https://wow.gamepedia.com/API_C_Item.IsBound ItemLocation Info https://www.townlong-yak.com/framexm...emLocation.lua |
I scan the tooltip for the BIND_TRADE_TIME_REMAINING string
Code:
local tip = CreateFrame("GameTooltip","Tooltip",nil,"GameTooltipTemplate") |
Hi all
Sorry for the delayed reply. Thanks for the links and code chunk. Here is the current code; Lua Code:
This works perfectly. What I am wondering is I also want to be able to idently those items that can be sold back to the venror for a full refund. The string I have to look for is REFUND_TIME_REMAINING yet when I try to find the string I get no matches. Is it possible to search for either or both of the strings in the same loop? |
How did you search for REFUND_TIME_REMAINING?
If you just search for REFUND_TIME_REMAINING it can't work. Becuase REFUND_TIME_REMAINING contains %s. If you use string.format %s is a placeholder where we can put the time string. But if you use REFUND_TIME_REMAINING as a argument for string.find it is now a regex string. And %s matches just one space char. That's why I used string.format(BIND_TRADE_TIME_REMAINING, ".*"). That replaces %s with .* and .* matches with any string. |
Hi Urtgard
I used the same code and added an or as follows; Lua Code:
Lua Code:
Right now I am using a combination of your tooltip scan code and getting the refund seconds as follows, Lua Code:
I just wish I could understand why scanning the tooltip works for one but not the other. |
Have you checked with print(string.find(_G["TooltipTextLeft"..i]:GetText()) that one of the lines actually contains the refund message?
Maybe REFUND_TIME_REMAINING was changed in the pre patch. |
Hi Urtgard
I did loop through the tooltip using your string, yet the translated strings were returned rather than the REFUND_TIME_REMAINING string that I need. This is really confusing yet the double down method is working correctly. Thanks for all the help. |
All times are GMT -6. The time now is 08:33 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI