Ejemplo n.º 1
0
        /// <summary>
        /// Initializes settings and defines hotkeys.
        /// </summary>.
        public DemoBot()
        {
            TkBotFactory.Initialize();

            _clients = new ActiveClients(TkBotFactory.ProcessName);
            //Log.Information("Got list of clients");

            _client = _clients.GetRogue();
            _client.Activity.DefaultCommandCooldown = TkBotFactory.CommandCooldown;

            _isBotRunning = new AutoHotkeyToggle("^F2", "isBotRunning", true);
            _isBotPaused  = new AutoHotkeyToggle("F2", "isBotPaused", false);
            _shouldEsunaExternalGroupMembers = new AutoHotkeyToggle("F12", "shouldEsunaExternalGroupMembers", false);
            _shouldRing   = new AutoHotkeyToggle("NumpadDiv", "shouldRing", false);
            _shouldGate   = new AutoHotkeyToggle("^NumpadDiv", "shouldGate", false);
            _shouldReturn = new AutoHotkeyToggle("!NumpadDiv", "shouldReturn", false);

            var toggles = new[]
            {
                _isBotRunning,
                _isBotPaused,
                _shouldEsunaExternalGroupMembers,
                _shouldRing,
                _shouldGate,
                _shouldReturn
            };

            var ahk = AutoHotkeyEngine.Instance;

            ahk.LoadToggles(toggles);
            ahk.LoadScript("NumpadAdd::Send {Ctrl down},{Ctrl up}");
        }
Ejemplo n.º 2
0
        public void ReadSpells()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine(tkMemory.Spells.ToString());
        }
Ejemplo n.º 3
0
        public void ReadChat()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine("----------Chat----------");
            Console.WriteLine($"Chat/Blue Spell = {tkMemory.Chat.ChatOrBlueSpell}");
            Console.WriteLine($"Sage/Whisper = {tkMemory.Chat.SageOrWhisper}");
        }
Ejemplo n.º 4
0
        public void ReadTargets()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine("----------TargetUids----------");
            Console.WriteLine($"TargetUidSpell = {tkMemory.Targeting.Spell}");
            Console.WriteLine($"TargetUidTab = {tkMemory.Targeting.Npc}");
            Console.WriteLine($"TargetUidV = {tkMemory.Targeting.Player}");
        }
Ejemplo n.º 5
0
        public void ReadEnvironment()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine("----------Environment----------");
            Console.WriteLine($"MapCoordinateX = {tkMemory.Environment.Map.Coordinates.X}");
            Console.WriteLine($"MapCoordinateY = {tkMemory.Environment.Map.Coordinates.Y}");
            Console.WriteLine($"MapName = {tkMemory.Environment.Map.Name}");
            Console.WriteLine($"Time = {tkMemory.Environment.Time}");
        }
Ejemplo n.º 6
0
        public void ReadActivity()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine("----------Activity----------");
#pragma warning disable 612
            Console.WriteLine($"LatestActivity = {tkMemory.Activity.LatestActivity}");
            Console.WriteLine($"StatusLatestChange = {tkMemory.Activity.LatestStatusEffectChanged}");
#pragma warning restore 612
            Console.WriteLine($"StatusActiveEffects =\n{tkMemory.Activity.ActiveStatusEffects}");
        }
