What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Counting items in bags/bank?

Gideonnn

New Member
Joined
Apr 7, 2012
Messages
94
Reaction score
0
I was looking through the function list but couldnt find it, is it possible to count the amount of a specific item that you have?
 
Does that also work in the guild bank? Think ill look for InBankCount() :p

Edit:
If I search for "InBagCount" or "InBagCount()" in the API Documentation Honorbuddy 2.0.chm it can't find it. Where do I find stuff like this?
 
Last edited:
Well InBagCount is actually for PB profiles. Should have mentioned that before :D

InBankCount (ItemID) - Returns the number of items the player has in personal bank that match ItemID.
InGBankCount (ItemID) - Returns the number of items the player has in guild bank that match ItemID. Requires Datastore WoW Addon. No RefreshDataStore() call is required
InGBankCount (CharacterName,ItemID) Same as above except it gives the choice to get item count on a character that isn?t currently logged in game.

(also for ProfessionBuddy only :P)
 
Ahh damn, I would like the make a plugin that does this shiz. I don't like how PB works because it always screws up for me and some friends. So this way I need to implement it into a profile so it can jump to another path or something after a certain count?
 
Ooh thats nice! So I can just use lua code to store the amount of lets say elementium ore in a c# variable? If so, how? :p

The thing is, I want to make a plugin that counts stuff from the GB, and if it needs some kind of herb/ore it jumps to a specific profile. But I just dont know where to find stuff to make it work. Right now im ripping other plugins open to check whats in there, but mostly, thats not enough.
 
Code:
public static uint GetitemCount(string ItemName)
        {
            uint ItemRunningCount = 0;
            foreach (WoWItem item in Me.BagItems)
            {
                if (item.Name == ItemName && item.StackCount < 0)
                {
                    
                        ItemRunningCount = item.StackCount;
                    
                }
            }
            return ItemRunningCount;
        }
theres a method that SHOULD work. its much better to use the api rather then pull from lua and you should try doing so when ever possible.
 
on secand thought, that will pull the STACKCOUNT for the Last stack ran though the if, but it shouldnt be hard to modify the foreach to add instead of (=)
 
Is there a place, where all those methods are written down?
Couldn't find this either, but know some lua :)
 
Okay, I would like to try some things out, seems that is the best for now. But how do i start? I would like the get some values and stuff. Can I just do MessageBox.Show(someValue.ToString()); to check the outcome?
 
CNG also had another mistake which would lead it to always returning 0.
Here you go, I made it earlier for my own convenience
Code:
        private int InBagCount(uint itemId)
        {
            long count = 0;
            foreach (var item in Me.BagItems)
            {
                if (item.ItemInfo.Id == itemId)
                {
                    count += item.StackCount;
                }
            }
            return (int)count;
        }
 
Bump!

I gave it a try with PB, but that shiz is damn hard!

So, this is what I have now:
PHP:
<?xml version="1.0" encoding="utf-8"?>
<Professionbuddy>
  <If Condition="Me.ZoneId != 1519" IgnoreCanRun="True">
    <FlyToAction Dismount="False" Location="-8370.396, 620.9188, 95.22932" />
  </If>
  <MoveToAction Location="-8311.961, 579.4633, 100.3054" MoveType="Location" Pathing="Navigator" Entry="0" />
  <MoveToAction Location="-8305.503, 575.1396, 100.3049" MoveType="NearestGB" Pathing="Navigator" Entry="0" />
  <InteractionAction InteractType="GameObject" Entry="0" InteractDelay="0" GameObjectType="GuildBank" SpellFocus="Anvil" />
  <CustomAction Code="Log(InBankCount(52186));" />
</Professionbuddy>

The last thing obviously doesnt work. Can someone help me with that?
Also, how can I fill var1-9 and read them later on?
 
Back
Top