申请会员ID:ycsoftjob
1、申 请 I D:ycsoftjob2、个人邮箱:ycsoftjob@163.com
3、原创代码:基于TikTok自动关注及自动私信脚本
目前tiktok比较火,花了一天看了一下autojs的文档,又花了半天根据文档写了一个Tiktok的自动关注及自动私信脚本,带UI,autojs使用的是javascript作为主要编程语言,脚本比较简单,需要的自行下载autojs导入代码即可运行。脚本适配了华为麦芒5手机,分辨率一样的手机都可以使用。必须安卓7.0以上系统,否则不能使用autojs,不需要越狱。脚本特点是可以设置关注某一个用户的粉丝列表,也可以随机关注用户的粉丝列表,关注用户时随机时间。发私信自动添加随机表情,以防被封,如遇已发过的私信不再继续发送。以下是脚本运行截图。
【图片上传不了,返回503错误,麻烦管理员维护一下】,就不贴图了下面是代码:
"ui";
ui.layout(
<frame>
<ScrollView>
<vertical h="auto" w="*">
<card w="*" margin="10 5" h="70" cardCornerRadius="2dp" cardElevation="1dp" gravity="center_vertical">
<vertical h="auto" w="*">
<text paddingLeft="20" paddingTop="16" text="TikToK自动化脚本" w="auto" textSize="16sp" textColor="#000000"/>
<text paddingLeft="20" paddingBottom="16" text="unsoft出品" w="auto"/>
</vertical>
<View bg="#f44336" h="auto" w="10"/>
</card>
<card w="*" margin="10 5" h="250" cardCornerRadius="2dp" cardElevation="1dp" gravity="center_vertical">
<vertical h="auto" w="*">
<horizontal>
<text paddingLeft="20" paddingTop="16" text="自动关注设置" w="auto" textColor="#000000"/>
</horizontal>
<horizontal>
<text paddingLeft="20" text="关注间隔" w="auto" />
<input id="bmiao" inputType="number" text="2" w="50" gravity="center"/>
<text text="秒至" w="auto"/>
<input id="emiao" inputType="number" text="5" w="50" gravity="center"/>
<text text="秒" w="auto"/>
</horizontal>
<horizontal>
<text paddingLeft="20" text="每作品关注" w="auto"/>
<input id="zpnumb" inputType="number" text="200" w="50" gravity="center"/>
<text text="个粉丝" w="auto"/>
</horizontal>
<horizontal>
<text paddingLeft="20" text="总共关注" w="auto"/>
<input id="allnumb" inputType="number" text="200" w="50" gravity="center"/>
<text text="个粉丝" w="auto"/>
</horizontal>
<horizontal padding="20">
<button id="btn_gz" w="*" text="开始关注" gravity="center" bg="#409EFF" textColor="#ffffff"/>
</horizontal>
</vertical>
<View bg="#FFA500" h="auto" w="10"/>
</card>
<card w="*" margin="10 5" min-h="250" cardCornerRadius="2dp" cardElevation="1dp" gravity="center_vertical">
<vertical h="auto" w="*">
<horizontal>
<text paddingLeft="20" paddingTop="16" text="自动私信设置" w="auto" textColor="#000000"/>
</horizontal>
<horizontal paddingRight="20">
<text paddingLeft="20" text="私信一:" w="auto" />
<input id="fst" w="*"/>
</horizontal>
<horizontal paddingRight="20">
<text paddingLeft="20" text="私信二:" w="auto" />
<input id="sec" w="*" />
</horizontal>
<horizontal paddingRight="20">
<text paddingLeft="20" text="私信三:" w="auto" />
<input id="thr" w="*" />
</horizontal>
<horizontal padding="20">
<button id="btn_sx" w="*" text="开始私信" gravity="center" bg="#409EFF" textColor="#ffffff"/>
</horizontal>
</vertical>
<View bg="#4caf50" h="auto" w="10"/>
</card>
</vertical>
</ScrollView>
</frame>
);
var fuhao=[""," "," ",".",". ",". ","。","。 ","!","! ","!",",", ", ",","];
var pics=["1","2","3","4"]; //注意,这里是表情字符串,但是论坛不允许发,否则帖子发不出去,所以替换成了1234.
function flo()
{
var w = floaty.rawWindow(
<frame gravity="center">
<text id="flt" text="Stop" textSize="16sp" textColor="red"/>
</frame>
);
w.setPosition(0, 500);
w.flt.click(function(){
//停止所有脚本
threads.start(endprocess);
}
);
}
function main_gz()
{
auto.waitFor();
console.show();
//flo();
var int_bmiao=parseInt(ui.bmiao.getText());//起始秒数
var int_emiao=parseInt(ui.emiao.getText());//结束秒数
var int_zpnumb=parseInt(ui.zpnumb.getText());//每作品关注人数
var int_allnumb=parseInt(ui.allnumb.getText());//总计关注人数
var i=0;
var j=0;
toast("开启关注程序!");
launchApp("TikTok");
//sleep(3000);
//click(106,1700);
sleep(4000);
while(i<int_allnumb)
{
click(985,560);
sleep(2000);
var user=id("aol").findOne();
sleep(2000);
click(user.bounds().centerX(),user.bounds().centerY());
sleep(2000);
m=0;
while(m<int_zpnumb)
{
var follow=id("s3").find();
sleep(800)
console.log("找到点击目标");
for(n=0;n<follow.length;n++)
{
var txt=follow.text();
if(txt=="Follow" && m<int_zpnumb && follow.bounds().centerY()<1789 && follow.bounds().centerY()>360)
{
click(follow.bounds().centerX(),follow.bounds().centerY());
var rdm=random(int_bmiao,int_emiao);
sleep(rdm*1000);
console.log("正在点击...");
m++;
i++;
}
}
sleep(2000);
swipe(540,1618,540,330,1000);
sleep(2000)
}
back();
sleep(1000);
back();
sleep(2000);
swipe(540,1618,540,330,500);
sleep(2000);
}
toast("程序结束!");
}
ui.btn_gz.click(function(){
//开始关注
threads.start(main_gz);
});
ui.btn_sx.click(function(){
//开始私信
threads.start(main_sx);
}
);
function endprocess()
{
engines.stopAll();
floaty.closeAll();
toast("程序结束!");
}
function main_sx()
{
auto.waitFor();
console.show();
//flo();
var fsts=ui.fst.getText();//私信一
var ssecs=ui.sec.getText();//私信二
var thrs=ui.thr.getText();//私信三
var str_fst=String(fsts);
var str_sec=String(ssecs);
var str_thr=String(thrs);
toast("开启私信程序!");
launchApp("TikTok");
sleep(2000);
click(754,1700);
sleep(2000);
while(true){
var msg=id("s3").find();
console.log("找到目标");
sleep(800);
for(n=0;n<msg.length;n++)
{
stat=1;
if(msg.bounds().centerY()<1603 && msg.bounds().centerY()>240 && msg.text()=="Message")
{
click(msg.bounds().centerX(),msg.bounds().centerY());
}
else
{
continue;
}
console.log("正在点击...");
sleep(1000);
var istxt=id("bsa").findOnce();
sleep(800);
if(istxt!=null)
{
console.log("已经发过了");
stat=2;
sleep(1000);
}
/*
var cud=id("cud").findOnce();
sleep(800);
if(cud!=null)
{
console.log("被封号了");
engines.stopAll();
stat=2;
sleep(1000);
}
*/
if(stat==1)
{
if(str_fst!="")
{
console.log("发送第一句");
var nb=parseInt(random(0,fuhao.length));
var picnb=parseInt(random(0,pics.length));
//var str_fst_txt=str_fst+fuhao+pics;
var str_fst_txt=str_fst+" "+pics;
id("bs8").setText(str_fst_txt);
sleep(1000);
id("cli").findOne().click();
sleep(1000)
}
if(str_sec!="")
{
console.log("发送第二句");
var nb=parseInt(random(0,fuhao.length));
var picnb=parseInt(random(0,pics.length));
//var str_sec_txt=str_sec+fuhao+pics;
var str_sec_txt=str_sec+" "+pics;
id("bs8").findOne().setText(str_sec_txt);
sleep(1000);
id("cli").findOne().click();
sleep(1000)
}
if(str_thr!="")
{
console.log("发送第三句");
var nb=parseInt(random(0,fuhao.length));
var picnb=parseInt(random(0,pics.length));
//var str_thr_txt=str_thr+fuhao+pics;
var str_thr_txt=str_thr+" "+pics;
id("bs8").findOne().setText(str_thr_txt);
sleep(1000);
id("cli").findOne().click();
sleep(1000)
}
}
sleep(1000);
back();
sleep(1000);
}
swipe(540,1618,540,350,500);
sleep(2000);
}
}
autojs比较简单,但是编辑代码比较麻烦,他设置的是在手机端编辑的,虽然官方提供了一个VScode的插件,因为代码本身也比较简单,就懒得去装了。在电脑端写完后全文复制到手机端的。欢迎交流 抱歉,未能达到申请要求,申请不通过,可以关注论坛官方微信(吾爱破解论坛),等待开放注册通知。
页:
[1]