static void RunCycle() { //Press button to start ServoTool.PressButton(); //Delay a small amount Thread.Sleep(1000); //Run attempts RunAttempt(); RunAttempt(); RunAttempt(); //Wait a little bit at the end Thread.Sleep(300); }
static void RunAttempt() { //Log Console.WriteLine($"[ATTEMPT] Attempting {codes[pinIndex]}, index {pinIndex}"); //Push button ServoTool.PressButton(); //Delay Thread.Sleep(600); //Speak code PinVoiceTools.PlayPinCode(codes[pinIndex]); //Delay Thread.Sleep(1000); //Begin recording ResponseRecordTools.RecordResponse($"Session\\attempt_{pinIndex}", 5000); //Add to current value and save pinIndex++; File.WriteAllText("Session\\location.txt", pinIndex.ToString()); }