生活随笔
收集整理的這篇文章主要介紹了
利用JavaScript实现京东自动叠蛋糕+淘宝自动领喵币,叠列车+618全民购物
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
京東自動疊蛋糕|淘寶自動領(lǐng)喵幣,疊列車|618全民購物|JavaScript
行環(huán)境 安卓
JavaScript運(yùn)行軟件 Auto.js
"ui";
var color
= "#009688";
main();
function
main() {ui
.layout(<drawer id
="drawer"><vertical><appbar><toolbar id
="toolbar" title
="618小助手" /><tabs id
="tabs" /></appbar
><viewpager id
="viewpager">{}<frame><vertical><card w
="*" h
="85" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" gravity
="center_vertical"><vertical padding
="18 8" h
="auto"><text text
="執(zhí)行速度(默認(rèn)正常速度50,越大越快)" textColor
="#222222" textSize
="18sp" /><input id
="taobaoSpeed" inputType
="number" hint
="最小為1,最大為100" /></vertical
><View bg
="#f44336" h
="*" w
="10" /></card
><list id
="taobaoList"><card w
="*" h
="50" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" foreground
="?selectableItemBackground"><horizontal gravity
="center_vertical"><View bg
="{{this.color}}" h
="*" w
="10" /><vertical padding
="10 8" h
="auto" w
="0" layout_weight
="1"><text id
="title" text
="{{this.title}}" textColor
="#222222" textSize
="18sp" maxLines
="1" /></vertical
><checkbox id
="done" marginLeft
="4" marginRight
="6" checked
="{{this.done}}" /></horizontal
></card
></list
><horizontal gravity
="center"><button style
="Widget.AppCompat.Button.Colored" w
="auto" h
="auto" id
="gototb" text
="開始任務(wù)" textSize
="26sp" /></horizontal
></vertical
></frame
>{}<frame><vertical><card w
="*" h
="85" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" gravity
="center_vertical"><vertical padding
="18 8" h
="auto"><text text
="執(zhí)行速度(默認(rèn)正常速度50,越大越快)" textColor
="#222222" textSize
="18sp" /><input id
="jdSpeed" inputType
="number" hint
="最小為1,最大為100" /></vertical
><View bg
="#f44336" h
="*" w
="10" /></card
><card w
="*" h
="85" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" gravity
="center_vertical"><vertical padding
="18 8" h
="auto"><text text
="設(shè)置小金人任務(wù)次數(shù)" textColor
="#222222" textSize
="18sp" /><input id
="goldTime" inputType
="number" hint
="最小為1,最大為50" /></vertical
><View bg
="#78909c" h
="*" w
="10" /></card
><list id
="jdList"><card w
="*" h
="50" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" foreground
="?selectableItemBackground"><horizontal gravity
="center_vertical"><View bg
="{{this.color}}" h
="*" w
="10" /><vertical padding
="10 8" h
="auto" w
="0" layout_weight
="1"><text id
="title" text
="{{this.title}}" textColor
="#222222" textSize
="18sp" maxLines
="1" /></vertical
><checkbox id
="done" marginLeft
="4" marginRight
="6" checked
="{{this.done}}" /></horizontal
></card
></list
><horizontal gravity
="center"><button style
="Widget.AppCompat.Button.Colored" w
="auto" h
="auto" id
="gotojd" text
="開始任務(wù)" textSize
="26sp" /><button style
="Widget.AppCompat.Button.Colored" w
="auto" h
="auto" id
="gotojdGold" text
="小金人" textSize
="26sp" /></horizontal
></vertical
></frame
>{}<frame><ScrollView><vertical><horizontal gravity
="center" margin
="10 5" w
="*" h
="auto"><text text
="使用方法" textStyle
="bold" textColor
="#222222" textSize
="22sp" maxLines
="1" /></horizontal
><card w
="*" h
="auto" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" foreground
="?selectableItemBackground"><horizontal gravity
="center_vertical"><vertical padding
="15 8" h
="auto" w
="auto" layout_weight
="1"><text id
="help" text
="" textColor
="#222222" textSize
="18sp" maxLines
="50" /></vertical
></horizontal
></card
><horizontal gravity
="center" margin
="10 5" w
="*" h
="auto"><text text
="常見問題" textStyle
="bold" textColor
="#222222" textSize
="22sp" maxLines
="1" /></horizontal
><card w
="*" h
="auto" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" foreground
="?selectableItemBackground"><horizontal gravity
="center_vertical"><vertical padding
="15 8" h
="auto" w
="auto" layout_weight
="1"><text id
="question" text
="" textColor
="#222222" textSize
="18sp" maxLines
="100" /></vertical
></horizontal
></card
><horizontal gravity
="center" margin
="10 5" w
="*" h
="auto"><text text
="關(guān)于軟件" textStyle
="bold" textColor
="#222222" textSize
="22sp" maxLines
="1" /></horizontal
><card w
="*" h
="auto" margin
="10 5" cardCornerRadius
="2dp"cardElevation
="1dp" foreground
="?selectableItemBackground"><horizontal gravity
="center_vertical"><vertical padding
="15 8" h
="auto" w
="auto" layout_weight
="1"><text id
="about" text
="" textColor
="#222222" textSize
="18sp" maxLines
="10" /></vertical
></horizontal
></card
></vertical
></ScrollView
></frame
></viewpager
></vertical
><vertical layout_gravity
="left" bg
="#ffffff" h
="*" w
="280"><img w
="280" h
="200" scaleType
="fitXY" src
="http://images.shejidaren.com/wp-content/uploads/2014/10/023746fki.jpg" /><list id
="menu"><horizontal bg
="?selectableItemBackground" w
="*"><img w
="50" h
="50" padding
="16" src
="{{this.icon}}" tint
="{{color}}" /><text textColor
="black" textSize
="15sp" text
="{{this.title}}" layout_gravity
="center" /></horizontal
></list
></vertical
></drawer
>);var config
= storages
.create("config");var taobao
= config
.get("taobao", {speed
: 50,list
: [{id
: "duihuan",title
: "是否開啟兌換",task
: "去兌換",color
: "#e91e63",done
: true},{id
: "search",title
: "是否開啟搜索",task
: "去搜索",color
: "#ab47bc",done
: true},{id
: "weiguan",title
: "是否開啟圍觀",task
: "去圍觀",color
: "#5c6bc0",done
: true},{id
: "liulan",title
: "是否開啟瀏覽",task
: "去瀏覽",color
: "#7e57c2",done
: true}]});var jd
= config
.get("jd", {speed
: 50,goldTime
: 20,gold
: false,list
: [{id
: "jiagou",title
: "是否開啟加購",color
: "#5c6bc0",done
: true},{id
: "auto",title
: "是否開啟全自動",color
: "#7e57c2",done
: true}]})var helpText
= '按下音量鍵上鍵即可關(guān)閉正在運(yùn)行的腳本。\n\n手機(jī)性能以及網(wǎng)絡(luò)情況錯(cuò)綜復(fù)雜,自定義最適合自己的運(yùn)行速度(1-100),作者建議一般情況使用50的增幅即可。\n\n勾選你需要的功能開關(guān)即可使用對應(yīng)的自動化服務(wù)。\n\n淘寶目前需要手動打開活動頁面。\n\n京東默認(rèn)自帶糾正,如果試用體驗(yàn)不好可以及時(shí)前往吾愛帖子下反饋。\n\n如果懸浮窗不顯示可以檢查是否給予app懸浮窗權(quán)限或者重啟app。\n\n最后歡迎前往吾愛破解論壇搜索ZainCheung或者superBoyJack,在帖子下留言反饋。';var questionText
= '1.為什么app在打開京東后就沒有反應(yīng)了咋回事?\n答:在使用之前你需要先關(guān)掉京東的后臺,確保app打開時(shí)是從首頁進(jìn)去的,而不是你的購物車頁面或者商品頁面。\n\n2.糾正功能為什么沒有讓我回到正確的頁面?\n答:糾正功能主要是為了防止彈出窗口,以及瀏覽8秒商品的長時(shí)間等待期間誤觸而新增的,腳本正在加購或者快速瀏覽時(shí)請不要干擾它,它干起活來很專注(滑稽)。\n\n3.加購任務(wù)為什么執(zhí)行完一次就回到桌面了?\n答:因?yàn)槿蝿?wù)完成后執(zhí)行了返回操作,然而系統(tǒng)給它指向了桌面,不過這些問題已經(jīng)在新版本里解決了,糾正功能可以自動回到活動頁面繼續(xù)刷任務(wù)。需要注意的是回到桌面后大約會等待5秒左右才可以回去,這是因?yàn)樵诘诙渭m正前還有五次第一次糾正,所以還煩請稍稍耐心等待一下,不要見沒有回去以為出問題就草草關(guān)掉了。如果實(shí)在忍受不了加購的可以選擇不勾選它的框框。\n\n4.單靠這個(gè)app可以完成所有的任務(wù)嗎?\n答:除了京東的邀請好友助力,AR游戲以及淘寶的收菜等任務(wù)無法幫你完成,其他已經(jīng)全部覆蓋,目前京東可以做到一次打開,刷完所有非主觀任務(wù),最高可以做完50次不斷開。\n\n5.為什么要用app而不是去調(diào)用接口一鍵完成所有任務(wù)?\n答:app運(yùn)行的原理就是模擬你對屏幕的操作,這樣JD和淘寶不能認(rèn)為這是違規(guī)行為,如果是要通過調(diào)用接口掛多個(gè)號,,有黑號的風(fēng)險(xiǎn),我覺得為了這個(gè)活動沒必要冒這個(gè)風(fēng)險(xiǎn)。\n\n6.可以給多個(gè)賬號刷任務(wù)么?\n答:可以。如果有應(yīng)用分身可以不開啟全自動,借助分身,然后app啟動時(shí)會彈出選擇分身。如果不用分身,在上一個(gè)賬號做完所有任務(wù)后,切換到下一個(gè)賬號,多個(gè)賬號輪流切換,雖然稍有些麻煩,但比較保險(xiǎn)。';var aboutText
= '618助手 v2.0.0\n\n軟件僅供學(xué)習(xí)參考使用,切勿用于非法操作。\n\n軟件代碼全部免費(fèi)開源,如有通過網(wǎng)上購買此軟件可以要求退款。\n\n作者ZainCheung享有代碼以及軟件的最終解釋權(quán)。';ui
.help
.setText(helpText
);ui
.question
.setText(questionText
);ui
.about
.setText(aboutText
);ui
.taobaoSpeed
.setText(taobao
.speed
.toString());ui
.taobaoList
.setDataSource(taobao
.list
);ui
.taobaoSpeed
.addTextChangedListener({afterTextChanged
: (text
) => {var tbSpeed
= Number(text
);if ((tbSpeed
>= 1) && (tbSpeed
<= 100)) {taobao
.speed
= tbSpeed
;} else {ui
.taobaoSpeed
.setError("請?zhí)顚?-100的數(shù)字")}}})ui
.taobaoList
.on("item_bind", function
(itemView
, itemHolder
) {itemView
.done
.on("check", function
(checked
) {let item
= itemHolder
.item
;item
.done
= checked
;let paint
= itemView
.title
.paint
;itemView
.title
.invalidate();});});ui
.taobaoList
.on("item_click", function
(item
, i
, itemView
, listView
) {itemView
.done
.checked
= !itemView
.done
.checked
;});ui
.jdSpeed
.setText(jd
.speed
.toString());ui
.goldTime
.setText(jd
.goldTime
.toString());ui
.jdList
.setDataSource(jd
.list
);ui
.jdSpeed
.addTextChangedListener({afterTextChanged
: (text
) => {var jdSpeed
= Number(text
);if ((jdSpeed
>= 1) && (jdSpeed
<= 100)) {jd
.speed
= jdSpeed
;} else {ui
.jdSpeed
.setError("請?zhí)顚?-100的數(shù)字")}}})ui
.goldTime
.addTextChangedListener({afterTextChanged
: (text
) => {var time
= Number(text
);if ((time
>= 1) && (time
<= 50)) {jd
.goldTime
= time
;} else {ui
.goldTime
.setError("請?zhí)顚?-50的數(shù)字")}}})ui
.jdList
.on("item_bind", function
(itemView
, itemHolder
) {itemView
.done
.on("check", function
(checked
) {let item
= itemHolder
.item
;item
.done
= checked
;let paint
= itemView
.title
.paint
;itemView
.title
.invalidate();});});ui
.jdList
.on("item_click", function
(item
, i
, itemView
, listView
) {itemView
.done
.checked
= !itemView
.done
.checked
;});ui
.emitter
.on("pause", () => {config
.put("taobao", taobao
);config
.put("jd", jd
);});activity
.setSupportActionBar(ui
.toolbar
);ui
.viewpager
.setTitles(["淘寶", "京東", "更多"]);ui
.tabs
.setupWithViewPager(ui
.viewpager
);ui
.toolbar
.setupWithDrawer(ui
.drawer
);ui
.menu
.setDataSource([{title
: "喜歡軟件",icon
: "@drawable/ic_favorite_black_48dp"},{title
: "作者",icon
: "@drawable/ic_android_black_48dp"},{title
: "退出",icon
: "@drawable/ic_exit_to_app_black_48dp"}]);ui
.menu
.on("item_click", item
=> {switch (item
.title
) {case "喜歡軟件":app
.openUrl('https://www.52pojie.cn/thread-1186000-1-1.html');break;case "作者":alert("作者", "ZainCheung");break; case "退出":ui
.finish();break;}});ui
.gototb
.click(function
() {threads
.start(function
() {var i
= 0;var j
= 0;var taskList
= [];taobao
.list
.forEach(element
=> {if(element
.done
){taskList
.push(element
.task
);}});var speed
= 100 - taobao
.speed
;var height
= device
.height
;var width
= device
.width
;setScreenMetrics(width
, height
);console
.show();auto
.waitFor();sleep(random(21, 31) * speed
);log("正在打開淘寶");launch("com.taobao.taobao");sleep(random(21, 31) * speed
);log("正在等待進(jìn)入列車活動頁面");log("請手動點(diǎn)進(jìn)列車活動頁面")className("android.widget.Button").text("做任務(wù),領(lǐng)喵幣").waitFor()sleep(random(21, 31) * speed
);if (!textContains("淘寶成就點(diǎn)").exists()) {className("android.widget.Button").text("做任務(wù),領(lǐng)喵幣").findOne().click()log("點(diǎn)擊成功");}sleep(random(31, 41) * speed
);if (className("android.widget.Button").text("簽到").exists()) {className("android.widget.Button").text("簽到").click()sleep(random(201, 211));log("簽到成功");} else { log("已簽到"); }sleep(random(31, 41) * speed
);taskList
.forEach(task
=> {while (textContains(task
).exists()) {log("開始做第" + (i
+ 1) + "次任務(wù)!");var a
= text(task
).findOnce(j
);switch (task
) {case '去兌換':log("開始兌換喵幣");sleep(random(11, 21) * speed
);a
.click();sleep(random(11, 21) * speed
);i
++;log("已完成兌換");log("已完成第" + i
+ "次任務(wù)!");break;case '去收菜':log("開始去收菜");sleep(random(11, 21) * speed
);a
.click();sleep(random(11, 21) * speed
);textStartsWith("收3次作物").findOne(5000);sleep(random(11, 21) * speed
);if (text("立即去收").exists()) {text("立即去收").findOne().click();}sleep(random(11, 21) * speed
);for (var t
= 0; t
< 5; t
++) {try {textContains("萬").findOnce(t
).click();sleep(random(21, 41) * speed
)} catch (error) {log("收菜出錯(cuò)了")continue;}}sleep(random(31, 41) * speed
);i
++;log("收完菜準(zhǔn)備回去了")log("已完成第" + i
+ "次任務(wù)!")back();break;case '去搜索':case '去圍觀':case '去瀏覽':sleep(random(11, 21) * speed
);a
.click();sleep(random(31, 41) * speed
);swipe(width
/ 2, height
- 500, width
/ 2, 0, random(16, 18) * speed
);sleep(random(51, 61) * speed
);swipe(width
/ 2, height
- 500, width
/ 2, 0, random(16, 18) * speed
);sleep(random(121, 131) * speed
);swipe(width
/ 2, height
- 500, width
/ 2, 0, random(16, 18) * speed
);textContains("完成").findOne(random(201, 211) * speed
);i
++;log("已完成第" + i
+ "次任務(wù)!")back();break;default:log("default")break;}sleep(random(41, 51) * speed
);}});console
.info("任務(wù)貌似已經(jīng)做完了\n如未完成,請重新運(yùn)行");});});ui
.gotojd
.click(function
() {threads
.start(function
() {console
.show();auto
.waitFor();var jdAuto
;var taskList
= ['8秒', '瀏覽5個(gè)', '瀏覽可得'];var speed
= 100 - jd
.speed
;var i
= 0;var j
= 0;jd
.list
.forEach(element
=> {switch (element
.id
) {case 'jiagou':if (element
.done
) {taskList
.push('去加購');}break;case 'auto':jdAuto
= element
.done
;break;default:break;}});sleep(random(11, 21) * speed
);if (jdAuto
) {log("正在進(jìn)入個(gè)人中心");gotoJd(speed
);log("到達(dá)任務(wù)中心");} else {console
.warn("請手動打開活動的任務(wù)列表")textContains("任務(wù)每日0點(diǎn)刷新").waitFor()sleep(random(21, 31) * speed
);log("到達(dá)任務(wù)中心");}sleep(random(11, 21) * speed
);if (text("去簽到").exists()) {text("去簽到").findOne().click();sleep(random(4, 9) * speed
);log("簽到成功")}if (text("已簽到").exists()) {sleep(random(11, 21) * speed
);log("已簽到")} else {text("簽到").findOne().click();sleep(random(11, 21) * speed
);log("簽到成功")}sleep(random(31, 31) * speed
);while (1) {var next
= false;var a
= text("去完成").findOnce(j
);if (a
!= null
) {var b
= a
.parent().parent().parent();var c
= b
.child(0).child(1).text();taskList
.forEach(task
=> {switch (task
) {case '8秒':if (c
.search(task
) != -1) {i
++;next
= true;log("開始執(zhí)行8秒任務(wù)");sleep(random(11, 15) * speed
);a
.click();sleep(random(101, 111) * speed
);textStartsWith("恭喜完成").findOne(8000);sleep(random(4, 11) * speed
);back();log("已完成第" + i
+ "次任務(wù)!");sleep(random(41, 21) * speed
);j
= 0;}break;case '瀏覽5個(gè)':if (c
.search(task
) != -1) {i
++;next
= true;log("開始執(zhí)行瀏覽5個(gè)商品任務(wù)");sleep(random(11, 15) * speed
);a
.click();sleep(random(25, 31) * speed
);for (var t
= 0; t
< 5; t
++) {if (textContains("瀏覽以下").findOnce()) {log("正在瀏覽第" + (t
+ 1) + "個(gè)商品!");idContains("view_").findOnce(t
).click();sleep(random(32, 35) * speed
)back()sleep(random(32, 35) * speed
)} else { }}textStartsWith("已完成").findOne(8000);sleep(random(21, 31) * speed
);try {id("fe").findOne().click();} catch (error) {back();}log("已完成第" + i
+ "次任務(wù)!");sleep(random(41, 51) * speed
);j
= 0;}break;case '去加購':if (c
.search(task
) != -1) {i
++;next
= true;a
.click();log("開始執(zhí)行加購任務(wù)");sleep(random(21, 31) * speed
);for (var t
= 0; t
< 5; t
++) {idContains("cart_").findOnce(t
).click();sleep(random(21, 31) * speed
)}back();log("已完成第" + i
+ "次任務(wù)!");sleep(random(41, 51) * speed
);j
= 0;}break;case '瀏覽可得':if (c
.search(task
) != -1) {i
++;next
= true;a
.click();log("開始執(zhí)行快速瀏覽任務(wù)");sleep(random(21, 31) * speed
);sleep(random(11, 15) * speed
);back();log("已完成第" + i
+ "次任務(wù)!");sleep(random(41, 51) * speed
);j
= 0;}break;default:break;}});if (next
) { j
= 0; }else { j
++; }} else {correct();}}function
correct() {log("可能出了點(diǎn)問題,正在嘗試第一次糾正");for (let index
= 0; index
< 5; index
++) {back();sleep(random(21, 31) * speed
);var d
= text("去完成").findOnce(j
);if (d
!= null
) {return}}if (d
== null
) {log("正在嘗試第二次糾正");app
.startActivity({data
: "openApp.jdMobile://virtual?params=%7B%22des%22%3A%22m%22%2C%22url%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22category%22%3A%22jump%22%2C%22sourceType%22%3A%22JSHOP_SOURCE_TYPE%22%2C%22sourceValue%22%3A%22JSHOP_SOURCE_VALUE%22%2C%22M_sourceFrom%22%3A%22lkyl%22%2C%22msf_type%22%3A%22click%22%2C%22m_param%22%3A%7B%22m_source%22%3A%220%22%2C%22event_series%22%3A%7B%7D%2C%22jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%2C%22usc%22%3A%22androidapp%22%2C%22ucp%22%3A%22t_335139774%22%2C%22umd%22%3A%22appshare%22%2C%22utr%22%3A%22CopyURL%22%2C%22jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22ref%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22psn%22%3A%221664140455%7C472%22%2C%22psq%22%3A5%2C%22pc_source%22%3A%22%22%2C%22mba_muid%22%3A%221664140455%22%2C%22mba_sid%22%3A%221572979455588510925986537476%22%2C%22std%22%3A%22MO-J2011-1%22%2C%22par%22%3A%22%22%2C%22event_id%22%3A%22Mnpm_ComponentApplied%22%2C%22mt_xid%22%3A%22%22%2C%22mt_subsite%22%3A%22%22%7D%2C%22SE%22%3A%7B%22mt_subsite%22%3A%22%22%2C%22__jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22__jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%7D%7D",});log("進(jìn)入個(gè)人中心");sleep(random(21, 31) * speed
);className("android.view.View").text("做任務(wù)領(lǐng)金幣").waitFor();sleep(random(21, 31) * speed
);if (!textContains("任務(wù)每日0點(diǎn)刷新").exists()) {className("android.view.View").text("做任務(wù)領(lǐng)金幣").findOne().parent().click()}textContains("任務(wù)每日0點(diǎn)刷新").waitFor()sleep(random(21, 31) * speed
);var e
= text("去完成").findOnce(j
);if (e
== null
) {console
.info("貌似沒有任務(wù)了,腳本退出\n如未完成,請重新運(yùn)行");exit();}}}function
gotoJd() {app
.startActivity({data
: "openApp.jdMobile://virtual?params=%7B%22des%22%3A%22m%22%2C%22url%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22category%22%3A%22jump%22%2C%22sourceType%22%3A%22JSHOP_SOURCE_TYPE%22%2C%22sourceValue%22%3A%22JSHOP_SOURCE_VALUE%22%2C%22M_sourceFrom%22%3A%22lkyl%22%2C%22msf_type%22%3A%22click%22%2C%22m_param%22%3A%7B%22m_source%22%3A%220%22%2C%22event_series%22%3A%7B%7D%2C%22jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%2C%22usc%22%3A%22androidapp%22%2C%22ucp%22%3A%22t_335139774%22%2C%22umd%22%3A%22appshare%22%2C%22utr%22%3A%22CopyURL%22%2C%22jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22ref%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22psn%22%3A%221664140455%7C472%22%2C%22psq%22%3A5%2C%22pc_source%22%3A%22%22%2C%22mba_muid%22%3A%221664140455%22%2C%22mba_sid%22%3A%221572979455588510925986537476%22%2C%22std%22%3A%22MO-J2011-1%22%2C%22par%22%3A%22%22%2C%22event_id%22%3A%22Mnpm_ComponentApplied%22%2C%22mt_xid%22%3A%22%22%2C%22mt_subsite%22%3A%22%22%7D%2C%22SE%22%3A%7B%22mt_subsite%22%3A%22%22%2C%22__jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22__jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%7D%7D",});sleep(random(21, 31) * speed
);className("android.view.View").text("做任務(wù)領(lǐng)金幣").waitFor();sleep(random(21, 31) * speed
);if (!textContains("任務(wù)每日0點(diǎn)刷新").exists()) {className("android.view.View").text("做任務(wù)領(lǐng)金幣").findOne().parent().click()}textContains("任務(wù)每日0點(diǎn)刷新").waitFor()sleep(random(21, 31) * speed
);}});});ui
.gotojdGold
.click(function
() {threads
.start(function
() {console
.show();auto
.waitFor();var jdAuto
= true;var speed
= 100 - jd
.speed
;jd
.list
.forEach(element
=> {switch (element
.id
) {case 'auto':jdAuto
= element
.done
;break;default:break;}});if(jdAuto
){log("正在進(jìn)入個(gè)人中心");app
.startActivity({ data
: "openApp.jdMobile://virtual?params=%7B%22des%22%3A%22m%22%2C%22url%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22category%22%3A%22jump%22%2C%22sourceType%22%3A%22JSHOP_SOURCE_TYPE%22%2C%22sourceValue%22%3A%22JSHOP_SOURCE_VALUE%22%2C%22M_sourceFrom%22%3A%22lkyl%22%2C%22msf_type%22%3A%22click%22%2C%22m_param%22%3A%7B%22m_source%22%3A%220%22%2C%22event_series%22%3A%7B%7D%2C%22jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%2C%22usc%22%3A%22androidapp%22%2C%22ucp%22%3A%22t_335139774%22%2C%22umd%22%3A%22appshare%22%2C%22utr%22%3A%22CopyURL%22%2C%22jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22ref%22%3A%22https%3A%2F%2Fbunearth.m.jd.com%2FbabelDiy%2FZeus%2F3xAU77DgiPoDvHdbXUZb95a7u71X%2Findex.html%22%2C%22psn%22%3A%221664140455%7C472%22%2C%22psq%22%3A5%2C%22pc_source%22%3A%22%22%2C%22mba_muid%22%3A%221664140455%22%2C%22mba_sid%22%3A%221572979455588510925986537476%22%2C%22std%22%3A%22MO-J2011-1%22%2C%22par%22%3A%22%22%2C%22event_id%22%3A%22Mnpm_ComponentApplied%22%2C%22mt_xid%22%3A%22%22%2C%22mt_subsite%22%3A%22%22%7D%2C%22SE%22%3A%7B%22mt_subsite%22%3A%22%22%2C%22__jdv%22%3A%22177095863%7Candroidapp%7Ct_335139774%7Cappshare%7CCopyURL%7C1572882675599%22%2C%22__jda%22%3A%22177095863.1664140455.1538579865.1572975960.1572979455.472%22%7D%7D",});sleep(1000);}else{console
.warn("請手動打開活動的小金人頁面")}className("android.view.View").text("做任務(wù)領(lǐng)金幣").waitFor();log("到達(dá)個(gè)人中心");sleep(1000);var x
;var y
;var count
= 1;if (!textContains("點(diǎn)我得金幣").exists()) {console
.warn("請確保頁面上存在小金人且有'點(diǎn)我得金幣'等字樣!!")textContains("點(diǎn)我得金幣").waitFor();}var g
= textContains("點(diǎn)我得金幣").findOne();x
= g
.bounds().centerX();y
= g
.bounds().centerY();log("小金人位置獲取成功!");while(count
<= jd
.goldTime
){for(var i
= 0;i
<5;i
++){click(x
,y
);sleep(200);}log("第" + count
+ "次任務(wù)已完成");sleep(random(121, 131) * speed
);count
++;}log("小金人任務(wù)成功!");return});});}
events
.observeKey();
events
.onKeyDown("volume_up", function
(event
) {threads
.shutDownAll();console
.clear();console
.hide();toast("任務(wù)停止");
});
總結(jié)
以上是生活随笔為你收集整理的利用JavaScript实现京东自动叠蛋糕+淘宝自动领喵币,叠列车+618全民购物的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。