";SAVED=storages.create(“dyzs”);COUNT=0;functionErrorHandle(Msg,suicide){console.setSize(device.wi" />

聪少

聪少爱学堂 专注分享全网引流精准引流方法及自媒体运营干货

抖音自动私信引流脚本

发布时间:2021-06-29 17:43:17 已收录 阅读:10次

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元自媒体运营与抖音热门教程礼包一份。

或微信扫描下面二维码,马上添加

版权声明:本站原创文章,于2021-06-29 17:43:17,由 聪少 发表!

转载请注明:抖音自动私信引流脚本 - 聪少爱学堂

评论区

表情

共4条评论

站内搜索

聪少简介

聪少爱学堂聪少
聪少爱学堂创始人,梅州市鹏鑫网络科技有限公司CEO,09年开始踏入互联网,10年互联网行业经验,资深自媒体人,自媒体优秀导师,咪挺微商团对营销引流顾问,业务包含:精准引流技术/代引流精准粉,专业小红书,知乎,微博代运营。