Example #1
0
        public SavedMacroState(PlayerMacroState macroState)
        {
            if (macroState == null)
            {
                throw new ArgumentNullException("macroState");
            }

            CharacterName = macroState.Client.Name;

            if (macroState.Client.HasHotkey)
            {
                HotkeyModifiers = macroState.Client.Hotkey.Modifiers;
                HotkeyKey       = macroState.Client.Hotkey.Key;
            }

            UseLyliacVineyard         = macroState.UseLyliacVineyard;
            FlowerAlternateCharacters = macroState.FlowerAlternateCharacters;

            foreach (var skillName in macroState.Client.Skillbook.ActiveSkills)
            {
                skills.Add(new SavedSkillState(skillName));
            }

            foreach (var spell in macroState.QueuedSpells)
            {
                spells.Add(new SavedSpellState(spell));
            }

            foreach (var flower in macroState.FlowerTargets)
            {
                flowers.Add(new SavedFlowerState(flower));
            }
        }
Example #2
0
        public PlayerMacroState GetMacroState(Player player)
        {
            if (isLockedDown)
            {
                throw new InvalidOperationException("Macro virtual machine is currently locked down.");
            }

            if (clientMacros.ContainsKey(player.Process.ProcessId))
            {
                return(clientMacros[player.Process.ProcessId]);
            }

            var state = new PlayerMacroState(player);

            clientMacros[player.Process.ProcessId] = state;

            return(state);
        }