Example #1
0
 public Form1()
 {
     InitializeComponent();
     this.AcceptButton                 = GoBtn;
     this.srcCodeBx.AutoSize           = true;
     this.srcCodeBx.ReadOnly           = true;
     this.srcCodeBx.Multiline          = true;
     webBrowser.ScriptErrorsSuppressed = true;
     DownBtn.Hide();
 }
Example #2
0
 void CurrUrlFunc()
 {
     currUrl = webBrowser.Url.ToString();
     if (Regex.Match(currUrl, ".*/search|(.*/)$").Success)
     {
         MessageBox.Show("Make sure you click on the streamer name or an emote to download");
     }
     else
     {
         srcCode = RetrieveData(currUrl);
         DownBtn.Show();
     }
 }
Example #3
0
    private IEnumerator BtnDownPush()
    {
        Vector3 BtnStart = new Vector3(0f, DownBtn.transform.localPosition.y, DownBtn.transform.localPosition.z);
        Vector3 BtnEnd   = new Vector3(-0.0046f, DownBtn.transform.localPosition.y, DownBtn.transform.localPosition.z);
        float   t        = 0f;
        float   t1       = 0f;

        while (t <= 1f)
        {
            t += Time.deltaTime / btnpushSec;
            Vector3 CurrentPush = Vector3.Lerp(BtnStart, BtnEnd, t);
            DownBtn.GetComponentInChildren <Transform>().localPosition = CurrentPush;
            yield return(null);
        }
        yield return(new WaitForSeconds(.1f));

        while (t1 <= 1f)
        {
            t1 += Time.deltaTime / btnpushSec;
            Vector3 CurrentPush = Vector3.Lerp(BtnEnd, BtnStart, t);
            DownBtn.GetComponentInChildren <Transform>().localPosition = CurrentPush;
            yield return(null);
        }
    }
