StrokesPlus.net教程及脚本持续更新

固定鼠标在屏幕的当前点

用于鼠标1分钟未移动,鼠标固定,为了避免鼠标误移动到角落执行动作

添加2代码到全局动作-启动/退出-启动(开启)

左键点击解除固定:
添加1代码到:全局动作-鼠标事件-左键单击

1

sp.MouseRestrictClear();
sp.StoreBool("mouseRestrict", false);

2

sp.CreateTimer("Location", 
                        0, 
                        1000, 
                        `var currentMouseCursor = sp.GetCurrentMouseCursor();

                        var startPoint = sp.GetStoredPoint("mouseStart"); 
                        //Get the current mouse location
                        var currPoint = sp.GetCurrentMousePoint();
                        //var devices = sp.AllDevices();
                        if(!sp.GetStoredBool("mouseRestrict")) {
                            //Get the start point/location
                            if(currPoint.X - startPoint.X === 0 && currPoint.X != 0 && currPoint.Y != 0) {
                                sp.StoreNumber('n', sp.GetStoredNumber('n') + 1);
                                var num = sp.GetStoredNumber('n');
                                if(num === 60) {
                                    sp.MouseRestrictToRectangle(new Rectangle(currPoint.X, currPoint.Y, 0, 0));
                                    sp.StoreBool("mouseRestrict", true);
                                }

                            } else {
                                currentMouseLocation = sp.GetCurrentMousePoint();
                                sp.StorePoint("mouseStart", currentMouseLocation);
                                sp.StoreNumber('n', 0);
                            }

                        } else {
                            sp.StoreNumber('n', 0);
                        }`

);