IEnumerator TwitchHandleForcedSolve()
    {
        RightArrow.OnInteract();
        while (_curDalmatianIndex != _solution)
        {
            yield return(null);
        }
        RightArrow.OnInteractEnded();
        yield return(new WaitForSeconds(.1f));

        Submit.OnInteract();
        yield return(new WaitForSeconds(.1f));
    }
Example #2
0
    IEnumerator TwitchHandleForcedSolve()
    {
        while (_clues != null)
        {
            Right.OnInteract();
            yield return(new WaitForSeconds(.1f));

            if (_clues[_selectedIndex].IsCorrect)
            {
                Submit.OnInteract();
                yield return(new WaitForSeconds(.5f));
            }
        }
    }
Example #3
0
#pragma warning restore 414

    IEnumerator ProcessTwitchCommand(string command)
    {
        if (_clues == null)
        {
            yield break;
        }

        var pieces = command.Split(new[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries);
        int val;

        if (pieces.Length == 1 && pieces[0].Equals("cycle", StringComparison.InvariantCultureIgnoreCase))
        {
            yield return(null);

            for (int i = 0; i < _clues.Count; i++)
            {
                yield return(new WaitForSeconds(_clues[_selectedIndex].Text.Length > 8 ? 2.8f : 2f));

                yield return("trycancel");

                Right.OnInteract();
            }
        }
        else if (pieces.Length == 2 && pieces[0].Equals("left", StringComparison.InvariantCultureIgnoreCase) && int.TryParse(pieces[1], out val))
        {
            yield return(null);

            for (int i = 0; i < val; i++)
            {
                Left.OnInteract();
                yield return(new WaitForSeconds(.1f));
            }
        }
        else if (pieces.Length == 2 && pieces[0].Equals("right", StringComparison.InvariantCultureIgnoreCase) && int.TryParse(pieces[1], out val))
        {
            yield return(null);

            for (int i = 0; i < val; i++)
            {
                Right.OnInteract();
                yield return(new WaitForSeconds(.1f));
            }
        }
        else if (pieces.Length == 1 && pieces[0].Equals("submit", StringComparison.InvariantCultureIgnoreCase))
        {
            yield return(null);

            yield return(new[] { Submit });

            yield break;
        }
        else if (pieces.Length == 2 && pieces[0].Equals("submit", StringComparison.InvariantCultureIgnoreCase))
        {
            yield return(null);

            for (int i = 0; i < _clues.Count; i++)
            {
                if (i > 0)
                {
                    Right.OnInteract();
                    yield return(new WaitForSeconds(.1f));
                }

                if (twitchSimplify(_clues[_selectedIndex].Text).StartsWith(twitchSimplify(pieces[1]), StringComparison.InvariantCultureIgnoreCase) ||
                    (_clues[_selectedIndex].AltText != null && twitchSimplify(_clues[_selectedIndex].AltText).StartsWith(twitchSimplify(pieces[1]), StringComparison.InvariantCultureIgnoreCase)))
                {
                    Submit.OnInteract();
                    yield break;
                }
            }

            yield return("sendtochaterror {0}, the specified coordinate is not on the module.");
        }
    }