Example #4
0
        void ReleaseDesignerOutlets()
        {
            if (ActionTbox != null)
            {
                ActionTbox.Dispose();
                ActionTbox = null;
            }

            if (BackgroundColorBtn != null)
            {
                BackgroundColorBtn.Dispose();
                BackgroundColorBtn = null;
            }

            if (BackroundSelColorBtn != null)
            {
                BackroundSelColorBtn.Dispose();
                BackroundSelColorBtn = null;
            }

            if (BackspaceBtn != null)
            {
                BackspaceBtn.Dispose();
                BackspaceBtn = null;
            }

            if (CancelBarBtn != null)
            {
                CancelBarBtn.Dispose();
                CancelBarBtn = null;
            }

            if (CapsLockBtn != null)
            {
                CapsLockBtn.Dispose();
                CapsLockBtn = null;
            }

            if (CloseToolbarBtn != null)
            {
                CloseToolbarBtn.Dispose();
                CloseToolbarBtn = null;
            }

            if (DefaultIconBtn != null)
            {
                DefaultIconBtn.Dispose();
                DefaultIconBtn = null;
            }

            if (DelBtn != null)
            {
                DelBtn.Dispose();
                DelBtn = null;
            }

            if (DeleteEntryBtn != null)
            {
                DeleteEntryBtn.Dispose();
                DeleteEntryBtn = null;
            }

            if (DownBtn != null)
            {
                DownBtn.Dispose();
                DownBtn = null;
            }

            if (EndBtn != null)
            {
                EndBtn.Dispose();
                EndBtn = null;
            }

            if (EnterBtn != null)
            {
                EnterBtn.Dispose();
                EnterBtn = null;
            }

            if (F10Btn != null)
            {
                F10Btn.Dispose();
                F10Btn = null;
            }

            if (F11Btn != null)
            {
                F11Btn.Dispose();
                F11Btn = null;
            }

            if (F12Btn != null)
            {
                F12Btn.Dispose();
                F12Btn = null;
            }

            if (F1Btn != null)
            {
                F1Btn.Dispose();
                F1Btn = null;
            }

            if (F2Btn != null)
            {
                F2Btn.Dispose();
                F2Btn = null;
            }

            if (F3Btn != null)
            {
                F3Btn.Dispose();
                F3Btn = null;
            }

            if (F4Btn != null)
            {
                F4Btn.Dispose();
                F4Btn = null;
            }

            if (F5Btn != null)
            {
                F5Btn.Dispose();
                F5Btn = null;
            }

            if (F6Btn != null)
            {
                F6Btn.Dispose();
                F6Btn = null;
            }

            if (F7Btn != null)
            {
                F7Btn.Dispose();
                F7Btn = null;
            }

            if (F8Btn != null)
            {
                F8Btn.Dispose();
                F8Btn = null;
            }

            if (F9Btn != null)
            {
                F9Btn.Dispose();
                F9Btn = null;
            }

            if (HelpToolbarBtn != null)
            {
                HelpToolbarBtn.Dispose();
                HelpToolbarBtn = null;
            }

            if (HomeBtn != null)
            {
                HomeBtn.Dispose();
                HomeBtn = null;
            }

            if (InsBtn != null)
            {
                InsBtn.Dispose();
                InsBtn = null;
            }

            if (LaltBtn != null)
            {
                LaltBtn.Dispose();
                LaltBtn = null;
            }

            if (LctrlBtn != null)
            {
                LctrlBtn.Dispose();
                LctrlBtn = null;
            }

            if (LeftBtn != null)
            {
                LeftBtn.Dispose();
                LeftBtn = null;
            }

            if (LshiftBtn != null)
            {
                LshiftBtn.Dispose();
                LshiftBtn = null;
            }

            if (MainTitleTbox != null)
            {
                MainTitleTbox.Dispose();
                MainTitleTbox = null;
            }

            if (ModifierKeysView != null)
            {
                ModifierKeysView.Dispose();
                ModifierKeysView = null;
            }

            if (ModifierToolbar != null)
            {
                ModifierToolbar.Dispose();
                ModifierToolbar = null;
            }

            if (ModifierToolbarBtn != null)
            {
                ModifierToolbarBtn.Dispose();
                ModifierToolbarBtn = null;
            }

            if (NavBar != null)
            {
                NavBar.Dispose();
                NavBar = null;
            }

            if (PersistentSwitch != null)
            {
                PersistentSwitch.Dispose();
                PersistentSwitch = null;
            }

            if (PgDwnBtn != null)
            {
                PgDwnBtn.Dispose();
                PgDwnBtn = null;
            }

            if (PgUpBtn != null)
            {
                PgUpBtn.Dispose();
                PgUpBtn = null;
            }

            if (PreviewBackground != null)
            {
                PreviewBackground.Dispose();
                PreviewBackground = null;
            }

            if (PreviewIcon != null)
            {
                PreviewIcon.Dispose();
                PreviewIcon = null;
            }

            if (PreviewSubtitle != null)
            {
                PreviewSubtitle.Dispose();
                PreviewSubtitle = null;
            }

            if (PreviewTitle != null)
            {
                PreviewTitle.Dispose();
                PreviewTitle = null;
            }

            if (RaltBtn != null)
            {
                RaltBtn.Dispose();
                RaltBtn = null;
            }

            if (RctrlBtn != null)
            {
                RctrlBtn.Dispose();
                RctrlBtn = null;
            }

            if (RemoveDefaultIconBtn != null)
            {
                RemoveDefaultIconBtn.Dispose();
                RemoveDefaultIconBtn = null;
            }

            if (RemoveSelectedIconBtn != null)
            {
                RemoveSelectedIconBtn.Dispose();
                RemoveSelectedIconBtn = null;
            }

            if (RightBtn != null)
            {
                RightBtn.Dispose();
                RightBtn = null;
            }

            if (RshiftBtn != null)
            {
                RshiftBtn.Dispose();
                RshiftBtn = null;
            }

            if (SecondModView != null)
            {
                SecondModView.Dispose();
                SecondModView = null;
            }

            if (SelectedIconBtn != null)
            {
                SelectedIconBtn.Dispose();
                SelectedIconBtn = null;
            }

            if (SubtitleColorBtn != null)
            {
                SubtitleColorBtn.Dispose();
                SubtitleColorBtn = null;
            }

            if (SubtitleSelColorBtn != null)
            {
                SubtitleSelColorBtn.Dispose();
                SubtitleSelColorBtn = null;
            }

            if (SubTitleTbox != null)
            {
                SubTitleTbox.Dispose();
                SubTitleTbox = null;
            }

            if (SuperBtn != null)
            {
                SuperBtn.Dispose();
                SuperBtn = null;
            }

            if (TabBtn != null)
            {
                TabBtn.Dispose();
                TabBtn = null;
            }

            if (TitleColorBtn != null)
            {
                TitleColorBtn.Dispose();
                TitleColorBtn = null;
            }

            if (TitleSelColorBtn != null)
            {
                TitleSelColorBtn.Dispose();
                TitleSelColorBtn = null;
            }

            if (UpBtn != null)
            {
                UpBtn.Dispose();
                UpBtn = null;
            }
        }
