示例#1
0
 /// <summary>
 /// 滑动操作
 /// </summary>
 /// <param name="_dm"></param>
 /// <param name="x1"></param>
 /// <param name="y1"></param>
 /// <param name="x2"></param>
 /// <param name="y2"></param>
 /// <param name="mousedelay">鼠标每步延时</param>
 /// <param name="mousestep">鼠标步长</param>
 public static void Swipe(this DmPlugin _dm, int x1, int y1, int x2, int y2, int mousedelay = 30, int mousestep = 10)
 {
     _dm.EnableRealMouse(1, mousedelay, mousestep);
     _dm.MoveTo(x1, y1);
     _dm.Delay(50);
     _dm.LeftDown();
     _dm.Delay(50);
     _dm.MoveTo(x2, y2);
     _dm.Delay(50);
     _dm.LeftUp();
     _dm.Delay(50);
     _dm.EnableRealMouse(0, mousedelay, mousestep);
 }
示例#2
0
        /// <summary>
        /// 防封,移动鼠标单击
        /// </summary>
        /// <param name="dm"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public static bool PMoveToClick(this DmPlugin dm, int x, int y)
        {
            int flag = dm.MoveTo(x, y);

            dm.Delay(dm.RanNumber(50, 200));

            int a = dm.LeftDown();

            dm.Delay(dm.RanNumber(50, 200));
            int sjx = dm.RanNumber(1, 5);
            int sjy = dm.RanNumber(1, 5);
            int b   = dm.MoveTo(x + sjx, y + sjy);
            int c   = dm.LeftUp();

            return(a == 1 && b == 1 && c == 1 && flag == 1 ? true : false);
        }