基于Xejen框架实现的C# winform鼠标点击器、电脑按键自动点击器的软件开发及介绍

news2024/9/19 9:32:04

功能演示

文章开始之前,仍然是先来个视频,以便用户知道鼠标连点器的基本功能


 

软件主界面

多功能鼠标连点器

快速点击:

痕即鼠标点击器可以设定每秒点击次数,让您轻松应对高频点击需求。

切换时长,即每次动作之间的间隔时间,最小设置为1毫秒,那么理论上1秒内最多产生1000次动作


定时功能:

您可以预设点击开始和结束时间,做到自动操作。

打开全局配置,如图所示,提供3种定时作业:特定时间、每天定点、周期循环,您根据自己需要选择


多种点击模式:

支持左键、右键、中键点击,满足各种操作需求。

如上图,支持高达9种动作模式,请问谁有这么全,就问你牛不牛,够不够!

自定义点击间隔:

根据不同需求设置点击间隔,精确到毫秒,确保操作准确无误。

如上图,不要选中“随机”,则可以精确指定时间间隔,若选中了“随机”,那么就将在范围内随机生成一个时间间隔,动作之间的最小间隔时间是1毫秒,即1秒内理论上最多1000次动作。

坐标偏移(防外挂):

用于防止鼠标固定在同一个位置重复执行,要不然可能被您使用的系统监控到你可能使用外挂。

此功能坐标偏移 + 切换时长随机,双层结合是为了防止您被您的系统判定为您在使用外挂。

实际案例:temu抢仓库


使用简单,界面友好

就问你这样的操作界面,清不清爽?!牛不牛逼?!
是不是比其它人的一堆看起来头疼的设置,简单易用多了?!

