当前位置:   article > 正文

autojs粘贴文本_autojs基础教程 入门篇

autojs bind属性

1. 脚本存放路径:内部存储设置(内置存储卡)根目录 /storage/脚本"/storage/emulated/0/脚本/"2. 对于一些封装的模块的调用

像下面笔者自己封装的一个模块:

function Helper(packageName) {

this.packageName = packageName;

if (packageName && !getAppName(packageName)) {

toast("找不到此应用, 无法提供服务");

this.sleep(1000);

exit();

}

this.click = function (x, y) {

return click(x, y);

};

this.clickCenter = function (widget) {

if (!widget) {

toast('找不到控件');

return false;

}

let rect = widget.bounds();

return click(rect.centerX(), rect.centerY());

};

this.clickSelectorCenter = function (selector) {

if (!selector) {

toast('找不到控件');

return false;

}

let widget = selector.findOne(2000);

return this.clickCenter(widget);

};

this.clickMulti = function (points, interval) {

points.forEach(function (point) {

this.click(point[0], point[1]);

this.sleep(interval);

}.bind(this));

};

this.clickMultiCenter = function (widgets) {

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/天景科技苑/article/detail/880563
推荐阅读
相关标签
  

闽ICP备14008679号