void EchoFilter_ServerDispatch(object sender, NetworkMessageEventArgs e) { try { if (!Settings.SettingsManager.Tinkering.AutoClickYes.Value) { return; } if (e.Message.Type == 0xF7B0 && (int)e.Message["event"] == 0x0274 && e.Message.Value <int>("type") == 5) { Match match = PercentConfirmation.Match(e.Message.Value <string>("text")); if (match.Success) { int percent; if (int.TryParse(match.Groups["percent"].Value, out percent) && percent >= MinimumYesPercent) { PostMessageTools.ClickYes(); } } } } catch (Exception ex) { Debug.LogException(ex); } }
void EchoFilter_ServerDispatch(object sender, NetworkMessageEventArgs e) { try { if (lastActionThatCouldRequireConfirmation != DateTime.MinValue && DateTime.UtcNow - lastActionThatCouldRequireConfirmation < TimeSpan.FromSeconds(5)) { if (e.Message.Type == 0xF7B0 && (int)e.Message["event"] == 0x0274 && e.Message.Value <int>("type") == 5) // 0x0274 = Confirmation Panel { lastActionThatCouldRequireConfirmation = DateTime.MinValue; PostMessageTools.ClickYes(); } } } catch (Exception ex) { Debug.LogException(ex); } }