抖音快手火山刷寶自動刷視頻

目前可以用腳本精靈或者用auto.js開發。
目前分享一下用auto.js刷快手極速版。文章下方也有現成打包好的apk

const perVideoWatchTime=5//每隔視頻觀看10秒
const halfDeviceHeight=device.height/2
const halfDeviceWidth=device.width/2
const videoSwipeDistance=halfDeviceHeight-100//視頻下滑的長度 px
// test()
// onlyRun()
//只允許本腳本時,將上行解除註釋
function onlyRun(){

auto();
console.show()
log("開始快手極速版")
images.requestScreenCapture(false)
log("已獲得截屏權限") 

let totalTime=2*60*60 //刷2小時
run(totalTime)

}
function test(){

auto();
console.show()
log("開始快手極速測試")
images.requestScreenCapture(false)
log("已獲得截屏權限") 
click("我知道了")
exit()

}
var kuaiShou = {};
kuaiShou.main = function (totalTime) {
run(totalTime)
};

module.exports = kuaiShou;
function run(totalTime){
log(“計劃時長:”+totalTime)
launchApp()
let watchTime=0;
for(let i=1;totalTime>watchTime;i++){
if(text(“拖動滑塊”).findOnce()){
log(“出現驗證碼,結束”)
runOver()
break;
}
let waitTime=perVideoWatchTime+random(-4,4)
log(“本視頻觀看時長”+waitTime)
sleep(waitTime/21000);
likeAndfollow(7)
sleep(waitTime/2
1000);
watchTime+=waitTime
log(“已看:”+i+"個視頻 "+watchTime+“秒”)
swipeVideo(i)

}

}

function launchApp(){
let isLauchApp=false
while(!isLauchApp){
log(“嘗試啓動”)
launchPackage(“com.kuaishou.nebula”)
sleep(10000)
let mesbox=id(“com.kuaishou.nebula:id/a4v”).findOnce()
if(mesbox){
mesbox.click()
}
mesbox=id(“com.kuaishou.nebula:id/close”).findOnce()
if(mesbox){
mesbox.click()
}

    mesbox=text("我知道了").findOnce()
    if(mesbox){
        mesbox.click()
    }
    isLauchApp=id("com.kuaishou.nebula:id/circular_progress_bar").findOnce()
}

log("已啓動")

}
//swipeCount,滑動視頻的次數
function swipeVideo(swipeCount){
let offset=random(-100,0)
if(swipeCount%60){
// 雙數的第6次下滑
swipe(halfDeviceWidth-random(-50,50), halfDeviceHeight+offset+(videoSwipeDistance/2),
halfDeviceWidth+random(-50,50), halfDeviceHeight+offset-(videoSwipeDistance/2), 30);
}else if(swipeCount%2
0){
//雙數次上滑
swipe(halfDeviceWidth+random(-50,50), halfDeviceHeight+offset,
halfDeviceWidth+random(-50,50), halfDeviceHeight+offset+(videoSwipeDistance/2), 30);

}else {
    //單數下滑
    swipe(halfDeviceWidth-random(-50,50), halfDeviceHeight+offset+(videoSwipeDistance/2), 
    halfDeviceWidth+random(-50,50), halfDeviceHeight+offset-(videoSwipeDistance/2), 30);
}

}
//有range2+1分之一的概率點喜歡,range4+1分之一的概率點關注,關注必定喜歡
function likeAndfollow(range){
let isLike=random(-1range,range)
if(isLike==0){
click(halfDeviceWidth,halfDeviceHeight)
sleep(50)
click(halfDeviceWidth,halfDeviceHeight)
log(“雙擊喜歡”)
let isFollow=random(-1
range,range)
if(isFollow==0){
text(“關注”).click()
log(“點了關注”)
}else{
// log(“不是點關注的概率:”+isFollow)
}

}else{
    // log("不是點喜歡的概率:"+isLike)
}

}
//是否已經不再有收益了
function isNoIncome(){
let isIncome=findIncomeIcon()
if(!isIncome){
sleep(6000)
isIncome=findIncomeIcon()
if(!isIncome){
log(“等待6秒,不見收益紅包”)
return false
}
}
log(“正在收益中”)
return true;
}
//查找收入紅包的圖標,是收益中的返回true 否則返回false
function findIncomeIcon(){
let redBag=id(" com.kuaishou.nebula:id/circular_progress_bar").findOnce()
if(redBag){
let redBagBounds=redBag.bounds()
let screen=images.captureScreen();
// log(redBagBounds)
let p=images.findColorEquals(screen,"#f85050",redBagBounds.left,redBagBounds.top,redBagBounds.width(),redBagBounds.height())
return p?true:false;
}
return false;
}
function runOver(){
home()
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章