Example #1
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);
        }
Example #2
0
        public WarriorTrainer(WarriorConfiguration config)
        {
            TkTrainerFactory.Initialize(TkClient.BasePath.Warrior.ToString());

            _clients = new ActiveClients(config.Process);

            _warrior = string.IsNullOrWhiteSpace(config.Name)
                ? _clients.GetWarrior()
                : _clients.GetWarrior(config.Name);

            _warrior.Activity.DefaultCommandCooldown = config.CommandDelay;

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

            _shouldUpdateNpcs         = new AutoHotkeyBool("shouldUpdateNpcs", false);
            _isRunning                = new AutoHotkeyToggle("^F4", "isRunning", true);
            _isPaused                 = new AutoHotkeySuspendToggle("F4", "isPaused", false);
            _shouldSpotTrapsOnAethers = new AutoHotkeyToggle("F6", "shouldSpotTrapsOnAethers", false);
            _shouldTaunt              = new AutoHotkeyToggleWithPrerequisite("F7", "shouldTaunt", false, _shouldUpdateNpcs);
            _shouldWhirlwindOnAethers = new AutoHotkeyToggle("F8", "shouldWhirlwindOnAethers", config.Whirlwind.Value);
            _shouldBerserkOnAethers   = new AutoHotkeyToggle("F9", "shouldBerserkOnAethers", config.Berserk.Value);
            _shouldAutoMelee          = new AutoHotkeyToggle("F10", "shouldAutoMelee", config.Attack.Value);

            var toggles = new[]
            {
                _isRunning,
                _isPaused,
                _shouldTaunt,
                _shouldWhirlwindOnAethers,
                _shouldBerserkOnAethers,
                _shouldAutoMelee,
                _shouldSpotTrapsOnAethers
            };

            _ahk = AutoHotkeyEngine.Instance;
            _ahk.LoadToggles(toggles);
        }
 /// <summary>
 /// Declare and initialize a Boolean variable in AutoHotkey whose value can be toggled with a hotkey.
 /// </summary>
 /// <param name="hotkey">The hotkey that will be used to toggle the value of the Boolean.</param>
 /// <param name="name">The name of the Boolean variable in AutoHotkey.</param>
 /// <param name="value">The initial value of the Boolean variable.</param>
 /// <param name="prerequisite">An AutoHotkeyBool whose value should be set to the same value whenever setting the value of this AutoHotkeyToggle.
 /// The value of the AutoHotkeyBool should never be toggled directly using a hotkey, so do not use an AutoHotkeyToggle instead.</param>
 public AutoHotkeyToggleWithPrerequisite(string hotkey, string name, bool value, AutoHotkeyBool prerequisite)
     : base(hotkey, name, value)
 {
     _prerequisite       = prerequisite;
     _prerequisite.Value = value;
 }