";SAVED=storages.create(“dyzs”);COUNT=0;functionErrorHandle(Msg,suicide){console.setSize(device.wi" />
聪少爱学堂 专注分享全网引流精准引流方法及自媒体运营干货
TAG="DYSX-> ";
SAVED=storages.create(“dyzs”);
COUNT=0;
function ErrorHandle(Msg, suicide) {
console.setSize(device.width / 2, device.height);
console.show();
console.error(Msg);
if (suicide) {
threads.shutDownAll();
engines.stopAll();
}
runtime.sleep(5000);
console.hide();
};
function clickItem(item) {
if (!item) {
return false
}
item.click();
let area=item.bounds();
let x=area.centerX();
let y=area.centerY();
try {
click(x, y);
} catch (e) {
try {
Tap(x, y);
runtime.sleep(1000);
} catch (e) {
try {
var ra=new RootAutomator();
// 保险点击
ra.tap(x, y, 1);
runtime.sleep(800);
ra.press(x, y, 10, 1);
ra.exit();
} catch (e) {
ErrorHandle(“在此设备上需要Root权限才能运行本脚本!”, true);
}
}
function clickHelper(item, is_auto, is_root, is_ge_sdk23) {
if (!item) {
return false
}
if (is_auto) {
item.click();
return
}
}
function getGender() {
function genderRecog(text_) {
// 预备性别校验(根据文本)
let gender=“未知”;
const p1=new RegExp(“男”);
const p2=new RegExp(“女”);
if (p1.test(text_)) {
gender=“男”;
} else if (p2.test(text_)) {
gender=“女”;
} else {
function warpGenderRec() {
let W_gender=null;
if (textEndsWith(“岁”).findOne(2000)) {
Z=textEndsWith(“岁”).findOne().bounds();
console.hide();
ox=Z.left + device.width / 1080 * 23;
oy=Z.top + device.height / 1920 * 32;
console.log(TAG + “定位颜色点坐标X Y为:”, ox, oy);
colorValue=images.pixel(images.captureScreen(), ox, oy);
console.info(TAG + “colorValueAbs: " + colorValue);
if (colorValue + 16211275 < 2000000) {
W_gender=“男”;
} else if (colorValue + 2537115 < 2000000) {
W_gender=“女”;
}
}
return W_gender
}
// 执行函数
gender=warpGenderRec();
}
return gender
}
try {
msgUi=id(“d4z”).findOne(4000).children();
} catch (e) {
if (text(“男”).findOne(3000)) { return “男” } else return genderRecog(”");
}
}
console.verbose(msg_);
gender=genderRecog(msg_);
return gender
}
function SendMsg() {
if (id(“abe”).findOne(1000)) {
toastLog(TAG + “企业用户,返回继续下一个”);
return false
}
if (getGender() !=“男”) {
toastLog(TAG + “不符合性别条件,返回继续”);
return false
} else {
toastLog(TAG + “符合性别条件,开始进行消息发送”)
};
toastLog(TAG + “点击关注”);
runtime.sleep(1500);
if (!id(“cst”).findOne(2000)) {
console.show();
console.error(TAG + “关注失败1:”);
// console.log(id(“cac”).findOne(1000));
runtime.sleep(2000);
console.hide();
}
function returnListPage() {
while (!textEndsWith(“条评论”).findOne(2000)) {
if (id(“j4”).findOne(2000)) {
clickHelper(id(“j4”).findOne(), false, false, true);
} else {
desc(“返回”).findOne(2000).click();
}
toastLog(“点击返回”);
}
return true
}
function Start() {
toastLog(TAG + “等待打开抖音界面”);
runtime.sleep(3000);
let tc=0;
while (!textEndsWith(“条评论”).findOne(1500)) {
tc++;
if (tc > 30) {
toastLog(TAG + “三秒内未发现抖音界面,脚本退出”);
ErrorHandle(“未发现评论页面,脚本退出”, true);
}
}
do {
// 当前页面处理逻辑
// try {
returnListPage();
runtime.sleep(5000);
CARD_LIST=className(“android.support.v7.widget.RecyclerView”).findOne().children();
SIZE=CARD_LIST.size();
toastLog(TAG + "发现当前页面存在评论人数: " + SIZE);
CARD_LIST.each(
function (CARD_UI) {
console.hide();
runtime.sleep(2000);
if (!CARD_UI_INNER) {
console.error(currentActivity());
console.error(TAG + “元素定位错误!”);
return
}
}
)
console.log(TAG + “当前页面扫描完毕,自动下拉一页”);
// } catch (e) {
// console.error(e.message + “
” + e.stack);
// ErrorHandle(e.message + “
” + e.stack, false);
// continue
// }
} while (returnListPage() && className(“android.support.v7.widget.RecyclerView”).findOne().scrollForward());
console.warn(TAG + “当前评论页面扫描发送完毕,请检查!”)
}
function dealFlashWin(WIN_TYPE) {
switch (WIN_TYPE) {
case 1:
ui=text(“确认”).findOne(500);
if (ui){
ui.click();
return true
}
case 2:
ui=text(“我知道了”).findOne(500);
if (ui){
ui.click();
return true
}
case 3:
ui=text(“好的”).findOne(500);
if (ui){
ui.click();
return true
}
case 4:
ui=text(“以后再说”).findOne(500);
if (ui){
ui.click();
return true
}
case 5:
ui=text(“取消”).findOne(500);
if (ui){
ui.click();
return true
}
default:
return false
}
}
threads.start(function(){
setInterval(function(){
console.verbose(“监控弹窗ing…”);
dealFlashWin(2);
dealFlashWin(3);
dealFlashWin(4);
},500);
})
Start();
聪少爱学堂,专注分享全网精准引流方法及自媒体赚钱运营干货。
聪少私人微信:80110557,暗号:8
送见面礼:价值980元自媒体运营与抖音热门教程礼包一份。
或微信扫描下面二维码,马上添加
An exception occured in driver: SQLSTATE[HY000] [102021-06-29
下载利器IDM 6.38.17绿色版 Window多线程下载2021-06-29
An exception occured in driver: SQLSTATE[08004] [102021-06-29
windos 服务怎么写_微信引流文章怎么写?微信营销软文怎2021-06-29
微信怎么通过wxid添加密友(最犀利的加密友方式),怎么在a2021-06-29
stringbuffer在最前面添加_主动添加微信好友通过率低?2021-06-29
Android:如何判断某个手机号是否有注册微信号?2021-06-29
mostly tiny微商真的吗??微商MOSTLY TINY代理商投诉被套2021-06-29
通过wxid加好友,如何实现一天爆粉5000人?2021-06-29
wxid的微信号怎么添加?人脉加粉有蓝火焰好用吗2021-06-29