Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Boolen, string Dictionary array

Featured Replies

I am trying to redo my PvPtools with adding custom states but i am having a little problem with buying item via string , boolen.

i am trying to use my settings bool to buy the item if the settings is true. but i am not understanding how to get it to buy the item while using a boolen. 

 

error : parameter 'number' of 'Vendor.BuyItem(string, int)', i understand i need a string + int amount but how do i get it to check before buying using boolen?

 

public static class AllianceGems
    {

        private static Dictionary<string, bool> Mains = new Dictionary<string, bool>
        {
            { "Majestic Zircon", true},
        };

        public static void BuyingGems()
        {
            foreach (var item in Mains)
            {
                Vendor.BuyItem(item);
            }
        }
    }

 

Hi,

public static class AllianceGems
{

    private static Dictionary<string, bool> Mains = new Dictionary<string, bool>
    {
        { "Majestic Zircon", true},
    };

    public static void BuyingGems()
    {
        foreach (var item in Mains)
        {
            if (item.Value)
                Vendor.BuyItem(item.Key, 20);
        }
    }
}

If you want use list with ammount to buy:

using System;
using System.Collections.Generic;
using wManager.Wow.Helpers;

public static class AllianceGems
{
    private static List<System.Tuple<bool, string, int>> Mains = new List<System.Tuple<bool, string, int>>
    {
        //                       BuyOrNot, ItemName      , BuyNumber
        new Tuple<bool, string, int>(true, "Majestic Zircon", 20),
    };

    public static void BuyingGems()
    {
        foreach (var item in Mains)
        {
            if (item.Item1)
                Vendor.BuyItem(item.Item2, item.Item3);
        }
    }
}

Final code look like:

using System.Collections.Generic;
using robotManager.Helpful;
using wManager.Wow.Helpers;
using Buy = System.Tuple<bool, string, int>;

public static class AllianceGems
{
    private static List<Buy> Mains = new List<Buy>
    {
        //    Item1,    Item2         , Item3
        //    BuyOrNot, ItemName      , BuyNumber
        new Buy(true, "Majestic Zircon", 20),
    };

    public static void BuyingGems()
    {
        foreach (var item in Mains)
        {
            if (item.Item1)
            {
                var currentCount = ItemsManager.GetItemCountByNameLUA(item.Item2);
                if (currentCount < item.Item3)
                {
                    Logging.Write("Buy " + item.Item2);
                    Vendor.BuyItem(item.Item2, item.Item3 - currentCount);
                }
            }
        }
    }
}

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.