一.鼠标轨迹模拟简介
传统的鼠标轨迹模拟依赖于简单的数学模型,如直线或曲线路径。然而,这种方法难以捕捉到人类操作的复杂性和多样性。AI大模型的出现,使得神诺科技 能够通过深度学习技术,学习并模拟更自然的鼠标移动行为。
二.鼠标轨迹算法实现
AI大模型通过学习大量的人类鼠标操作数据,能够识别和模拟出自然且具有个体差异的鼠标轨迹。以下是实现这一技术的关键步骤:
- 数据收集:收集不同玩家在各种游戏环境中的鼠标操作数据,包括移动速度、停顿、加速度等。
- 模型训练:利用深度学习算法,训练AI模型识别鼠标操作中的模式和规律。
- 轨迹生成:在给定起点和终点的情况下,AI模型能够生成符合人类操作习惯的鼠标轨迹。
三.鼠标轨迹API应用场景
游戏中通过分析玩家的鼠标轨迹,检测是否为脚本,例如:魔兽世界,无畏契约等等,大部分游戏都有数据行为检测!
四.API跨语言平台支持
鼠标轨迹api底层实现采用C/C++语言,利用其高性能和系统级访问能力,开发出高效的鼠标轨迹模拟算法。通过将算法封装为DLL(动态链接库),可以方便地在不同的编程环境中调用,实现跨语言的兼容性。
通过DLL封装,开发者可以在C++、Python、易语言、按键精灵等多种编程语言中使用鼠标轨迹模拟技术。这种封装方式提供了一种简便的接口,使得不同背景的开发者都能够轻松集成和使用这一技术。
五.鼠标轨迹 API 介绍
1.头文件
/******************************************************************************************/@官方名称:神诺科技@官方网站:www.winsdk.cn@官方微信:cq41398@SDK功能描述:鼠标轨迹/******************************************************************************************/#ifndef _SN_SDK_H__#define _SN_SDK_H__#include <windows.h>//返回参数typedef struct SN_RESULT {int code; //错误码,如果为 0 表示成功,否则表示错误号char message[4096]; //错误信息,如果为 "OK" 表示成功,否则返回错误信息}SN_RESULT;//坐标参数typedef struct SN_POINT{int x; //屏幕坐标,左上角(0,0),右下角(1920,1080 - 以实际屏幕为准)int y; //屏幕坐标,左上角(0,0),右下角(1920,1080 - 以实际屏幕为准)}SN_POINT;//轨迹参数typedef struct SN_POINT_PARAMS{struct SN_POINT point;//屏幕坐标,左上角(0,0),右下角(1920,1080 - 以实际屏幕为准)int delayTime; //延时时间(单位:毫秒),仅供参考}SN_POINT_PARAMS;/*创建句柄** 参数:* [in] szKey: 卡密(购买卡密:https://shop.4yuns.com/links/7C9F16B7)* [out] pResult: 返回错误信息,参数pResult.code(错误码)如果为 0 表示成功,否则表示错误号;** 返回值:成功返回句柄,失败返回NULL**/HANDLE WINAPI apiSNCreateHandle(char* szKey, SN_RESULT* pResult);/*获取鼠标移动轨迹** 参数:* [in] handle: 句柄(通过调用apiSNCreateHandle得到)* [in] startPoint: 开始坐标,左上角(0,0),右下角(1920,1080 - 以实际屏幕为准)* [in] endPoint: 结束坐标,左上角(0,0),右下角(1920,1080 - 以实际屏幕为准)* [out] points: 轨迹数组,如果数组中元素 point 出现(-1,-1),表示鼠标轨迹结束** 返回值:返回参数SN_RESULT.code(错误码)如果为 0 表示成功,否则表示错误号;**/SN_RESULT WINAPI apiSNMouseMove(HANDLE handle, SN_POINT startPoint, SN_POINT endPoint, SN_POINT_PARAMS* points);/*获取版本号** 参数:* [in] handle: 句柄(通过调用apiSNCreateHandle得到)* [out] szVersion: 版本号** 返回值:返回参数SN_RESULT.code(错误码)如果为 0 表示成功,否则表示错误号;**/SN_RESULT WINAPI apiSNGetVersion(HANDLE handle, char* szVersion);/*获取错误信息** 参数:* [in] handle: 句柄(通过调用apiSNCreateHandle得到)** 返回值:返回参数SN_RESULT.code(错误码)如果为 0 表示成功,否则表示错误号;**/SN_RESULT WINAPI apiSNGetError(HANDLE handle);/*释放句柄(内存)** 参数:* [in] handle: 句柄(通过调用apiSNCreateHandle得到)** 返回值:返回参数SN_RESULT.code(错误码)如果为 0 表示成功,否则表示错误号;**/SN_RESULT WINAPI apiSNDestroyHandle(HANDLE handle);#endif // !_SN_SDK_H__
2.dll接口调用
/******************************************************************************************/@官方名称:神诺科技@官方网站:www.winsdk.cn@官方微信:cq41398@SDK功能描述:鼠标轨迹/******************************************************************************************///#include <iostream>#include "include/SNSDK.h"#pragma comment(lib,"./dll/x86/SNSDK.lib")int main(){SN_RESULT pResult = { 0 };char* pKey = (char*)"SNKJaURwbfuhcaQaCMJVhdByPZMVsZdqRUMjfWrxY1A5";//1.创建句柄HANDLE pHandle = apiSNCreateHandle(pKey,&pResult);if (!pHandle){printf("error code:%d message:%s \n",pResult.code,pResult.message);return -__LINE__;}//2.获取轨迹SN_POINT startPoint = { 100,100 }; //开始坐标SN_POINT endPoint = { 800,800 }; //结束坐标SN_POINT_PARAMS track[4096] = { 0 };//轨迹pResult = apiSNMouseMove(pHandle, startPoint, endPoint, track);if (pResult.code != 0){printf("error code:%d message:%s \n", pResult.code, pResult.message);return -__LINE__;}//3.鼠标根据轨迹移动,轨迹最后一个点(-1,-1)for (int i = 0; i < 4096; i++){struct SN_POINT point = track[i].point;if (point.x <= 0 && point.y <= 0)//轨迹最后一个点(-1,-1)break;printf("x:%d y:%d delay_time:%d \n", point.x, point.y, track[i].delayTime);}//4.释放内存pResult = apiSNDestroyHandle(pHandle);return 1;}/*x:100 y:100 delay_time:0x:100 y:98 delay_time:10x:103 y:98 delay_time:15x:111 y:98 delay_time:16x:116 y:101 delay_time:15x:122 y:104 delay_time:2x:129 y:107 delay_time:13x:135 y:109 delay_time:2x:144 y:112 delay_time:14x:155 y:117 delay_time:2x:167 y:123 delay_time:14x:180 y:128 delay_time:2x:193 y:134 delay_time:13x:209 y:138 delay_time:2x:225 y:144 delay_time:13x:238 y:149 delay_time:5x:254 y:157 delay_time:10x:269 y:162 delay_time:5x:282 y:168 delay_time:11x:298 y:175 delay_time:5x:311 y:180 delay_time:10x:326 y:185 delay_time:6x:341 y:193 delay_time:9x:369 y:211 delay_time:15x:396 y:231 delay_time:16x:419 y:251 delay_time:16x:442 y:270 delay_time:16x:461 y:285 delay_time:17x:481 y:300 delay_time:15x:491 y:311 delay_time:15x:502 y:319 delay_time:2x:513 y:329 delay_time:14x:523 y:343 delay_time:2x:535 y:355 delay_time:14x:546 y:369 delay_time:0x:558 y:383 delay_time:15x:570 y:397 delay_time:2x:582 y:411 delay_time:13x:596 y:427 delay_time:2x:608 y:443 delay_time:14x:620 y:459 delay_time:5x:633 y:476 delay_time:10x:645 y:490 delay_time:5x:656 y:503 delay_time:11x:666 y:515 delay_time:5x:675 y:527 delay_time:11x:684 y:538 delay_time:5x:694 y:551 delay_time:11x:702 y:565 delay_time:5x:710 y:577 delay_time:11x:716 y:588 delay_time:5x:723 y:598 delay_time:11x:728 y:606 delay_time:5x:733 y:615 delay_time:11x:738 y:622 delay_time:5x:743 y:631 delay_time:11x:747 y:637 delay_time:5x:750 y:644 delay_time:11x:753 y:652 delay_time:5x:756 y:659 delay_time:10x:759 y:666 delay_time:5x:761 y:673 delay_time:11x:764 y:680 delay_time:5x:766 y:687 delay_time:11x:768 y:694 delay_time:5x:769 y:701 delay_time:10x:771 y:708 delay_time:5x:772 y:714 delay_time:11x:773 y:722 delay_time:5x:774 y:729 delay_time:10x:777 y:743 delay_time:16x:778 y:755 delay_time:15x:778 y:764 delay_time:16x:780 y:775 delay_time:16x:781 y:784 delay_time:16x:781 y:785 delay_time:15x:781 y:789 delay_time:2x:781 y:790 delay_time:13x:781 y:792 delay_time:2x:782 y:796 delay_time:14x:782 y:796 delay_time:2x:782 y:797 delay_time:14x:782 y:798 delay_time:15x:782 y:800 delay_time:311x:784 y:800 delay_time:16x:784 y:800 delay_time:5x:785 y:800 delay_time:10x:786 y:800 delay_time:5x:786 y:800 delay_time:11x:788 y:800 delay_time:6x:789 y:800 delay_time:9x:790 y:800 delay_time:5x:791 y:800 delay_time:10x:793 y:800 delay_time:16x:795 y:800 delay_time:16x:796 y:800 delay_time:15x:797 y:800 delay_time:15x:797 y:800 delay_time:2x:798 y:800 delay_time:15x:798 y:800 delay_time:30x:799 y:800 delay_time:15x:799 y:800 delay_time:15*/