private void TBInGameEvents() { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Move)) { SetCursorPos((LibImg.Move.Width / 2), (LibImg.Move.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(900, 1700); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Moving"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Select_Way) && (APIDetector.CheckEventPos(LiveDBZ, LibImg.Way_Arrow) || APIDetector.CheckEventPos(LiveDBZ, LibImg.Way_ArrowD))) { for (int m = 0; m < 3; m += 1) { SetCursorPos((LibImg.Way_Arrow.Width / 2) + 5, (LibImg.Way_Arrow.Height / 2) + 7 - m); SetCursorPos((LibImg.Way_ArrowD.Width / 2) + 7 - m, (LibImg.Way_ArrowD.Height / 2) + 5); } DoMouseClick(); timer1.Interval = RandomTimer(250, 1000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Choosing Way"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Item_Game) && !APIDetector.CheckEventPos(LiveDBZ, LibImg.Move)) { SetCursorPos((LibImg.Item_Game.Width / 2), (LibImg.Item_Game.Height - 320)); DoMouseClick(); timer1.Interval = RandomTimer(550, 600); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Fighting"); } else { Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 250); DoMouseClick(); timer1.Interval = RandomTimer(1000, 2000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Misc Event"); } }
public void BotUpdateEVent() { LiveDBZ = APIDetector.AppScreen.CaptureApplication("Nox"); if (checkBoxTB.Checked) { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Item_Game)) { TBInGameEvents(); } else { TBGameEvents(); DSRefillLbl.Text = Story.DSToRefill.ToString(); } } else { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Item_Game)) { InGameEvents(); } else { GameEvents(); GameDoneLbl.Text = Story.GameDone.ToString(); DSRefillLbl.Text = Story.DSToRefill.ToString(); } EventBotLogs.ScrollToCaret(); } }
private void button4_Click(object sender, EventArgs e) { LiveDBZ = APIDetector.AppScreen.CaptureApplication("Nox"); //Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 250); if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Select_Way) && APIDetector.CheckEventPos(LiveDBZ, LibImg.Way_Arrow)) { for (int m = 0; m < 3; m += 1) { SetCursorPos((LibImg.Way_Arrow.Width / 2) + 5, (LibImg.Way_Arrow.Height / 2) + 7 - m); } } //Thread.Sleep(250); //DoMouseClick(); }
public static Boolean CheckEventPos(Bitmap Large, Bitmap Small) { Bitmap bitmap1 = Large; Bitmap bitmap2 = Small; if (bitmap1.Width > bitmap2.Width || bitmap1.Height > bitmap2.Height) { Bitmap aux = bitmap2; bitmap2 = bitmap1; bitmap1 = aux; } if (bitmap1.Height > bitmap2.Height) { MessageBox.Show("None of the Bitmaps can contain the other.", "Data error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } Rectangle location = Rectangle.Empty; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); location = APIDetector.autoSearchBitmap(bitmap1, bitmap2); stopWatch.Stop(); if (location.Width != 0) { APIDetector.AppScreen.GetPos.CursorX.X = location.X; APIDetector.AppScreen.GetPos.CursorY.Y = location.Y; return(true); } else { return(false); } bitmap1.Dispose(); bitmap2.Dispose(); }
private void TBGameEvents() { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Participe_TB)) { SetCursorPos((LibImg.Participe_TB.Width / 2) - 120, (LibImg.Participe_TB.Height / 2) - 50); DoMouseClick(); timer1.Interval = RandomTimer(500, 1050); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Participating TB"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.DifficultyX2)) { SetCursorPos((LibImg.DifficultyX2.Width / 2), (LibImg.DifficultyX2.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1050); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Difficulty Selected"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Next_TB)) { SetCursorPos((LibImg.Next_TB.Width / 2), (LibImg.Next_TB.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1050); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Round Confirmed"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Friend_Request)) { SetCursorPos((LibImg.Friend_Request.Width / 2), (LibImg.Friend_Request.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1050); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Friend Request"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Cancel_DS)) { if (!AutoRestoreACTCheck.Checked) { SetCursorPos((LibImg.Cancel_DS.Width / 2), (LibImg.Cancel_DS.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(800000, 1500000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Out of ACT, Next Check in " + TimeSpan.FromMilliseconds(timer1.Interval).ToString("mm':'ss")); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Out of ACT, Next Check in " + TimeSpan.FromMilliseconds(timer1.Interval).ToString("mm':'ss")); } else { if (Story.DSToRefill < NbDS.Value && NbDS.Value != 0) { SetCursorPos((LibImg.Cancel_DS.Width / 2) + 150, (LibImg.Cancel_DS.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1500); Story.DSToRefill = Story.DSToRefill + 1; EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " ACT Restored"); } else if (Story.DSToRefill >= NbDS.Value && NbDS.Value != 0) { AutoRestoreACTCheck.Checked = false; } } } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Friend_Selection)) { SetCursorPos((LibImg.Friend_Selection.Width - 150), (LibImg.Friend_Selection.Height - 240)); DoMouseClick(); timer1.Interval = RandomTimer(200, 550); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Friend Selected"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Start_Game)) { SetCursorPos((LibImg.Start_Game.Width / 2), (LibImg.Start_Game.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(1200, 2550); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Game Started"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.OK_End_Game)) { SetCursorPos((LibImg.OK_End_Game.Width / 2), (LibImg.OK_End_Game.Height / 2)); DoMouseClick(); Thread.Sleep(250); timer1.Interval = RandomTimer(1000, 1550); Story.GameDone = Story.GameDone + 1; EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " OK Button"); } else { Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 250); DoMouseClick(); Thread.Sleep(250); Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 495); DoMouseClick(); timer1.Interval = RandomTimer(900, 1700); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Misc Event"); } }
private void GameEvents() { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Friend_Request)) { SetCursorPos((LibImg.Friend_Request.Width / 2), (LibImg.Friend_Request.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1050); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Friend Request"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.RestoreACT)) { if (AutoRestoreACTCheck.Checked) { if (NbDS.Value > Story.DSToRefill && NbDS.Value != 0) { SetCursorPos((LibImg.RestoreACT.Width / 2), (LibImg.RestoreACT.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(500, 1550); } else { AutoRestoreACTCheck.Checked = false; } } else { SetCursorPos((LibImg.RestoreACT.Width / 2) - 180, (LibImg.RestoreACT.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(800000, 1500000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Out of ACT, Next Check in " + TimeSpan.FromMilliseconds(timer1.Interval).ToString("mm':'ss")); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Out of ACT, Next Check in " + TimeSpan.FromMilliseconds(timer1.Interval).ToString("mm':'ss")); } } //else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.ACTRestored)) //{ // SetCursorPos((LibImg.ACTRestored.Width / 2), (LibImg.ACTRestored.Height / 2)); // DoMouseClick(); // timer1.Interval = RandomTimer(500, 1500); // Story.DSToRefill = Story.DSToRefill + 1; // EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " ACT Restored"); //} else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Friend_Selection)) { SetCursorPos((LibImg.Friend_Selection.Width - 150), (LibImg.Friend_Selection.Height - 240)); DoMouseClick(); timer1.Interval = RandomTimer(200, 550); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Friend Selected"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Start_Game)) { SetCursorPos((LibImg.Start_Game.Width / 2), (LibImg.Start_Game.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(1200, 2550); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Game Started"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_N) || APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_H) || APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_ZH) || APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_SU) || APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_SU2)) { if (CSelectDifficulty.SelectedIndex == 0) { APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_N); SetCursorPos((LibImg.Difficulty_N.Width / 2), (LibImg.Difficulty_N.Height / 2)); } else if (CSelectDifficulty.SelectedIndex == 1) { APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_H); SetCursorPos((LibImg.Difficulty_H.Width / 2), (LibImg.Difficulty_H.Height / 2)); } else if (CSelectDifficulty.SelectedIndex == 2) { APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_ZH); SetCursorPos((LibImg.Difficulty_ZH.Width / 2), (LibImg.Difficulty_ZH.Height / 2)); } else if (CSelectDifficulty.SelectedIndex == 3) { APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_SU); SetCursorPos((LibImg.Difficulty_SU.Width / 2), (LibImg.Difficulty_SU.Height / 2)); } else if (CSelectDifficulty.SelectedIndex == 4) { APIDetector.CheckEventPos(LiveDBZ, LibImg.Difficulty_SU2); SetCursorPos((LibImg.Difficulty_SU2.Width / 2), (LibImg.Difficulty_SU2.Height / 2)); } DoMouseClick(); timer1.Interval = RandomTimer(550, 1500); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Difficulty " + CSelectDifficulty.Text + " Selected"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.OK_End_Game))// || APIDetector.CheckEventPos(LiveDBZ, LibImg.OK_N21_L1)) { SetCursorPos((LibImg.OK_End_Game.Width / 2), (LibImg.OK_End_Game.Height / 2)); DoMouseClick(); Thread.Sleep(250); //SetCursorPos((LibImg.OK_N21_L1.Width / 2), (LibImg.OK_N21_L1.Height / 2)); //DoMouseClick(); timer1.Interval = RandomTimer(1000, 1550); Story.GameDone = Story.GameDone + 1; EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Game Ended"); } else { Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 250); DoMouseClick(); Thread.Sleep(250); Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 200, APIDetector.AppScreen.GetPos.AppTopLoc + 500); DoMouseClick(); timer1.Interval = RandomTimer(900, 1700); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Unknown Event"); } }
private void InGameEvents() { if (APIDetector.CheckEventPos(LiveDBZ, LibImg.OK_Wrong_Way)) { SetCursorPos((LibImg.OK_Wrong_Way.Width / 2), (LibImg.OK_Wrong_Way.Height / 2)); DoMouseClick(); timer1.Interval = RandomTimer(150, 300); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Hard Way Unavailable"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Move)) { if (CSelectDice.SelectedIndex == 0) { SetCursorPos(LibImg.Move.Width - 230, LibImg.Move.Height + 20); } else if (CSelectDice.SelectedIndex == 1) { SetCursorPos((LibImg.Move.Width - 115), (LibImg.Move.Height + 10)); } else if (CSelectDice.SelectedIndex == 2) { SetCursorPos((LibImg.Move.Width / 2), (LibImg.Move.Height / 2)); } else { CSelectDice.SelectedIndex = new Random().Next(0, 2); } DoMouseClick(); timer1.Interval = RandomTimer(900, 1700); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Moving"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Select_Way)) { if (CSelectDice.SelectedIndex == 0) { if (CkWayL.Checked) { SetCursorPos((LibImg.Select_Way.Width + 10), (LibImg.Select_Way.Height - 285)); Thread.Sleep(250); DoMouseClick(); } if (CkWayR.Checked) { SetCursorPos((LibImg.Select_Way.Width + 150), (LibImg.Select_Way.Height - 220)); Thread.Sleep(250); DoMouseClick(); } if (CkWayT.Checked) { SetCursorPos((LibImg.Select_Way.Width + 150), (LibImg.Select_Way.Height - 285)); Thread.Sleep(250); DoMouseClick(); } if (CkWayD.Checked) { SetCursorPos((LibImg.Select_Way.Width + 20), (LibImg.Select_Way.Height - 220)); Thread.Sleep(250); DoMouseClick(); } } else if (CSelectDice.SelectedIndex == 1) { SetCursorPos((LibImg.Move.Width / 2), (LibImg.Move.Height / 2)); } else { if (CkWayL.Checked) { if (CkWayL.Checked) { if (CkWayL.Checked) { SetCursorPos((LibImg.Select_Way.Width - 75), (LibImg.Select_Way.Height - 200)); //DoMouseClick(); } } } if (CkWayR.Checked) { SetCursorPos((LibImg.Select_Way.Width - 70), (LibImg.Select_Way.Height - 250)); DoMouseClick(); } if (CkWayT.Checked) { SetCursorPos((LibImg.Select_Way.Width - 200), (LibImg.Select_Way.Height - 250)); DoMouseClick(); } if (CkWayD.Checked) { SetCursorPos((LibImg.Select_Way.Width - 75), (LibImg.Select_Way.Height - 200)); DoMouseClick(); } } //DoMouseClick(); timer1.Interval = RandomTimer(250, 1000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Choosing Way"); } else if (APIDetector.CheckEventPos(LiveDBZ, LibImg.Item_Game) && !APIDetector.CheckEventPos(LiveDBZ, LibImg.Move)) { SetCursorPos((LibImg.Item_Game.Width / 2), (LibImg.Item_Game.Height - 320)); DoMouseClick(); timer1.Interval = RandomTimer(550, 1000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Fighting"); } else { Cursor.Position = new Point(APIDetector.AppScreen.GetPos.AppLeftLoc + 250, APIDetector.AppScreen.GetPos.AppTopLoc + 250); DoMouseClick(); timer1.Interval = RandomTimer(1000, 2000); EventBotLogs.AppendText("\r\n" + DateTime.Now.ToString() + " Unknown Event"); } }