Exemplo n.º 1
0
        public SaltComponent(LiveSplitState state, string name)
        {
            ComponentName = name;
            _mem          = new SaltMemory();

            if (state == null)
            {
                throw new ArgumentNullException(nameof(state));
            }

            _model = new TimerModel
            {
                CurrentState = state
            };

            _model.CurrentState.OnStart -= TimerStart;
            _model.CurrentState.OnStart += TimerStart;

            _model.CurrentState.OnStart     -= SetPlayerNeedsRandomized;
            _model.CurrentState.OnStart     += SetPlayerNeedsRandomized;
            _model.CurrentState.OnSplit     -= SetPlayerNeedsRandomized;
            _model.CurrentState.OnSplit     += SetPlayerNeedsRandomized;
            _model.CurrentState.OnUndoSplit -= SetPlayerNeedsRandomized;
            _model.CurrentState.OnUndoSplit += SetPlayerNeedsRandomized;
            _model.CurrentState.OnSkipSplit -= SetPlayerNeedsRandomized;
            _model.CurrentState.OnSkipSplit += SetPlayerNeedsRandomized;
        }
Exemplo n.º 2
0
        public static void Main()
        {
            using SaltMemory mem = new SaltMemory();

            while (!mem.IsHooked)
            {
                mem.Hook();
            }

            string anim = mem.GetPlayerAnim(0);

            while (true)
            {
                Thread.Sleep(10);
                string newAnim = mem.GetPlayerAnim(0);

                if (anim != newAnim)
                {
                    anim = newAnim;
                    Console.WriteLine(anim);
                }
            }
        }