Exemplo n.º 1
0
        public void ReadInventory()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetMage();

            tkMemory.Inventory.Update();
            Console.WriteLine(tkMemory.Inventory.ToString());
        }
Exemplo n.º 2
0
        public MageTrainer(MageConfiguration config)
        {
            TkTrainerFactory.Initialize(TkClient.BasePath.Mage.ToString());

            _clients = new ActiveClients(config.Process);

            _mage = string.IsNullOrWhiteSpace(config.Name)
                ? _clients.GetMage()
                : _clients.GetMage(config.Name);

            _mage.Activity.DefaultCommandCooldown = config.CommandDelay;

            Log.Debug($"Key item assignments:\n{_mage.Inventory.KeyItems}\n");
            Log.Debug($"Key spell assignments:\n{_mage.Spells.KeySpells}\n");

            _isRunning = new AutoHotkeyToggle("^F1", "isRunning", true);
            _isPaused  = new AutoHotkeySuspendToggle("F1", "isPaused", false);
            _shouldEsunaExternalGroupMembers = new AutoHotkeyToggle("F11", "shouldEsunaExternalGroupMembers", false);
            _shouldHeal       = new AutoHotkeyToggle("`", "shouldHeal", config.Heal.Value);
            _shouldBlind      = new AutoHotkeyToggle("1", "shouldBlind", config.Blind.Value);
            _shouldParalyze   = new AutoHotkeyToggle("2", "shouldParalyze", config.Paralyze.Value);
            _shouldVenom      = new AutoHotkeyToggle("3", "shouldVenom", config.Venom.Value);
            _shouldVex        = new AutoHotkeyToggle("4", "shouldVex", config.Vex.Value);
            _shouldZap        = new AutoHotkeyToggle("5", "shouldZap", config.Zap.Value);
            _shouldUpdateNpcs = new AutoHotkeyToggle("6", "shouldUpdateNpcs", false);

            var toggles = new[]
            {
                _isRunning,
                _isPaused,
                _shouldEsunaExternalGroupMembers,
                _shouldHeal,
                _shouldBlind,
                _shouldParalyze,
                _shouldVenom,
                _shouldVex,
                _shouldZap,
                _shouldUpdateNpcs
            };

            _ahk = AutoHotkeyEngine.Instance;
            _ahk.LoadToggles(toggles);
        }
Exemplo n.º 3
0
        public void ReadTargets()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetMage();

            Console.WriteLine("----------TargetUids----------");
            Console.WriteLine($"Auto-Target UID = {tkMemory.Targeting.AutoTarget}");
            Console.WriteLine($"Item/Orb Target UID = {tkMemory.Targeting.Item}");
            Console.WriteLine($"Spell Target UID = {tkMemory.Targeting.Spell}");
            Console.WriteLine($"Target Lock UID = {tkMemory.Targeting.TargetLock}");
        }
Exemplo n.º 4
0
        public async Task IsTargetOffScreen(uint uid)
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetMage();

            var result = await tkMemory.IsTargetOffScreen(uid, tkMemory.Spells.KeySpells.Zap)
                ? "Target is off screen."
                : "Target is on screen.";

            Console.WriteLine(result);
        }
Exemplo n.º 5
0
        public void WriteVTarget()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetMage();

            tkMemory.Targeting.TargetLock = 12211;
            Assert.AreEqual(tkMemory.Targeting.TargetLock, 12211);
            Console.WriteLine($"TargetUidSpell = {tkMemory.Targeting.TargetLock}");

            tkMemory.Targeting.TargetLock = 831791;
            Assert.AreEqual(tkMemory.Targeting.TargetLock, 831791);
            Console.WriteLine($"TargetUidSpell = {tkMemory.Targeting.TargetLock}");
        }
Exemplo n.º 6
0
        public async Task ReadNpcs()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetMage();
            await tkMemory.UpdateNpcs(tkMemory.Spells.KeySpells.Zap);

            var sb = new StringBuilder();

            sb.AppendLine("NPC UIDs:");
            foreach (var npc in tkMemory.Npcs)
            {
                sb.AppendLine(npc.Uid.ToString());
            }
            Console.WriteLine(sb.ToString());
        }