Ejemplo n.º 7
0
        public RogueTrainer(RogueConfiguration config)
        {
            TkTrainerFactory.Initialize(TkClient.BasePath.Rogue.ToString());

            _clients = new ActiveClients(config.Process);

            _rogue = string.IsNullOrWhiteSpace(config.Name)
                ? _clients.GetRogue()
                : _clients.GetRogue(config.Name);

            _rogue.Activity.DefaultCommandCooldown = config.CommandDelay;

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

            _shouldUpdateNpcs               = new AutoHotkeyBool("shouldUpdateNpcs", false);
            _isRunning                      = new AutoHotkeyToggle("^F3", "isRunning", true);
            _isPaused                       = new AutoHotkeySuspendToggle("F3", "isPaused", false);
            _shouldTaunt                    = new AutoHotkeyToggleWithPrerequisite("7", "shouldTaunt", false, _shouldUpdateNpcs);
            _shouldLethalStrikeOnAethers    = new AutoHotkeyToggle("8", "shouldLethalStrikeOnAethers", config.LethalStrike.Value);
            _shouldDesperateAttackOnAethers = new AutoHotkeyToggle("9", "shouldDesperateAttackOnAethers", config.DesperateAttack.Value);
            _shouldAutoMelee                = new AutoHotkeyToggle("0", "shouldAutoMelee", config.Attack.Value);
            _shouldAmbushOnMelee            = new AutoHotkeyToggle("-", "shouldAmbushOnMelee", config.Ambush.Value);

            var toggles = new[]
            {
                _isRunning,
                _isPaused,
                _shouldTaunt,
                _shouldLethalStrikeOnAethers,
                _shouldDesperateAttackOnAethers,
                _shouldAutoMelee,
                _shouldAmbushOnMelee
            };

            _ahk = AutoHotkeyEngine.Instance;
            _ahk.LoadToggles(toggles);
        }
Ejemplo n.º 8
0
        public void ReadGroup(int groupPosition)
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine($"---Group Member {groupPosition}---");
            Console.WriteLine($"Name = {tkMemory.Group.GetName(groupPosition)}");
            Console.WriteLine($"UID = {tkMemory.Group.GetUid(groupPosition)}");
            Console.WriteLine("--------------------");
            Console.WriteLine($"Mana Current = {tkMemory.Group.Mana.GetCurrent(groupPosition):N0}");
            Console.WriteLine($"Mana Deficit = {tkMemory.Group.Mana.GetDeficit(groupPosition):N0}");
            Console.WriteLine($"Mana Max = {tkMemory.Group.Mana.GetMax(groupPosition):N0}");
            Console.WriteLine($"Mana Percent = {tkMemory.Group.Mana.GetPercent(groupPosition):P}");
            Console.WriteLine("--------------------");
            Console.WriteLine($"Vita Current = {tkMemory.Group.Vita.GetCurrent(groupPosition):N0}");
            Console.WriteLine($"Vita Deficit = {tkMemory.Group.Vita.GetDeficit(groupPosition):N0}");
            Console.WriteLine($"Vita Max = {tkMemory.Group.Vita.GetMax(groupPosition):N0}");
            Console.WriteLine($"Vita Percent = {tkMemory.Group.Vita.GetPercent(groupPosition):P}");
        }
Ejemplo n.º 9
0
        public void ReadSelf()
        {
            var clients  = new ActiveClients(ConfigurationManager.AppSettings["ProcessName"]);
            var tkMemory = clients.GetRogue();

            Console.WriteLine("----------Self----------");
            Console.WriteLine($"Name = {tkMemory.Self.Name}");
            Console.WriteLine($"Uid = {tkMemory.Self.Uid}");
            Console.WriteLine($"Path = {tkMemory.Self.Path}");
            Console.WriteLine($"Level = {tkMemory.Self.Level}");
            Console.WriteLine("------------------------");
            Console.WriteLine($"Vita Current = {tkMemory.Self.Vita.Current:N0}");
            Console.WriteLine($"Vita Deficit = {tkMemory.Self.Vita.Deficit:N0}");
            Console.WriteLine($"Vita Max = {tkMemory.Self.Vita.Max:N0}");
            Console.WriteLine($"Vita Percent = {tkMemory.Self.Vita.Percent:P}");
            Console.WriteLine("------------------------");
            Console.WriteLine($"Mana Current = {tkMemory.Self.Mana.Current:N0}");
            Console.WriteLine($"Mana Deficit = {tkMemory.Self.Mana.Deficit:N0}");
            Console.WriteLine($"Mana Max = {tkMemory.Self.Mana.Max:N0}");
            Console.WriteLine($"Mana Percent = {tkMemory.Self.Mana.Percent:P}");
            Console.WriteLine("------------------------");
            Console.WriteLine($"Gold = {tkMemory.Self.Gold:N0}");
            Console.WriteLine($"Exp = {tkMemory.Self.Exp:N0}");
        }