Jump to content

Items on BuyList


Wiceradon

Recommended Posts

Hey everyone,

I'd like to put items on the BuyList like this: 

 

Item Name: Instant Poison I, Vendor Item Class: Consumable, Go to Vendor if Quantity Less or Equal: 5, Quantity 20, Script can condition: ObjectManager.Me.Level >20 && ObjectManager.Me.WowClass == WoWClass.Rogue;

 

I cant figure out how to make this work. Does anyone have an idea? 

 

Best,

W

 

 

Link to comment
Share on other sites

5 hours ago, Droidz said:

Hello, you want do it with code or with interface?

Hey Droidz,

 

I want to do it with Code like: 

wManager.wManagerSetting.CurrentSetting.BuyList.Add("Instant Poison"); 

+ Vendor Item Class: Consumable, Go to Vendor if Quantity Less or Equal: 5, Quantity 20, Script can condition: ObjectManager.Me.Level >20 && ObjectManager.Me.WowClass == WoWClass.Rogue;

Is it possible?

Link to comment
Share on other sites

Try this code:

var itemToBuy = new wManager.Wow.Class.Buy
{
    ItemName = "Instant Poison",
    VendorItemClass = wManager.Wow.Class.Npc.NpcVendorItemClass.Consumable,
    GoToVendorIfQuantityLessOrEqual = 5,
    Quantity = 20,
    ScriptCanCondition = "return ObjectManager.Me.Level >20 && ObjectManager.Me.WowClass == WoWClass.Rogue;"
};
wManager.wManagerSetting.CurrentSetting.BuyList.Add(itemToBuy);

 

Link to comment
Share on other sites

15 hours ago, Droidz said:

Try this code:


var itemToBuy = new wManager.Wow.Class.Buy
{
    ItemName = "Instant Poison",
    VendorItemClass = wManager.Wow.Class.Npc.NpcVendorItemClass.Consumable,
    GoToVendorIfQuantityLessOrEqual = 5,
    Quantity = 20,
    ScriptCanCondition = "return ObjectManager.Me.Level >20 && ObjectManager.Me.WowClass == WoWClass.Rogue;"
};
wManager.wManagerSetting.CurrentSetting.BuyList.Add(itemToBuy);

 

Okay thank you DroidZ, it nearly works like I intended it to.

I have one last question about the can condition. I have to change it into C# like:

return wManager.Wow.ObjectManager.ObjectManager.Me.Level >20;

 

Is it possible to run the code in other languages? Because it's easier for me to use codes like I posted here

(ObjectManager.Me.Level >20 etc.)

Is there a way to create a complete condition like

wManager.wManagerSetting.CurrentSetting.BuyList.Contians(Instant Poison);

?

Link to comment
Share on other sites

try

        wManager.wManagerSetting.CurrentSetting.BuyList.RemoveAll(b => b.ItemName == "Instant Poison"); // remove existing
        var itemToBuy = new wManager.Wow.Class.Buy
        {
            ItemName = "Instant Poison",
            VendorItemClass = wManager.Wow.Class.Npc.NpcVendorItemClass.Consumable,
            GoToVendorIfQuantityLessOrEqual = 5,
            Quantity = 20,
            ScriptCanCondition = "return ObjectManager.Me.Level > 20;"
        };
        wManager.wManagerSetting.CurrentSetting.BuyList.Add(itemToBuy);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...