Beispiel #1
0
        protected async Task EnterTradeCode(int code, CancellationToken token)
        {
            var keys = TradeUtil.GetPresses(code);

            foreach (var key in keys)
            {
                const int delay = 0_500;
                await Click(key, delay, token).ConfigureAwait(false);
            }
            // Confirm Code outside of this method (allow synchronization)
        }
Beispiel #2
0
        protected async Task EnterTradeCode(int code, PokeTradeHubConfig config, CancellationToken token)
        {
            var keys = TradeUtil.GetPresses(code);

            foreach (var key in keys)
            {
                int delay = config.Timings.KeypressTime;
                await Click(key, delay, token).ConfigureAwait(false);
            }
            // Confirm Code outside of this method (allow synchronization)
        }
        protected virtual async Task EnterLinkCode(int code, PokeTradeHubConfig config, CancellationToken token)
        {
            // Default implementation to just press directional arrows. Can do via Hid keys, but users are slower than bots at even the default code entry.
            var keys = TradeUtil.GetPresses(code);

            foreach (var key in keys)
            {
                int delay = config.Timings.KeypressTime;
                await Click(key, delay, token).ConfigureAwait(false);
            }
            // Confirm Code outside of this method (allow synchronization)
        }