Example #5
0
    IEnumerator TwitchHandleForcedSolve()
    {
        if (!LockUnlocked)
        {
            while (DateTime.Now.ToString("mm").Any(BombInfo.GetFormattedTime().Substring(BombInfo.GetFormattedTime().Length - 2, 2).Contains) && BombInfo.GetTime() >= 60)
            {
                yield return(true);
            }
            LockBtn.OnInteract();
            yield return(new WaitForSeconds(0.1f));
        }
        if (CurrentColumn == GoalColumn && CurrentRow == GoalRow)
        {
            string paths = Maze[0][CurrentRow, CurrentColumn].Replace(" ", "");
            int    rando = Random.Range(0, paths.Length);
            if (paths[rando] == 'U')
            {
                UpBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));

                DownBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));
            }
            else if (paths[rando] == 'L')
            {
                LeftBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));

                RightBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));
            }
            else if (paths[rando] == 'D')
            {
                DownBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));

                UpBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));
            }
            else if (paths[rando] == 'R')
            {
                RightBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));

                LeftBtn.OnInteract();
                yield return(new WaitForSeconds(0.1f));
            }
        }
        else
        {
            var q          = new Queue <int[]>();
            var allMoves   = new List <Movement>();
            var startPoint = new int[] { CurrentRow, CurrentColumn };
            var target     = new int[] { GoalRow, GoalColumn };
            q.Enqueue(startPoint);
            while (q.Count > 0)
            {
                var next = q.Dequeue();
                if (next[0] == target[0] && next[1] == target[1])
                {
                    goto readyToSubmit;
                }
                string paths         = Maze[0][next[0], next[1]];
                var    cell          = paths.Replace(" ", "");
                var    allDirections = "ULRD";
                var    offsets       = new int[, ] {
                    { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 }
                };
                for (int i = 0; i < 4; i++)
                {
                    var check = new int[] { next[0] + offsets[i, 0], next[1] + offsets[i, 1] };
                    if (cell.Contains(allDirections[i]) && !allMoves.Any(x => x.start[0] == check[0] && x.start[1] == check[1]))
                    {
                        q.Enqueue(new int[] { next[0] + offsets[i, 0], next[1] + offsets[i, 1] });
                        allMoves.Add(new Movement {
                            start = next, end = new int[] { next[0] + offsets[i, 0], next[1] + offsets[i, 1] }, direction = i
                        });
                    }
                }
            }
            throw new InvalidOperationException("There is a bug in the TP autosolver.");
readyToSubmit:
            KMSelectable[] buttons = new KMSelectable[] { UpBtn, LeftBtn, RightBtn, DownBtn };
            if (allMoves.Count != 0) // Checks for position already being target
            {
                var target2       = new int[] { target[0], target[1] };
                var lastMove      = allMoves.First(x => x.end[0] == target2[0] && x.end[1] == target2[1]);
                var relevantMoves = new List <Movement> {
                    lastMove
                };
                while (lastMove.start != startPoint)
                {
                    lastMove = allMoves.First(x => x.end[0] == lastMove.start[0] && x.end[1] == lastMove.start[1]);
                    relevantMoves.Add(lastMove);
                }
                for (int i = 0; i < relevantMoves.Count; i++)
                {
                    buttons[relevantMoves[relevantMoves.Count - 1 - i].direction].OnInteract();
                    yield return(new WaitForSeconds(.1f));
                }
            }
        }
    }