核心代码

        /// <summary>
        /// 开始运行
        /// </summary>
        public async Task RunAsync()
        {
            if (_loadedForms != null)
            {
                foreach (var form in _loadedForms)
                {
                    form.Invoke(new System.Action(() =>
                    {
                        ((ActionForm)form).SetWindowExStyle();
                    }));
                }
            }
            else
            {
                return;
            }

            ActionData recordData = _actionData;
            if (recordData == null || recordData.Actions == null || recordData.Actions.Count == 0)
            {
                return;
            }

            lock (recordData)
            {
                if (_running)
                {
                    return;
                }
            }

            //keyboardHook.Start();
            _running = true;

            int l = 0;
            _totalCount = 0;

            this.Start?.Invoke(this, EventArgs.Empty);

            await Task.Run(() =>
            {
                Random random = new Random();
                while (_running)
                {
                    if (_actionConfig.Loop > 0)
                    {
                        if (l >= _actionConfig.Loop)
                        {
                            _running = false;
                            this.Stop();
                            this.Complete?.Invoke(this, EventArgs.Empty);
                            MessagingCenter.Send(ActionSheduleCompleteMessageName, this);
                            break;
                        }

                        l++;
                    }

                    _totalCount++;

                    //Debug.WriteLine("循环几次了:" + l);

                    foreach (ActionSegment action in recordData.Actions)
                    {
                        OffsetParameter offsetParameter = action.ActionParameter.OffsetParameter;
                        int xOffset = 0;
                        int yOffset = 0;

                        if (offsetParameter != null)
                        {
                            xOffset = random.Next(offsetParameter.XOffset.Start, offsetParameter.XOffset.End);
                            yOffset = random.Next(offsetParameter.YOffset.Start, offsetParameter.YOffset.End);
                        }

                        switch (action.Type)
                        {
                            case ActionType.MouseClick:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        //_stopwatch.Restart();
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        //_stopwatch.Stop();
                                        //Debug.WriteLine("耗时毫秒:" + _stopwatch.ElapsedMilliseconds);

                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });
                                            MouseSimulator.Click(matchPoints[0].X, matchPoints[0].Y);
                                        }));
                                    }
                                    else
                                    {
                                        Point point1 = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        MouseSimulator.Click(point1.X, point1.Y);
                                    }
                                }
                                break;
                            case ActionType.MouseDoubleClick:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });
                                            MouseSimulator.DoubleClick(matchPoints[0].X, matchPoints[0].Y);
                                        }));
                                    }
                                    else
                                    {
                                        Point point2 = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        MouseSimulator.DoubleClick(point2.X, point2.Y);
                                    }
                                }
                                break;
                            case ActionType.MouseRightClick:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });
                                            MouseSimulator.RightClick(matchPoints[0].X, matchPoints[0].Y);
                                        }));
                                    }
                                    else
                                    {
                                        Point point3 = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        MouseSimulator.RightClick(point3.X, point3.Y);
                                    }
                                }
                                break;
                            case ActionType.MouseMiddleClick:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });
                                            MouseSimulator.MiddleClick(matchPoints[0].X, matchPoints[0].Y);
                                        }));
                                    }
                                    else
                                    {
                                        Point point4 = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        MouseSimulator.MiddleClick(point4.X, point4.Y);
                                    }
                                }
                                break;
                            case ActionType.MouseDrag:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });

                                            Point end = new Point(action.ActionParameter.EndPoint.X + xOffset, action.ActionParameter.EndPoint.Y + yOffset);
                                            MouseSimulator.Drag(matchPoints[0].X, matchPoints[0].Y, end.X, end.Y);
                                        }));
                                    }
                                    else
                                    {
                                        Point start = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        Point end = new Point(action.ActionParameter.EndPoint.X + xOffset, action.ActionParameter.EndPoint.Y + yOffset);
                                        MouseSimulator.Drag(start.X, start.Y, end.X, end.Y);
                                    }
                                }
                                break;
                            case ActionType.Sleep:
                                if (_running)
                                {
                                    //await Task.Delay(Convert.ToInt32(action.Parameter.Value));

                                    //用Thread.Sleep比Task.Delay的效果要好很多,特别是在很微小的休眠时间的时候
                                    //可能是因为Task.Delay有5ms下限值的原因
                                    SleepParameter sleepParameter = action.ActionParameter.Value as SleepParameter;
                                    if (sleepParameter == null)
                                    {
                                        sleepParameter = JsonConvert.DeserializeObject<SleepParameter>(action.ActionParameter.Value.ToString());
                                    }
                                    if (sleepParameter.IsRandom)
                                    {
                                        var interval = random.Next(sleepParameter.Start, sleepParameter.End);
                                        Thread.Sleep(interval);
                                    }
                                    else
                                    {
                                        Thread.Sleep(sleepParameter.Start);
                                    }
                                }
                                break;
                            case ActionType.Content:
                                if (_running)
                                {
                                    MainForm.Instance.Invoke(new System.Action(() =>
                                    {
                                        KeyboardSimulator.TextPaste(action.ActionParameter?.Value?.ToString());
                                    }));
                                }
                                break;
                            case ActionType.Enter:
                                if (_running)
                                {
                                    MainForm.Instance.Invoke(new System.Action(() =>
                                    {
                                        KeyboardSimulator.Enter();
                                    }));
                                }
                                break;
                            case ActionType.LongPress:
                                if (_running)
                                {
                                    if (action.ActionParameter.GraphicParameter != null && !string.IsNullOrEmpty(action.ActionParameter.GraphicParameter.FilePath))
                                    {
                                        var matchPoints = _shapeMatch.Match(action.ActionParameter.GraphicParameter.FilePath);
                                        if (matchPoints == null || matchPoints.Length == 0)
                                        {
                                            break;
                                        }

                                        ActionForm form = _loadedForms.First(q => q.Action == action);
                                        form.BeginInvoke(new System.Action(() =>
                                        {
                                            form.ChangePosition(new Point { X = matchPoints[0].X - form.Width / 2, Y = matchPoints[0].Y - form.Height / 2 });
                                            MouseSimulator.LongPress(matchPoints[0].X, matchPoints[0].Y, Convert.ToInt32(action.ActionParameter.Value));
                                        }));
                                    }
                                    else
                                    {
                                        Point point6 = new Point(action.ActionParameter.StartPoint.X + xOffset, action.ActionParameter.StartPoint.Y + yOffset);
                                        MouseSimulator.LongPress(point6.X, point6.Y, Convert.ToInt32(action.ActionParameter.Value));
                                    }
                                }
                                break;
                            default:
                                break;
                        }
                    }
                }
            });
        }

