Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

放宽订票按钮筛选条件,解决有票不订问题; #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FenWanDao/FenWanDaoGo.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function main() {
if(text("确认").exists()){
text("确认").click();
}
sleep(50);
sleep(Math.random()*50+25);
if (className("android.widget.Button").desc("提交订单").exists()) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion MaoYan/MaoYanDraft.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function main() {
//立即支付按钮一直在一直支付
// while(className("android.widget.Button").exists()){
// var c = className("android.widget.Button").findOne().click();
// sleep(100)
// sleep(Math.random()*100+50)
// console.log("继续点击立即支付 "+c);
// }

Expand Down
2 changes: 1 addition & 1 deletion MaoYan/MaoYanGo.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function main() {
//等待调优(看支付调起失败时会有什么弹窗)立即支付按钮一直在一直支付
while(className("android.widget.Button").exists()){
var c = className("android.widget.Button").findOne().click();
sleep(100)
sleep(Math.random()*100+50)
console.log("继续点击立即支付 "+c);
}

Expand Down
6 changes: 3 additions & 3 deletions MaoYan/MaoYanGoNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function main() {
textContains("刷新").findOne().click()
log("点击刷新...")
//避免点击过快
sleep(100)
sleep(Math.random()*100+50)
}
});

Expand Down Expand Up @@ -74,7 +74,7 @@ function main() {
if(text("确认").exists()){
text("确认").click();
}
sleep(50);
sleep(Math.random()*50+25);
if (className("android.widget.Button").exists()) {
break;
}
Expand All @@ -89,7 +89,7 @@ function main() {
for (let cnt = 0; className("android.widget.Button").exists(); cnt++) {
//直接猛点就完事了
var c = className("android.widget.Button").findOne().click();
sleep(50);
sleep(Math.random()*50+25);
if (cnt % 20 == 0) {
log("已点击支付次数:" + cnt);
}
Expand Down
12 changes: 7 additions & 5 deletions MaoYan/MaoYanMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function main() {
console.log("观演人:" + viewers);

//等待一小会儿,避免上个弹窗还没关闭,无法正确判断票档区布局元素是否存在
sleep(50);
sleep(Math.random()*50+25);
if (!textContains("¥").exists()) {
refresh_ticket_dom();
}
Expand All @@ -87,7 +87,7 @@ function main() {
textContains("刷新").findOne().click()
log("点击刷新...")
//避免点击过快
sleep(100)
sleep(Math.random()*100+50)
}
});

Expand All @@ -98,7 +98,7 @@ function main() {
while (textContains("¥").exists()) {
cycleMonitor(maxTicketPrice, viewers);
//50ms扫描一次
sleep(50);
sleep(Math.random()*50+25);
}
sleep(1000);
}
Expand Down Expand Up @@ -200,7 +200,7 @@ function doSubmit(amount, viewers) {
for (let cnt = 0; className("android.widget.Button").exists(); cnt++) {
//直接猛点就完事了
var c = className("android.widget.Button").findOne().click();
sleep(50);
sleep(Math.random()*50+25);
if (cnt % 20 == 0) {
log("点支付次数:" + cnt + " 可继续等待或返回上一个界面继续刷新其他票档");
}
Expand Down Expand Up @@ -321,7 +321,9 @@ function get_less_than_tickets(maxTicketPrice) {
// log(btn.text());
//适配:某些设备上,缺货提示在文本中;某些设备上,缺货提示在兄弟元素中
if ((btn.parent().childCount() == 1 && !btn.text().includes("缺货"))
|| (btn.parent().childCount() >= 1 && descOrTextNotContains(btn.parent(), "缺货"))){
|| (btn.parent().childCount() >= 1 && descOrTextNotContains(btn.parent(), "缺货"))
|| (!btn.text().includes("缺货"))
){
let match = btn.text().match(/\¥(\d+)/);
let amount;
if (match && (amount = parseInt(match[1])) < maxTicketPrice) {
Expand Down