Private code modifications - RekkasGit/E3Next GitHub Wiki

There's 3 primary attributes to deal with.

When E3 Starts up, to get your method to Initialize you can use the [SubSystemInit] attribute.

[SubSystemInit]
public static void Init()
{
    code goes here
}

To create a method that is called for a certain class or class grouping you can use the [ClassInvoke] attribute.

[ClassInvoke(Data.Class.Tank)] 
public static void Function_Name()
{
    code goes here
}

All the current Data.Class.X values and their definition:

Tank = Warrior | Paladin | Shadowknight,
Priest = Cleric | Druid | Shaman,
Caster = Wizard | Magician | Enchanter | Necromancer,
Melee = Beastlord | Berserker | Bard | Rogue | Ranger | Monk,
PureMelee = Warrior | Rogue | Berserker,
All = Tank | Priest | Caster | Melee,
PetClass = Shadowknight | Druid | Necromancer | Magician | Enchanter | Beastlord | Shaman,
HealHybrid = Paladin | Ranger | Beastlord,
FeignDeathClass = Necromancer | Shadowknight | Monk,
ManaUsers = Caster | Priest | HealHybrid | Shadowknight,
Ranged = Caster | Ranger

You can also specify a specific class like `[ClassInvoke(Data.Class.Bard)]
NOTE you cannot specify order of this attribute. If you wish to specify order, use the AdvSettingsInvoke attribute.

If you want a method that must be specified in the advanced settings.ini and is used in the primary loop, the [AdvSettingsInvoke] attribute would be used.

[AdvSettingInvoke]
public static void Function_Name()
{
    code goes here
}

Once you've modified the source, build the solution and deploy the newly compiled dll and exe files to your MQ\Mono\Macros\e3 directory.

example private code:

using MonoCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace E3Core.Processors
{
    public static class PrivateCode
    {
        private static IMQ MQ = E3.MQ;
        private static Dictionary<int, string> _slotMap = new Dictionary<int, string> {
            {0, "charm"},
            {1, "leftear"},
            {2, "head"},
            {3, "face"},
            {4, "rightear"},
            {5, "neck"},
            {6, "shoulder"},
            {7, "arms"},
            {8, "back"},
            {9, "leftwrist"},
            {10, "rightwrist"},
            {11, "ranged"},
            {12, "hands"},
            {13, "mainhand"},
            {14, "offhand"},
            {15, "leftfinger"},
            {16, "rightfinger"},
            {17, "chest"},
            {18, "legs"},
            {19, "feet"},
            {20, "waist"},
            {21, "powersource"},
            {22, "ammo"},
        };
        [SubSystemInit]
        public static void Init()
        {
            RegisterEvents();
        }
        private static void RegisterEvents()
        {
            EventProcessor.RegisterCommand("/emptyaugs", x => FindEmptyAugSlots());
        }

        private static void FindEmptyAugSlots()
        {
            var missing = new List<string>();
            for (int i = 0; i <= 22; i++)
            {
                for (int j = 1; j <= 6; j++)
                {
                    var augSlotType = MQ.Query<int>($"${{Me.Inventory[{i}].AugSlot{j}}}");
                    if (augSlotType > 0 && augSlotType != 20)
                    {
                        if (string.Equals("NULL", MQ.Query<string>($"${{Me.Inventory[{i}].AugSlot[{j}]}}")))
                        {
                            missing.Add($"\ag{_slotMap[i]} - ${{Me.Inventory[{i}].ItemLink[CLICKABLE]}}");
                            break;
                        }

                    }
                }
            }

            if (missing.Any())
            {
                MQ.Cmd("/echo \agItems missing augs:");
                foreach(var item in missing)
                {
                    MQ.Cmd($"/echo {item}");
                }
            }
        }
    }
}
⚠️ **GitHub.com Fallback** ⚠️