asmrobot
2019-10-14 730fe7ea65bcadbe235e40bb54b2410d14495267
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using RichCreator.Utility.Structs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace RichCreator.Utility
{
    public class RandomUtils
    {
        private static Random r = new Random(DateTime.Now.Second);
        /// <summary>
        /// 产生随机数
        /// </summary>
        /// <param name="min"></param>
        /// <param name="max"></param>
        /// <returns></returns>
        public static Int32 G(Int32 min, Int32 max)
        {
            return r.Next(min, max);
        }
 
        /// <summary>
        /// 得到点击时,按下和抬起的间隔
        /// </summary>
        public static Int32 MouseClickDuration
        {
            get
            {
                Int32 r= RandomUtils.G(58, 159);
                return r;
            }
        }
 
        /// <summary>
        /// 得到点击时最小时间,按下和抬起的间隔
        /// </summary>
        public static Int32 MouseClickDurationMin
        {
            get
            {
                return 58;
            }
        }
 
 
 
 
        /// <summary>
        /// 鼠标每次移动距离
        /// </summary>
        public static Int32 MouseMoveDistance
        {
            get
            {
                return G(30, 57);
            }
        }
 
        /// <summary>
        /// 鼠标每次移动时间
        /// </summary>
        public static Int32 MouseMoveDuration
        {
            get
            {
                return G(10, 15);
            }
        }
 
        /// <summary>
        /// 按键时,键盘按下和弹起的时间间隔
        /// </summary>
        public static Int32 KeyPressDuration
        {
            get
            {
                return G(KeyPressDurationMin, KeyPressDurationMax);
            }
        }
 
 
        /// <summary>
        /// 按键时,键盘按下和弹起的时间间隔最小值
        /// </summary>
        public const Int32 KeyPressDurationMin = 80;
 
        /// <summary>
        /// 按键时,键盘按下和弹起的时间间隔最大值
        /// </summary>
        public const Int32 KeyPressDurationMax = 176;
 
        /// <summary>
        /// 让点在范围内随机
        /// </summary>
        /// <param name="point"></param>
        /// <param name="range"></param>
        /// <returns></returns>
        public static ZTPoint PointRange(ZTPoint point, Int32 range)
        {
            return point.Add(G(0, range));
        }
    }
}