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

Selling specific items when Vendor Window is open

arczi19

New Member
Joined
Mar 2, 2010
Messages
156
Reaction score
5
Hello
I'm trying to make a simple plugin to sell specific items (Lifegiving Seeds) whenever vendor windows is being open.

Here's what I've got so far:

Code:
public void Sell()
{
  foreach (WoWItem seeds in StyxWoW.Me.BagItems)
            {
                if (seeds.Name.Contains("Lifegiving Seed"))
                {
          
                Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.SellItem(seeds);


}
    }
}

It doesnt work however. Any ideas? :)
Cheers
 
You could also make a PB profile that will sell lifegiving seed when you have more than for example 100. I know it doesn't do exactly what you're asking, but it solves that one issue.
 
You can just tell it to sell seeds. Seeds contains all of the items in your bag... You would have to specify which items. It wouldn't know how to handle selling "seeds" because it contains the whole bag list.
 
Hmm, I would really rather have 1 plugin that would just sell them for me :(
 
No I mean specify what you want it to sell. In this case "lifegiving seed".
Test it out.
 
You could also do this with the wow addon karnicrap. It loots and destroys what you don't want. I use it a lot when skinning.

Sent from my X10i using Tapatalk
 
Yea but HB is way more awesomer! Plugins ftw.
 
No I mean specify what you want it to sell. In this case "lifegiving seed".
Test it out.

That doesnt work either. It throw me an error:

Compiler errors:
File: GB2Fix.cs Line: 43 Error: The best overloaded method match for 'Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.SellItem(Styx.WoWInternals.WoWObjects.WoWItem)' has some invalid arguments
File: GB2Fix.cs Line: 43 Error: Argument '1': cannot convert from 'string' to 'Styx.WoWInternals.WoWObjects.WoWItem'

What I've got now is:

Code:
    while(Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.IsVisible)
    {
    Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.SellItem(63122);
    }

And I'm unable to figure it out why doesnt it compile :(
 
That doesnt work either. It throw me an error:

Compiler errors:
File: GB2Fix.cs Line: 43 Error: The best overloaded method match for 'Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.SellItem(Styx.WoWInternals.WoWObjects.WoWItem)' has some invalid arguments
File: GB2Fix.cs Line: 43 Error: Argument '1': cannot convert from 'string' to 'Styx.WoWInternals.WoWObjects.WoWItem'

What I've got now is:

Code:
    while(Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.IsVisible)
    {
    Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.SellItem(63122);
    }

And I'm unable to figure it out why doesnt it compile :(

Did you try putting in Lifegiving Seed, or "Lifegiving Seed"

Code:
while(Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.IsVisible)
    {
    Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.SellItem(Lifegiving Seed //or "Lifegiving Seed"//);
    }
 
Yes, I've tried both ways, I even tried putting an ID number instead of the name, didnt work either way :(
 
I've no idea then. Hardly looked into Plug-ins at all... Umm.... Good luck! :)
 
Code:
        public void SellItem(string ItemName)
        {
            while (!MerchantFrame.Instance.IsVisible)
            {
                slog("Waiting for Merchant Frame");
                Thread.Sleep(10);
            }
            if(MerchantFrame.Instance.IsVisible)
            {
                foreach (WoWItem MyBagItems in Me.BagItems)
                {
                    if (MyBagItems.Name == ItemName && MyBagItems.IsValid)
                    {
                        Logging.Write("Selling {0}", MyBagItems.Name);
                        MerchantFrame.Instance.SellItem(MyBagItems);
                    }
                }
            }
    

        }

that should work, but you still need to write code to initiate the interact with the vender. but everytime the vender pane is open, it should sell the item.
 
Code:
        public void SellItem(string ItemName)
        {
            while (!MerchantFrame.Instance.IsVisible)
            {
                slog("Waiting for Merchant Frame");
                Thread.Sleep(10);
            }
            if(MerchantFrame.Instance.IsVisible)
            {
                foreach (WoWItem MyBagItems in Me.BagItems)
                {
                    if (MyBagItems.Name == ItemName && MyBagItems.IsValid)
                    {
                        Logging.Write("Selling {0}", MyBagItems.Name);
                        MerchantFrame.Instance.SellItem(MyBagItems);
                    }
                }
            }
    

        }

that should work, but you still need to write code to initiate the interact with the vender. but everytime the vender pane is open, it should sell the item.

Hmm, still doesnt work :( Here's what I did:

I've defined my variable:

Code:
public string ItemName = "Lifegiving Seed";

Added a line in public override void Pulse()

Code:
SellItem(ItemName);

Changed slightly the code you gave me (for some reason I had to)

Code:
 public void SellItem(string ItemName)
        {

            if(Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.IsVisible)
            {
                foreach (WoWItem MyBagItems in StyxWoW.Me.BagItems)
                {
                    if (MyBagItems.Name == ItemName && MyBagItems.IsValid)
                    {
                        Logging.Write("Selling {0}", MyBagItems.Name);
                        Styx.Logic.Inventory.Frames.Merchant.MerchantFrame.Instance.SellItem(MyBagItems);
                    }
                }
            }

I'm getting the log message saying Selling Lifegiving Seed, but nothing happens. It compiled without errors. What could be wrong? :(
 
I see absolutely nothing wrong with your code. It should be selling the item...
 
Thats the plugin that I've, it has some other simple features as well:

I dont have any logs I'm afraid.
 

Attachments

Back
Top