Example #6
0
    IEnumerator ProcessTwitchCommand(string command)
    {
        string[] parameters = command.Split(' ');
        if (Regex.IsMatch(command, @"^\s*real time\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
        {
            DateTime currenttime = DateTime.Now;
            yield return("sendtochat Current Date/Time: " + currenttime.ToString());
        }

        else if (Regex.IsMatch(command, @"^\s*bomb time\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
        {
            string BombTime = BombInfo.GetFormattedTime();
            yield return("sendtochat Current Bomb Time: " + BombTime);
        }

        else if (Regex.IsMatch(parameters[0], @"^\s*press\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
        {
            yield return(null);

            if (LockUnlocked == false)
            {
                yield return("sendtochaterror The lock is still locked. You are unable to interact with the arrows.");

                yield break;
            }

            if (parameters.Length == 2)
            {
                foreach (char c in parameters[1])
                {
                    if (!c.ToString().EqualsAny(ValidMovements))
                    {
                        yield return("sendtochaterror An invalid movement has been detected in the command. The command was not initiated.");

                        yield break;
                    }
                }

                foreach (char d in parameters[1])
                {
                    if (Regex.IsMatch(d.ToString(), @"^\s*u\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) || Regex.IsMatch(d.ToString(), @"^\s*n\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
                    {
                        UpBtn.OnInteract();
                        yield return(new WaitForSeconds(0.1f));
                    }

                    else if (Regex.IsMatch(d.ToString(), @"^\s*d\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) || Regex.IsMatch(d.ToString(), @"^\s*s\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
                    {
                        DownBtn.OnInteract();
                        yield return(new WaitForSeconds(0.1f));
                    }

                    else if (Regex.IsMatch(d.ToString(), @"^\s*l\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) || Regex.IsMatch(d.ToString(), @"^\s*w\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
                    {
                        LeftBtn.OnInteract();
                        yield return(new WaitForSeconds(0.1f));
                    }

                    else if (Regex.IsMatch(d.ToString(), @"^\s*r\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) || Regex.IsMatch(d.ToString(), @"^\s*e\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
                    {
                        RightBtn.OnInteract();
                        yield return(new WaitForSeconds(0.1f));
                    }
                }
            }

            else
            {
                yield return("sendtochaterror Invalid parameter length.");

                yield break;
            }
        }

        else if (Regex.IsMatch(parameters[0], @"^\s*unlock\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && parameters.Length > 1)
        {
            if (Regex.IsMatch(parameters[1], @"^\s*now\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
            {
                if (BombInfo.GetTime() < 60)
                {
                    yield return(null);

                    LockBtn.OnInteract();
                    yield break;
                }
                else
                {
                    yield return("sendtochaterror Time is not below 60 seconds. Use the command 'Unlock at' instead.");

                    yield break;
                }
            }

            else if (Regex.IsMatch(parameters[1], @"^\s*at\s*$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
            {
                yield return(null);

                if (LockUnlocked == true)
                {
                    yield return("sendtochaterror The lock is unlocked now. You are unable to unlock it again.");

                    yield break;
                }

                if (parameters.Length == 3)
                {
                    string[] timer = parameters[2].Split(':');
                    foreach (string a in timer)
                    {
                        foreach (char b in a)
                        {
                            if (!b.ToString().EqualsAny(ValidNumbers))
                            {
                                yield return("sendtochaterror Time given contains a character which is not a number.");

                                yield break;
                            }
                        }
                    }

                    if (timer.Length != 2)
                    {
                        yield return("sendtochaterror Time length given is not valid.");

                        yield break;
                    }

                    if (!timer[1].EqualsAny(SecondsAndMinutes) || timer[0].Length < 2 || (timer[0].Length > 2 && timer[0][0] == '0'))
                    {
                        yield return("sendtochaterror Time format given is not valid.");

                        yield break;
                    }

                    while (BombInfo.GetFormattedTime() != parameters[2])
                    {
                        yield return("trycancel The unlocking command was cancelled due to a cancel request.");

                        yield return(new WaitForSeconds(0.01f));
                    }

                    LockBtn.OnInteract();
                }
                else
                {
                    yield return("sendtochaterror Invalid parameter length.");

                    yield break;
                }
            }
        }
    }