//九天到票检测 public static bool OverCheck(ref int s) { IntPtr hwnd = HwndUtil.FindWindow("WTWindow", null); if (hwnd == IntPtr.Zero) { s++; } else { s = 0; } if (s > 5) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDropedTemp(); } ConfigCore.WriteOver(); return(true); } return(false); }
public static bool ExcpCheck() { IntPtr hwnd = HwndUtil.FindWindow("#32770", "信息:"); if (hwnd != IntPtr.Zero) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDroped(false); } HwndUtil.closeHwnd(hwnd); return(true); } return(false); }
//MM到票检测 public static bool OverCheck() { IntPtr hwnd = HwndUtil.FindWindow(null, "投票软件提示"); if (hwnd != IntPtr.Zero) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDropedTemp(); } HwndUtil.closeHwnd(hwnd); ConfigCore.WriteOver(); return(true); } return(false); }
/// <summary> /// Performs the automatic vote action based on the type of vote. /// </summary> /// <param name="vote">The vote.</param> private async Task PerformAutoVoteAction(AutoVote vote) { await _sst.QlCommands.SendToQlAsync( (vote.IntendedResult == IntendedVoteResult.Yes ? "vote yes" : "vote no"), false); await _sst.QlCommands.QlCmdSay( string.Format( "^7[{0}^7] ^3{1}^7 matches {0}^7 rule set by ^3{2}. {3}", (vote.IntendedResult == IntendedVoteResult.Yes ? "^2AUTO YES" : "^1AUTO NO"), vote.VoteText, vote.AddedBy, (vote.IntendedResult == IntendedVoteResult.Yes ? "^2Passing..." : "^1Rejecting...")), false); Log.Write(string.Format("Automatically {0} matched vote: {1} (added by: {2})", (vote.IntendedResult == IntendedVoteResult.Yes ? "passing" : "rejecting..."), vote.VoteText, vote.AddedBy), _logClassType, _logPrefix); }
public static bool ErrCheck() { IntPtr hwnd = HwndUtil.FindWindow("#32770", null); if (hwnd != IntPtr.Zero) { string txt = HwndUtil.GetControlText(hwnd); if (txt.IndexOf("错误") != -1) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDroped(false); } HwndUtil.closeHwnd(hwnd); return(true); } } return(false); }
//九天验证码输入检测 public static bool IsIdentifyCode() { if (MonitorCore.GetTaskCore().IsAutoVote&& ConfigCore.IsAdsl) { return(false); } IntPtr hwnd = HwndUtil.FindWindow("WTWindow", null); IntPtr hwndSysTabControl32 = HwndUtil.FindWindowEx(hwnd, IntPtr.Zero, "SysTabControl32", ""); IntPtr testHwnd = HwndUtil.FindWindowEx(hwndSysTabControl32, IntPtr.Zero, "Button", "输入验证码后回车,看不清直接回车切换"); if (testHwnd != IntPtr.Zero) { if (MonitorCore.GetTaskCore().IsAutoVote) { AutoVote.AddVoteProjectNameDroped(false); } ProgressCore.KillProcess(false); return(true); } return(false); }
//timer private void timer1_Tick(object sender, EventArgs e) { AutoVote.CheckSucc(); }