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);
///
/// 产生随机数
///
///
///
///
public static Int32 G(Int32 min, Int32 max)
{
return r.Next(min, max);
}
///
/// 得到点击时,按下和抬起的间隔
///
public static Int32 MouseClickDuration
{
get
{
Int32 r= RandomUtils.G(58, 159);
return r;
}
}
///
/// 得到点击时最小时间,按下和抬起的间隔
///
public static Int32 MouseClickDurationMin
{
get
{
return 58;
}
}
///
/// 鼠标每次移动距离
///
public static Int32 MouseMoveDistance
{
get
{
return G(30, 57);
}
}
///
/// 鼠标每次移动时间
///
public static Int32 MouseMoveDuration
{
get
{
return G(10, 15);
}
}
///
/// 按键时,键盘按下和弹起的时间间隔
///
public static Int32 KeyPressDuration
{
get
{
return G(KeyPressDurationMin, KeyPressDurationMax);
}
}
///
/// 按键时,键盘按下和弹起的时间间隔最小值
///
public const Int32 KeyPressDurationMin = 80;
///
/// 按键时,键盘按下和弹起的时间间隔最大值
///
public const Int32 KeyPressDurationMax = 176;
///
/// 让点在范围内随机
///
///
///
///
public static ZTPoint PointRange(ZTPoint point, Int32 range)
{
return point.Add(G(0, range));
}
}
}