基于autojs7 的筷子免费小说辅助
基于autojs7 的筷子免费小说脚本(无UI)
var 筷子免费小说 = {}
筷子免费小说.initialize = function (appName, execTimes, isFragmentation, fragmentationTime, timesInterval, probability) {
events.broadcast.emit("close_console", appName + "控制台被隐藏");
let ad_image_array = adenTools.buildADArray("./Image/AD", 15);
let ad_area_coordinate = [0, 0, device.width, device.height * 0.55]
let threshold = 0.8
adenTools.closeUpgradetWindows()
adenTools.adolescentWindows();//关闭青少年窗口
closeAD()
clickStoryMenu()
while (true) {
try {
let exectue_status = adenTools.computerExctueTime(appName, execTimes, isFragmentation, fragmentationTime)
if (exectue_status == 1) {
autoCashOut()
toastLog(appName + "碎片化时间已到执行下一个app...");
return //执行下一个app
} else if (exectue_status == 2) {
clearAppCache()
toastLog(appName + "今日薅羊毛时间已到,进入下一个app...");
return;//今日时间已到
}
let x1 = random(device.width * 0.9, device.width * 0.9);
let y1 = device.height * 0.75
let x2 = random(device.width * 0.1, device.width * 0.2);
let y2 = device.height * 0.75
let pressTime = 500;
let start = new Date().getTime();//App起始时间 ad上的ad.png 看广告后的ad
closeAD()
keepBrush()
let havedMinute = adenTools.getAppHavedRunRecord(appName)
if (adenTools.mod(parseInt(havedMinute), 8) == 0) {
toastLog("8分钟一次")
autoSign()
领取宝箱()
看视频领金币()
autoCashOut()
}
adenTools.clickAreaForFindImage(ad_image_array, ad_area_coordinate, threshold)
adenTools.randomUpSildeScreen(x1, y2, x1, y1, pressTime, probability);
adenTools.randomDownSildeScreen(x1, y1, x2, y2, pressTime, timesInterval, probability);
adenTools.slideScreenDown(x1, y1, x2, y2, pressTime, timesInterval, false, true, isFragmentation, fragmentationTime);
adenTools.appRunTimeRecord(appName, (new Date().getTime() - start))//记录一次时间
} catch (error) {
adenTools.toastError(appName + "刷刷刷时出现错误!" + error);
}
}
function clickStoryMenu() {
if (adenTools.clickControlBounds(text("书城"))) {
adenTools.sleepRandom3()
if (!adenTools.clickControOffsetCoordinates(text("今日必读"), [0, 350])) {
adenTools.clickControOffsetCoordinates(id("title"), [0, 350])
}
adenTools.sleepRandom1()
if (textContains("设置").exists()) {
//立即免费阅读
click(167, 730)
adenTools.sleepRandom1()
}
}
}
function closeAD() {
adenTools.clickControlBounds(id("iv_close"))
}
function clickWelfareMenu() {
if (text("福利").exists()) {
if (adenTools.clickControlBounds(text("福利"))) {
return true
} else {
return false
}
} else {
back()
adenTools.sleepRandom1()
if (text("暂不加入").exists()) {
if (adenTools.clickControlBounds(text("暂不加入"))) {
return true
} else {
return false
}
}
if (text("福利").exists()) {
if (adenTools.clickControlBounds(text("福利"))) {
return true
} else {
return false
}
} else {
return false
}
}
}
function 看视频领金币() {
let returnValue = adenTools.getBusinessInfo(appName, "看视频")
if (returnValue) {
if (returnValue == adenTools.getDate()) {
toastLog("今日看视频领金币完毕")
return
}
}
if (clickWelfareMenu()) {
toastLog("看视频领金币")
let seeIndex = 0
adenTools.swipeDown()
while (true) {
if (seeIndex == 10) {
adenTools.recordBusinessInfo(appName, "看视频")
clickStoryMenu()
return
}
if (textContains("看视频赚").exists()) {
if (adenTools.clickControlBounds(textContains("看视频赚"))) {
adenTools.cutDownBySleep(30, "快手免费小说看AD倒计时...")
adenTools.clickAreaForFindImage(ad_image_array)
adenTools.sleepRandom1()
}
} else {
toastLog("未发现看视频赚")
}
adenTools.sleepRandom1()
seeIndex = seeIndex + 1
print(seeIndex)
}
}
}
function keepBrush(){
if (textContains("去提现").exists()){
clickStoryMenu()
}
}
function 领取宝箱() {
toastLog("开始领宝箱")
if (clickWelfareMenu()) {
adenTools.sleepRandom3() //是个网页加载的慢
let little_image_array = adenTools.buildImageArray("宝箱", "./Image/快手免费小说", 3); //
if (adenTools.clickAreaForFindImage(little_image_array)) {
//kan ad
little_image_array = adenTools.buildImageArray("看视频", "./Image/快手免费小说", 3); // ["./Image/快手免费小说/看视频.png"]
if (adenTools.clickAreaForFindImage(little_image_array)) {
adenTools.cutDownBySleep(30, "快手免费小说看AD倒计时...")
if (!adenTools.clickAreaForFindImage(ad_image_array)) {
back()
adenTools.toastError("点击关闭按钮失败")
}
} else {
}
} else {
back()
}
adenTools.sleepRandom1()
clickStoryMenu()
} else {
toastLog("未找到福利按钮...")
}
}
/**
* 自动签到
*/
function autoSign() {
adenTools.clearSignTime(appName)
let signValue = adenTools.getSignTime(appName);
if (adenTools.getDate() == signValue) {
adenTools.toastLog("已签到本次签到跳过...");
return;
}
if (clickWelfareMenu()) {
adenTools.sleepRandom3() //是个网页加载的慢
let get_coin_image_array = adenTools.buildImageArray("立即领取", "./Image/快手免费小说", 3);
if (adenTools.clickAreaForFindImage(get_coin_image_array)) {
adenTools.recordSignTime(appName);//记录签到
} else {
if (text("明日再来").exists()) {
toastLog("明天再来...")
adenTools.recordSignTime(appName);//记录签到
return
} else {
//文字签到
toastLog("开始文字签到...")
if (text("去签到").exists()) {
if (adenTools.clickControlBounds(text("去签到"))) {
adenTools.recordSignTime(appName);//记录签到
} else {
return
}
} else {
adenTools.recordSignTime(appName);//记录签到
}
}
}
} else {
toastLog("未找到福利按钮...")
}
}
/**
* 清理缓存
*/
function clearAppCache() {
toastLog("开始App清理缓存");
if (!text("我的").exists()) {
back()
adenTools.sleepRandom1()
}
if (adenTools.clickControlBounds(text("我的"))) {
adenTools.sleepRandom1() //是个网页加载的慢
adenTools.swipeDown()
if (adenTools.clickControlBounds(text("设置"))) {
adenTools.sleepRandom1()
if (adenTools.clickControlBounds(text("清除缓存"))) {
adenTools.sleepRandom1()
back()
adenTools.sleepRandom1()
}
}
else {
toastLog("未发现settings")
}
}
clickStoryMenu()
}
function autoCashOut() {
let returnValue = adenTools.getBusinessInfo(appName, "提现")
if (returnValue) {
if (returnValue == adenTools.getDate()) {
toastLog("今日提现完毕")
return
}
}
toastLog("开始提现0.3...")
if (clickWelfareMenu()) {
adenTools.sleepRandom3() //是个网页加载的慢
adenTools.clickAreaForFindImage(ad_image_array)
adenTools.swipeUp()
if (textContains("去提现").exists()) {
if (adenTools.clickControlBounds(textContains("去提现"))) {
if (adenTools.clickControlBounds(textContains("去看小说赚金币"))) {
clickStoryMenu()
return
}
if (adenTools.clickControlBounds(textContains("立即提现"))) {
adenTools.sleepRandom3()
if (adenTools.clickControlBounds(textContains("立即提现"))) {
adenTools.sleepRandom3()
adenTools.recordBusinessInfo(appName, "提现")
adenTools.sleepRandom1()
back()
adenTools.sleepRandom1()
back()
} else {
adenTools.sleepRandom1()
back() //这类情况基本不会发生
}
}
adenTools.sleepRandom1()
clickStoryMenu()
}
}
} else {
toastLog("未找到福利按钮...提现失败")
}
}
}
module.exports = 筷子免费小说;
纯代码都不行吗