Example #1
0
        private async void button4_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 3; i++)
            {
                dm.KeyPress(Keys.Escape);
                await Task.Delay(20);
            }
            var px = getPoint(tb_cood.Text);

            dm.KeyPress(Keys.M);
            await Task.Delay(1000);

            var p = dm.FindPic(0, 0, 2000, 2000, "resources/自动寻路.bmp|resources/自动寻路2.bmp");

            dm.MoveTo(p.X + 120, p.Y - 8);
            dm.LeftDoubleClick();
            dm.SendString(hwnd, px.X + "");
            await Task.Delay(60);

            dm.MoveTo(p.X + 120, p.Y + 26);
            dm.LeftDoubleClick();
            dm.SendString(hwnd, px.Y + "");
            await Task.Delay(60);

            dm.MoveTo(p.X, p.Y);
            dm.LeftClick();
            if (chb_direct_fly.Checked)
            {
                var x1 = p.X - 450;
                var y1 = p.Y - 450;
                var x2 = p.X + 200;
                var y2 = p.Y;
                await Task.Delay(1000);

                p = dm.FindPic(x1, y1, x2, y2, "resources/flag.bmp");
                dm.MoveTo(p.X + 1, p.Y + 17);
                dm.LeftClick();
                await Task.Delay(1000);

                p = dm.FindPic(x1, y1, x2, y2, "resources/cloud.bmp");
                dm.MoveTo(p.X + 4, p.Y + 4);
                dm.LeftClick();
            }
        }
Example #2
0
 public void dblclick(int x, int y)
 {
     dm.MoveTo(x, y);
     dm.LeftDoubleClick();
 }