赞
踩
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) {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。