December 14, 20187 yr Can you make wrobot distinct between ammo-bag-slots and actual real bag slots. Setting a point on when to do a vendor run because of full bags with a hunter is horrible. But as hunter is probably the best farmer class this is a huge problem for everyone running a hunter.
December 14, 20187 yr Try this plugin, I made it ages ago for a friend, i think it does what you're after, you just have to give it the correct bag slot id, id 1 is the first bag next to your backpack, then its 2, 3, 4. AmmoV2.cs edit: if it works for you let me know and I'll post it for other people, i thought there was another plugin or something that covers this but can't find anything atm. Edited December 14, 20187 yr by Marsbar
December 15, 20187 yr @Marsbar you can do this completely automatically: Lua.LuaDoString(@" if GetItemInfoFromItemLink ~= nil then return end function GetItemInfoFromItemLink(link) local itemId = nil; if ( type(link) == 'string' ) then _,_, itemId = string.find(link, 'item:(%d+):'); if (itemId) then local version, build, date = GetBuildInfo(); if (tonumber(build) > 5875) then local itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(itemId); return itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemTexture; else return GetItemInfo(itemId); end end end end "); uint quiverSlotCount = Lua.LuaDoString<uint>(@" for slot = 20,23 do local link = GetInventoryItemLink('player', slot); if link then then local itemName, itemLink, itemQuality, itemLevel, itemType, itemSubType, itemCount, itemTexture = GetItemInfoFromItemLink(link); if itemType == 'Quiver' then return GetContainerNumSlots(slot - 19); -- gets back slot end end end "); Works at least vanilla => WotLK. So you can turn that into a free plugina nd post it here :)
December 21, 20187 yr Author @marsbar the plugin throws an error upon closing the settings window. But it works nevertheless. Thank you ❤️
February 13, 20197 yr On 12/15/2018 at 9:10 AM, Matenia said: @Marsbar you can do this completely automatically: Works at least vanilla => WotLK. So you can turn that into a free plugina nd post it here ? couldn't actually get this to work so using this instead: return Lua.LuaDoString<int>(@" for slot = 20,23 do local link = GetInventoryItemLink('player', slot); if link then local _, _, _, _, _, itemType = GetItemInfo(link); if itemType == 'Quiver' then return slot - 19; -- gets back slot end end end "); Edited February 13, 20197 yr by Marsbar
February 14, 20197 yr I'll try to resolve this problem in bot, can you confirm than list of bags is complete here? https://www.wowhead.com/icon=133581/inv-misc-ammo-bullet-01#used-by-item:0+14-2 (items type Bag)?
February 14, 20197 yr 7 minutes ago, Droidz said: I'll try to resolve this problem in bot, can you confirm than list of bags is complete here? https://www.wowhead.com/icon=133581/inv-misc-ammo-bullet-01#used-by-item:0+14-2 (items type Bag)? https://wotlk.evowow.com/?items=11 all types of hunter quiver/ammobags. These were removed cata onwards so it's only needed for WOTLK, TBC and Vanilla
February 14, 20197 yr 20 minutes ago, Droidz said: I'll try to resolve this problem in bot, can you confirm than list of bags is complete here? https://www.wowhead.com/icon=133581/inv-misc-ammo-bullet-01#used-by-item:0+14-2 (items type Bag)? Also can you let me know once you've resolved it? Then I can get rid of https://wrobot.eu/files/file/1766-free-ammo/
February 14, 20197 yr wManager.Wow.Helpers.Bag.GetContainerNumFreeSlotsNormalType return good result for me in Wotlk and Tbc
February 14, 20197 yr And code look like: var QuiverAmmoBagsId = new List<int> { 29143, 29144, 29118, 18714, 44447, 44448, 34105, 34106, 34099, 34100, 19319, 19320, 2662, 2663, 8217, 8218, 7371, 7372, 3604, 3605, 3573, 3574, 11362, 11363, 5439, 5441, 7278, 7279, 2101, 2102, }; var freeSlots = 0; var bags = wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWContainer(); foreach (var b in bags) { if (b.IsValid && QuiverAmmoBagsId.Contains(b.Entry) && b.Owner == wManager.Wow.ObjectManager.ObjectManager.Me.Guid && (b.ContainedIn == 0 || b.ContainedIn == wManager.Wow.ObjectManager.ObjectManager.Me.Guid) && !string.IsNullOrWhiteSpace(b.Name)) { freeSlots += Lua.LuaDoString<int>($@" local freeSlots = 0; for bagID = 1, 4 do if GetBagName(bagID) ~= nil and GetBagName(bagID) == '{b.Name.Replace("'", "\'")}' then for s=1,GetContainerNumSlots(bagID) do local i = GetContainerItemInfo(bagID,s); if not i then freeSlots = freeSlots + 1 end end end end return freeSlots;"); } }
Create an account or sign in to comment