Beispiel #1
0
 void Activate()
 {
     if (Info.GetSolvableModuleNames().Where(x => !exceptions.Contains(x)).Count() == 0)
     {
         Debug.LogFormat("[+ #{0}] No solvable modules. Commencing auto solve.", _moduleId);
         ModuleSolved = true;
         Module.HandlePass();
     }
     else
     {
         store            = new int[1000];
         LightsOn         = true;
         stage            = 0;
         SolvableModules  = Info.GetSolvableModuleNames().Where(x => !exceptions.Contains(x)).Count();
         BatHld           = Info.GetBatteryHolderCount();
         PrtPlts          = Info.GetPortPlateCount();
         Modules          = Info.GetModuleNames().Count;
         ThirdChar        = Info.GetSerialNumber()[2];
         Ind              = Info.GetIndicators().Count();
         StartingTime     = (int)Info.GetTime();
         SubmitSeq        = "";
         submissionString = "";
         if (TimeMode)
         {
             StartCoroutine("ChooseColor");
         }
     }
 }
Beispiel #2
0
    #pragma warning restore 414
    IEnumerator ProcessTwitchCommand(string command)
    {
        if (!AllModulesSolved)
        {
            yield return("sendtochaterror All other modules have not been solved yet!");

            yield break;
        }
        if (command.StartsWith("tap "))
        {
            int[] valids = { 11, 12, 13, 14, 15, 21, 22, 23, 24, 25, 31, 32, 33, 34, 35, 41, 42, 43, 44, 45, 51, 52, 53, 54, 55 };
            foreach (string tap in command.Split(' '))
            {
                if (tap != "tap")
                {
                    int taps;
                    if (!int.TryParse(tap.ToString(), out taps))
                    {
                        yield return("sendtochaterror The pair of numbers '" + tap.ToString() + "' is invalid!");

                        yield break;
                    }
                    if (!valids.Contains(taps))
                    {
                        yield return("sendtochaterror The pair of numbers '" + taps + "' is invalid!");

                        yield break;
                    }
                }
            }
            foreach (string tap in command.Split(' '))
            {
                if (tap != "tap")
                {
                    for (int j = 0; j < 2; j++)
                    {
                        for (int i = 0; i < int.Parse(tap[j].ToString()); i++)
                        {
                            plusBtn.OnInteract();
                            yield return(new WaitForSeconds(0.05f));

                            plusBtn.OnInteractEnded();
                            yield return(new WaitForSeconds(0.05f));
                        }
                        yield return(new WaitUntil(() => paused));

                        yield return(new WaitForSeconds(0.1f));
                    }
                }
            }
            int[] subArrTemp = new int[submission.Length];
            for (int i = 0; i < submission.Length; i++)
            {
                subArrTemp[i] = submission[i];
            }
            subArrTemp[SubmitStage] = pressCount;
            string tempSub = "";
            int    chars   = 0;
            for (int c = 0; c < SubmitSeq.Length; c++)
            {
                int y = subArrTemp[chars];
                int x = subArrTemp[chars + 1];

                tempSub += x > 4 || y > 4 ? "?" : Letters[y, x];
                chars   += 2;
            }
            if (tempSub == SubmitSeq)
            {
                yield return("awardpointsonsolve " + TotalStages);
            }
            plusBtn.OnInteract();
            yield return(new WaitForSeconds(0.05f));

            plusBtn.OnInteractEnded();
            yield return(new WaitForSeconds(0.05f));
        }
    }