public void BotStep() { var botMotionEnable = this.BotMotionEnable; if (!botMotionEnable) { return; } BotStepLastTime = Bib3.Glob.StopwatchZaitMiliSictInt(); Task.Run(() => { BotStepLock.IfLockIsAvailableEnter(() => { Bot.Step(Bib3.Glob.StopwatchZaitMiliSictInt(), BrowserService); LogEntryWrite(new LogEntry { BotStepCompleted = Bot.StepLastReport?.Value, }); BotStepLastTime = Bib3.Glob.StopwatchZaitMiliSictInt(); Dispatcher.Invoke(() => { BotControl.Present(Bot); }); }); }); }
public void BotStep() { BotStepLastTime = Bib3.Glob.StopwatchZaitMiliSictInt(); var BotMotionEnable = this.BotMotionEnable; Bot.WindowHandle = PickWindowControl.PickLastWindowHandle; var serviceDelegate = ServiceDelegate; if (null == serviceDelegate) { return; } if (!(BotMotionEnable || TakeScreenshotWhenPaused)) { return; } Task.Run(() => { BotStepLock.InvokeIfNotLocked(() => { Bot.Step(BotMotionEnable, serviceDelegate); BotStepLastTime = Bib3.Glob.StopwatchZaitMiliSictInt(); Dispatcher.Invoke(() => { BotControl.Present(Bot); }); }); }); }
void TimerElapsedLocked() { ProcessInput(); var licenseClientConfig = (ConfigFromViewToModel()?.LicenseClient).CompletedWithDefault().WithRequestLicenseKey(LicenseKeyStore?.Load() ?? ExeConfig.ConfigLicenseKeyDefault); Task.Run(() => { var exchangeReport = InterfaceServerDispatcher?.Exchange(licenseClientConfig, null == AppInterface ? (int?)null : 1000); if (null != exchangeReport) { LogEntryWrite(new LogEntry { InterfaceServerDispatcherExchange = exchangeReport, }); } }); EnsureAppInterfaceLogged(); PresentUI(); var botStepLastAge = Bib3.Glob.StopwatchZaitMiliSictInt() - BotStepLastTime; if (!(botStepLastAge < BotStepDistance)) { BotStep(); } var browserProcessCreationLast = this.BrowserProcessCreationLast; Task.Run(() => { if (null != browserProcessCreationLast?.Value && BrowserConnectionMeasureLocationRateLimitState.AttemptPassStopwatchMilli(3000)) { browserProcessCreationLast.Value.DocumentLocationHrefMeasurementLast = FarmManager.Extension.InvokeTimespanFromStopwatchMilli(() => browserProcessCreationLast?.Value?.BrowserConnectionOrError?.Result?.Document?.Result?.locationHref); } }); if (BotPresentRateLimitState.AttemptPassStopwatchMilli(1000)) { BotControl.Present(Bot); } if (InputBrowserProcessStartAutomaticEnable && (browserProcessCreationLast?.Begin ?? 0) < BotStepLastTime) { var botRequestBrowserProcessStart = Bot?.StepLastReport?.Value?.RequestBrowserProcessStart; if (0 < botRequestBrowserProcessStart?.Length) { if (BrowserProcessStartAutomaticRateLimitState.AttemptPassStopwatchMilli(BrowserStartAutomaticDistanceMin)) { BrowserProcessCreate("Bot: " + botRequestBrowserProcessStart); } } } }