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.

Smelting

Featured Replies

If this code is useful, I think there are things that need to be completed. I didn't check this. I don't know much about coding, can anyone with knowledge help me? Can you edit this code exactly?

 

using wManager.Wow.Enums;
using wManager.Wow.Helpers;
using wManager.Wow.ObjectManager;

public static void CheckAndProcessOre()
{
    string oreName = "Copper Ore";
    int requiredAmount = 10;

    if (IsBagFull())
    {
        WoWGameObject smeltingNPC = FindNearestSmeltingNPC();
        if (smeltingNPC != null)
        {
            Navigator.GoTo(smeltingNPC.Position);
        }
    }
    else
    {
        MineOre(oreName, requiredAmount);
    }
}

public static bool IsBagFull()
{
    List<WoWItem> bags = Bag.GetBagItem();

    foreach (WoWItem bag in bags)
    {
        if (bag != null && bag.IsValid && bag.ItemInfo != null)
        {
            int freeSlots = bag.ItemInfo.MaxCount - bag.StackCount;
            if (freeSlots == 0)
            {
                return true;
            }
        }
    }

    return false;
}

public static void MineOre(string oreName, int requiredAmount)
{
    WoWGameObject oreNode = FindNearestOreNode(oreName);
    if (oreNode != null)
    {
        Navigator.GoTo(oreNode.Position);
        oreNode.Interact();
        wManager.wManagerSetting.WaitLocalPlayerIsIdleMS = 2000;
        int currentAmount = GetItemCount(oreName);
        if (currentAmount >= requiredAmount)
        {
            WoWGameObject smeltingNPC = FindNearestSmeltingNPC();
            if (smeltingNPC != null)
            {
                Navigator.GoTo(smeltingNPC.Position);
            }
        }
    }
}

public static WoWGameObject FindNearestOreNode(string oreName)
{
    return ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectByEntryList(Mining.OreEntryList).FindAll(node => node.Name == oreName && !node.InUse && node.IsValid && node.IsAlive));
}

public static int GetItemCount(string itemName)
{
    WoWItem[] items = Bag.GetBagItem().ToArray();
    return items.Sum(item => item.ItemInfo.Name == itemName ? item.StackCount : 0);
}

public static WoWGameObject FindNearestSmeltingNPC()
{
    return ObjectManager.GetNearestWoWGameObject(ObjectManager.GetWoWGameObjectByEntryList(Mining.SmeltingEntryList).FindAll(npc => npc.IsValid && npc.Is
Alive));
}

public static int[] SmeltingEntryList = { /* Smelting NPC'ID */ };
 

2 minutes ago, Droidz said:

Hello,

I don't know where you got this code, but it can't work, it's missing a lot of methods (did you use chatgpt?).

I was thinking the same thing. 

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.