可提供程序生成包,通过主页可见我的介绍方式

祝您用餐愉快。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1952314.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

使用Process Explorer/Process Hacker和Windbg高效排查C++程序高CPU占用问题

目录 1、为什么需要将Process Explorer/Process Hacker与Windbg结合起来分析高CPU占用问题? 1.1、使用Windbg分析时为什么还要使用Process Explorer/Process Hacker呢? 1.2、使用Process Explorer/Process Hacker分析时为什么还要使用Windbg呢? 2、先用Process Explorer…

《程序猿入职必会(6) · 返回结果统一封装》

&#x1f4e2; 大家好&#xff0c;我是 【战神刘玉栋】&#xff0c;有10多年的研发经验&#xff0c;致力于前后端技术栈的知识沉淀和传播。 &#x1f497; &#x1f33b; CSDN入驻不久&#xff0c;希望大家多多支持&#xff0c;后续会继续提升文章质量&#xff0c;绝不滥竽充数…

SenseVoice 实测,阿里开源语音大模型,识别效果和效率优于 Whisper,居然还能检测掌声、笑声!5分钟带你部署体验

前段时间&#xff0c;带着大家捏了一个对话机器人&#xff1a; 手把手带你搭建一个语音对话机器人&#xff0c;5分钟定制个人AI小助手&#xff08;新手入门篇&#xff09; 其中语音识别&#xff08;ASR&#xff09;方案&#xff0c;采用的是阿里开源的 FunASR&#xff0c;这刚…

【Python机器学习】朴素贝叶斯——条件概率

条件概率 假设现在有一个装了7块石头的罐子&#xff08;3块灰色&#xff0c;4块黑色&#xff09;&#xff0c;如果从中随机取出一块&#xff0c;灰色的可能性就是3/7&#xff0c;黑色的可能性是4/7。我们使用p(gray)来表示取到灰色石头的概率&#xff0c;其概率值可以通过灰色…

Radxa ROCK 5B+开发板基本配置和上手测试

目录 1.ROCK 5B Plus开发板是什么&#xff1f;2.烧录官方系统3.设置ROOT用户4.开发板温度情况5.VNC远程桌面配置6.WIFI模块测速7.M2接口使用注意8.总结 1.ROCK 5B Plus开发板是什么&#xff1f; ROCK 5B&#xff08;即ROCK 5B Plus&#xff0c;本文用ROCK 5B指代&#xff09; …

数据结构-----对列

前言 Hello, 小伙伴们&#xff0c;你们的作者菌又来了&#xff0c;前不久&#xff0c;我们学习了一种数据结构----栈&#xff0c;他特殊的性质使得他在一些数据管理的问题上被广泛的使用&#xff0c;那今天&#xff0c;我们就来学习另一种十分重要的数据结构--对列。 在开始之…

Spring Boot中如何实现全链路调用日志跟踪?

​ 博客主页: 南来_北往 系列专栏&#xff1a;Spring Boot实战 引言 在Spring Boot中实现全链路调用日志跟踪&#xff0c;主要依赖于Mapped Diagnostic Context&#xff08;MDC&#xff09;功能。MDC是一种用于在多线程条件下记录日志的功能&#xff0c;它可以看作是与当…

C++ | Leetcode C++题解之第283题移动零

题目&#xff1a; 题解&#xff1a; class Solution { public:void moveZeroes(vector<int>& nums) {int n nums.size(), left 0, right 0;while (right < n) {if (nums[right]) {swap(nums[left], nums[right]);left;}right;}} };

[Python][列表和元组]详细讲解

目录 0.是什么&#xff1f;1.列表1.创建列表2.访问下标3.切片操作4.遍历列表元素5.新增元素6.查找元素7.删除元素8.连接列表 2.关于元组∞.积累 0.是什么&#xff1f; 列表和元组类似C/C中的数组列表&#xff1a;一种在代码中批量表示/保存数据的方式 代码中需要表示的数据特别…

093、Python操作Excel生成统计图表

在Excel里做统计表是我们经常会做的一件事情。我们也可以通过编程的方式操作Excel生成统计图表。 下面是官方的一个很有参考价值的案例&#xff1a; from openpyxl import Workbook from openpyxl.chart import BarChart, Reference from copy import deepcopywb Workbook(w…

