public void Execute() { // TODO : Implement gold, elixir, dark elixir image for clicking Bitmap Gold = null; // Gold Image Bitmap Elixir = null; // Elixir Image Bitmap DarkElixir = null; // DE Image float Similarity = 0.98f; List <Point> CollectIcons = new List <Point>(); // Find Collect Gold Icons and Add To List CollectIcons.AddRange(BlueStacks.TemplateMatch(Gold, Similarity)); // and Elixir... CollectIcons.AddRange(BlueStacks.TemplateMatch(Elixir, Similarity)); // and Dark Elixir CollectIcons.AddRange(BlueStacks.TemplateMatch(DarkElixir, Similarity)); // Sort Icons Points CollectIcons.Sort(); // And Click The Points One by One foreach (Point point in CollectIcons) { BlueStacks.MouseClick(point); } }
/** * Blue Stack 화면 캡쳐 */ public void capture(BlueStacks bs) { /* 윈도우 현재 위치 가져오기 */ if (bs.find(bs.HWnd) == false) { // MessageBox.Show("Start 버튼 클릭 후 캡쳐해 주세요."); return; } /* 현재 화면 캡쳐 */ Bitmap bmp = new Bitmap(bs.Width, bs.Height); //bmp = Window((IntPtr)blueStack.HWnd, blueStack.Left, blueStack.Top, blueStack.Width, blueStack.Height); using (Graphics gr = Graphics.FromImage(bmp)) { gr.CopyFromScreen(bs.Left, bs.Top, 0, 0, bmp.Size); //bool b = PrintWindow((IntPtr)blueStack.HWnd, gr.GetHdc(), 0); //SendMessage((IntPtr)blueStack.HWnd, WM_PRINTCLIENT, gr.GetHdc(), (IntPtr)COMBINED_PRINTFLAGS); } /* 캡쳐화면 모니터링 */ #if DEBUG picMonitor.Image = bmp; #endif // 선택영역 사각형용 그래픽스 객체 생성 gPen = picMonitor.CreateGraphics(); }
/// <summary> /// Click Button /// </summary> public bool Click() { Point btnStartPoint, btnEndPoint; // Use Point if (Rect != Rectangle.Empty) { btnStartPoint = new Point(Rect.X, Rect.Y); btnEndPoint = new Point(Rect.X + Rect.Width, Rect.Y + Rect.Height); } else // Find Button Image and Click { btnStartPoint = BlueStacks.TemplateMatch(this.ButtonImage, 0.99f)[0]; if (btnStartPoint != null) { return(false); } btnEndPoint = new Point(btnStartPoint.X + ButtonImage.Width, btnStartPoint.Y + ButtonImage.Height); } // Click BlueStacks.MouseClick(PointUtils.RandomPoint(btnStartPoint, btnEndPoint)); return(true); }
public static void Execute() { Bitmap Tombstone = null; // Tombstone Image // Find Tombstones // Select First From List // Send Click BlueStacks.MouseClick(BlueStacks.TemplateMatch(Tombstone, 0.986f).FirstOrDefault()); }
public static void Execute() { while (!ColorPoints.Village_ZoomOut.Present) { // Send Key BlueStacks.Send("{DOWN}"); // Random Delay For Work Like Human Thread.Sleep(Base.BasicMath.RandomInt(100, 1500)); } }
/// <summary> /// Is Windows Present on Screen /// </summary> /// <param name="matchSimilarity"></param> /// <returns></returns> public bool isPresent(float matchSimilarity = 98.3f) { // search window image on screen , if any coord found return true, else return false if (BlueStacks.TemplateMatch(this.Image, matchSimilarity).Count() < 0) { return(true); } else { return(false); } }
public void Execute() { // TODO : Implement GemBox image Bitmap GemBox = null; // Gembox Image List <Point> GemBoxs = BlueStacks.TemplateMatch(GemBox, 0.982f); foreach (Point gembox in GemBoxs) { // Select GemBox BlueStacks.MouseClick(gembox); if (!Buttons.Remove_GemBox.Click()) { // ERR } // Deselect Gem Box BlueStacks.MouseClick(1, 1); } }
private void btCapture_Click(object sender, EventArgs e) { BlueStacks bs = new BlueStacks(); capture(bs); }