private async Task IsFishComboEvent(IntPtr hWnd, SearchImage.RECT rect) { Point Scan = Point.Empty; while (!SearchImage.PixelSearch(SearchImage.GetBitmapArea(target, 305, 380, 325, 400), FishColorEvent).IsEmpty&& !IsFinished) { target2 = SearchImage.CaptureWindow(hWnd, rect.Right, rect.Bottom); if (!SearchImage.Find(target2, Resources.fish_Arrow_left, out Scan).IsEmpty&& !IsFinished) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_LEFT, 5); await Task.Delay(80); } if (!SearchImage.Find(target2, Resources.fish_Arrow_top, out Scan).IsEmpty&& !IsFinished) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_UP, 5); await Task.Delay(80); } if (!SearchImage.Find(target2, Resources.fish_Arrow_right, out Scan).IsEmpty&& !IsFinished) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_RIGHT, 5); await Task.Delay(80); } if (!SearchImage.Find(target2, Resources.fish_Arrow_Bottom, out Scan).IsEmpty&& !IsFinished) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_DOWN, 5); await Task.Delay(80); } await Task.Delay(20); } }
public async void RunTask(IntPtr hWnd, int Amount, SearchImage.RECT rect, int BotID, bool UseRewardCoupon) { Console.WriteLine("SawMill Bot created for HWID: {0}, Bot ID: {1}, Times: {2}", hWnd, BotID, Amount); IsFinished = true; IsFailed = false; Times = 0; Point Scan; Bitmap target; while (Program.botRunning) { int RandomStep = new Random().Next(0, 5); target = SearchImage.CaptureWindow(hWnd, rect.Right, rect.Bottom); if (!SearchImage.Find(target, Resources.chicken_right, out Scan).IsEmpty) { await Task.Delay(10); await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_RIGHT, 5); } await Task.Delay(10); } Console.WriteLine("SawMill Bot Stopped for HWID: {0}, Bot ID: {1}, Times played: {2}/{3}", hWnd, BotID, Times, Amount); }
public async void RunTask(IntPtr hWnd, int Amount, SearchImage.RECT rect, int BotID, bool UseRewardCoupon) { Console.WriteLine("Quarry Bot created for HWID: {0}, Bot ID: {1}, Times: {2}", hWnd, BotID, Amount); IsFinished = true; IsFailed = false; Times = 0; Point Scan; Bitmap target; while (Program.botRunning) { int RandomStep = new Random().Next(0, 5); target = SearchImage.CaptureWindow(hWnd, rect.Right, rect.Bottom); if (!IsFinished) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_UP, 5); if (!SearchImage.PixelSearch(SearchImage.GetBitmapArea(target, 387, 527, 422, 572), WormColorLeft).IsEmpty) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_LEFT, 5); await Task.Delay(50); } if (!SearchImage.PixelSearch(SearchImage.GetBitmapArea(target, 580, 520, 635, 585), WormColorRight).IsEmpty) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_RIGHT, 5); await Task.Delay(50); } if (!SearchImage.Find(target, Resources.Score_Stone, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Enough Points!"); await Task.Delay(6000); IsFinished = true; } if (!SearchImage.Find(target, Resources.Failed_Stone, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Failed, Retry!"); await BackgroundHelper.SendClick(hWnd, 377, 435, 250); await Task.Delay(1500); IsFailed = true; IsFinished = true; } } if (IsFinished) { //Console.WriteLine("Finished!"); if (!SearchImage.Find(target, Resources.Reward_Button_Stone, out Scan).IsEmpty&& !IsFailed) { Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Click Reward Button!"); await BackgroundHelper.SendClick(hWnd, Scan.X + 25, Scan.Y + 15, 250); await Task.Delay(1000); } if (!SearchImage.Find(target, Resources.Level5, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Click Level 5 Button!"); await BackgroundHelper.SendClick(hWnd, Scan.X + 5, Scan.Y + 5, 250); await Task.Delay(500); if (UseRewardCoupon) { await BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_RETURN, 50); await Task.Delay(250); } } if (!SearchImage.Find(target, Resources.TryAgain_Stone, out Scan).IsEmpty) { Console.WriteLine("Bot:" + BotID + "(FishPond): Finished! Played: " + Times + "/" + Amount); Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Click Try Again Button!"); await BackgroundHelper.SendClick(hWnd, 456, 464, 250); await Task.Delay(1000); Times++; if (Times >= Amount) { MessageBox.Show("Done!"); while (Program.botRunning) { await Task.Delay(100); } } } if (!SearchImage.Find(target, Resources.Start_Stone, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(Quarry): " + "Click Start Button!"); await Task.Delay(500); await BackgroundHelper.SendClick(hWnd, Scan.X + 50, Scan.Y + 30, 250); await Task.Delay(2000); IsFinished = false; IsFailed = false; } } await Task.Delay(10); } Console.WriteLine("Quarry Bot Stopped for HWID: {0}, Bot ID: {1}, Times played: {2}/{3}", hWnd, BotID, Times, Amount); }
public async void RunTask(IntPtr hWnd, int Amount, SearchImage.RECT rect, int BotID, bool UseRewardCoupon) { Console.WriteLine("SawMill Bot created for HWID: {0}, Bot ID: {1}, Times: {2}", hWnd, BotID, Amount); IsFinished = true; IsFailed = false; Times = 0; Point Scan; Bitmap target; while (Program.botRunning) { int RandomStep = new Random().Next(0, 5); target = SearchImage.CaptureWindow(hWnd, rect.Right, rect.Bottom); if (!SearchImage.PixelSearch(SearchImage.GetBitmapArea(target, 425, 399, 475, 449), SawColorLeft).IsEmpty&& !IsFinished) { await Task.Delay(10); BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_LEFT, 5); } if (!SearchImage.PixelSearch(SearchImage.GetBitmapArea(target, 427, 500, 479, 547), SawColorLeft).IsEmpty&& !IsFinished) { await Task.Delay(10); BackgroundHelper.SendKey(hWnd, BackgroundHelper.KeyCodes.VK_RIGHT, 5); } if (!SearchImage.Find(target, Resources.Score_SawMill, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + " Enough Points!"); await Task.Delay(3000); IsFinished = true; } if (!SearchImage.Find(target, Resources.Failed_SawMill, out Scan).IsEmpty&& !IsFinished) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + " Failed, Retry!"); BackgroundHelper.SendClick(hWnd, Scan.X + 5, Scan.Y + 5, 250); await Task.Delay(1500); IsFinished = !IsFinished; } if (IsFinished) { if (!SearchImage.Find(target, Resources.Reward_Button_SawMill, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + "Click Reward Button!"); BackgroundHelper.SendClick(hWnd, Scan.X + 25, Scan.Y + 15, 250); await Task.Delay(1000); } if (!SearchImage.Find(target, Resources.Level5, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + "Click Level 5 Button!"); //BackgroundHelper.SendClick(hWnd, Scan.X +5, Scan.Y +5, 250); await Task.Delay(1000); } if (!SearchImage.Find(target, Resources.TryAgain, out Scan).IsEmpty) { if (Times >= Amount) { Console.WriteLine("Done!"); while (Program.botRunning) { await Task.Delay(100); } } Times++; Console.WriteLine("BOT: " + BotID + "(SawMill): " + "Click Try Again Button!"); BackgroundHelper.SendClick(hWnd, Scan.X + 20, Scan.Y + 5, 250); await Task.Delay(1000); } if (!SearchImage.Find(target, Resources.Start_SawMill, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + "Click Start Button!"); await Task.Delay(500); BackgroundHelper.SendClick(hWnd, Scan.X + 50, Scan.Y + 30, 250); await Task.Delay(2000); IsFinished = !IsFinished; } if (!SearchImage.Find(target, Resources.NoPoints, out Scan).IsEmpty) { Console.WriteLine("BOT: " + BotID + "(SawMill): " + "No Points Left!"); } } await Task.Delay(10); } Console.WriteLine("SawMill Bot Stopped for HWID: {0}, Bot ID: {1}, Times played: {2}/{3}", hWnd, BotID, Times, Amount); }