C# 使用pythonnet 迁入 python 初始化错误解决办法

pythonnet 从 3.0 版本开始&#xff0c;必须设置Runtime.PythonDLL属性或环境变量 例如&#xff1a; string pathToVirtualEnv ".\\envs\\pythonnetTest"; Runtime.PythonDLL Path.Combine(pathToVirtualEnv, "python39.dll"); PythonEngine.PythonHom…

vscode 调试web后端

1、调试环境配置 一、安装python环境管理器 其中要先在vscode选择对应的python环境&#xff0c;最方便的是按照环境管理器后从中选择。其中在【externsions】里面安装python即可。 如下&#xff1a; 二、编写launch.json文件 其中如下&#xff1a; {// Use IntelliSense …

GraphHopper-map-navi_路径规划、导航(web前端页面版)

文章目录 一、项目地址二、踩坑环境三、问题记录3.1、graphhopper中地图问题3.1.1. getOpacity不存在的问题3.1.2. dispatchEvent不存在的问题3.1.3. vectorLayer.set(background-maplibre-layer, true)不存在set方法3.1.4. maplibre-gl.js.map不存在的问题3.1.5. Uncaught Ref…

AWS-Lambda的使用

介绍 Lambda 是一种无服务器(Serverless), 而且设计成事件驱动的计算服务器. 简单来说, 你可以将你的 code 上传, 当有事件产生(例如cronjob , 或者S3有新的文件被上传上來) , 你的code 就会在瞬间(零点几秒以內)被叫起來执行. 由于你不用管 Server如何维护, 或者自动扩展之类…

数据结构第二讲:顺序表

数据结构第二讲&#xff1a;顺序表 1.线性表2.什么是顺序表3. 静态顺序表4.动态顺序表4.1顺序表基础4.2顺序表的初始化4.3顺序表的销毁4.4顺序表的尾插4.5顺序表的头插4.6顺序表的尾删4.7顺序表的头删4.8顺序表在指定位置之前插入数据4.9顺序表删除指定位置的数据4.10顺序表查找…

ubuntu22.04 安装 NVIDIA 驱动以及CUDA

目录 1、事前问题解决 2、安装 nvidia 驱动 3、卸载 nvidia 驱动方法 4、安装 CUDA 5、安装 Anaconda 6、安装 PyTorch 1、事前问题解决 在安装完ubuntu之后&#xff0c;如果进入ubuntu出现黑屏情况&#xff0c;一般就是nvidia驱动与linux自带的不兼容&#xff0c;可以通…

AMQP-核心概念-4

本文参考以下链接摘录翻译&#xff1a; https://www.rabbitmq.com/tutorials/amqp-concepts 绑定 (Bindings) 绑定是交换机用来将消息路由到队列的规则。为了让一个交换机E将消息路由到队列Q&#xff0c;Q必须绑定到E。绑定可以有一个可选属性routing key&#xff0c;有一些类…

uart开发调试

1. Uart基本框架 1.1概念 通信系统有两种方式&#xff0c;同步通信和异步通信. 同步通信的典型特征&#xff1a;通信双方公用同一个时钟&#xff0c;发送/接受速率完全一致&#xff0c;通信时需要带时钟信号传输. 异步通信的典型特征&#xff1a;通信双方各自具有独立的时钟…

电脑为什么会出现“找不到msvcr120.dll无法执行代码”?如何解决msvcr120.dll丢失错误

在使用电脑的过程中不知带大家有没有遇到过“找不到msvcr120.dll无法执行代码”的错误提示的情况&#xff0c;出现这样的情况大家都有什么解决办法可以解决&#xff1f;有什么办法能够帮助大家修复丢失的msvcr120.dll文件。接下来这篇文章就将教大家修复“找不到msvcr120.dll无…

Vue3-拉开序幕的setup

Vue3 中的 setup 是一个新的配置项&#xff0c;值是一个函数。 export default {name: App,setup: function () {} } </script> 和 Vue2 中的 data 一样&#xff0c;我也可以将 setup 简写成为 export default {name: App,setup() {} } setup函数的使用 与 Vue2 不一样…