Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Commit

Permalink
因A9更新UI作出的调整
Browse files Browse the repository at this point in the history
  • Loading branch information
omegadot9834 committed Apr 11, 2019
1 parent c0de593 commit 0c9e38e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 43 deletions.
2 changes: 1 addition & 1 deletion multiPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ sleep(4000);
DEVICE.checkPermission();
DEVICE.setEventListener();
DEVICE.savePower();
PLAY.beforeRun();

for (;;counterMP++) {
PLAY.beforeRun();
if(PLAY.chooseCar()){
sleep(12000);
PLAY.run(counterMP);
Expand Down
73 changes: 35 additions & 38 deletions play.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,43 @@ module.exports = {
*/
beforeRun() {
var Flag = false;
// 判断是否从主页开始
// 判断是否是否已经到达开始界面
while (!Flag){
switch(mpCheckState()){
// 游戏主界面
case 1: {
// 点击多人按钮
log('index')
robot.click(profile.mp.multiplayer.x, profile.mp.multiplayer.y);
sleep(3000);
sleep(2000);
break;
}
// 多人开始界面
case 3: {
log('start')
Flag = true;
break;
}
// 结算界面
case 5: {
log('result')
robot.back();
sleep(3950);
}
// 打满了 5 / 10 / 20 个奖杯
case 7: {
log('claim')
robot.click(profile.mp.claim.x, profile.mp.claim.y);
sleep(2000);
break;
}
// 否则暂时停止运行
default: {
sleep(1000);
log('default')
robot.back();
sleep(5950);
}

}
sleep(100);
}
Expand Down Expand Up @@ -198,7 +218,7 @@ module.exports = {
* @param {number} counter_mp 已完成的多人比赛次数
*/
run(counter_mp) {

var left = 0;
// 检查是否已经到达结算界面
while (true) {
if (mpCheckState() == 5) {
Expand All @@ -207,42 +227,17 @@ module.exports = {
// 若未跑完仍可点击氮气
else {
robot.click(profile.mp.width * 4 / 5, profile.mp.height / 2);
sleep(1000);
// toastLog("isNext ?= " + checkState());
}
}
toastLog(++counter_mp + "场多人比赛已完成");

var counterStart = 0;
while (counterStart < 15) {
// 检查是否返回多人界面
switch(mpCheckState()) {
// 多人开始界面
case 3: {
counterStart++;
break;
}
// 游戏主界面
case 1: {
// 点击多人按钮
robot.click(profile.mp.multiplayer.x, profile.mp.multiplayer.y);
sleep(3000);
return ;
}
// 打满了 5 / 10 / 20 个奖杯
case 7: {
robot.click(profile.mp.claim.x, profile.mp.claim.y);
sleep(2000);
break;
if (left == 5){
left = 0;
robot.click(profile.mp.width * 3 / 10, profile.mp.height / 2);
sleep(400);
robot.click(profile.mp.width * 3 / 10, profile.mp.height / 2);
}
// 否则模拟按下一次返回键
default:
robot.back();
sleep(7950);
sleep(950);
// toastLog("isNext ?= " + checkState());
}
sleep(50);
}
toastLog("即将开始下一场比赛");
toastLog(++counter_mp + "场多人比赛已完成。\n即将开始下一场比赛。");
}
}
}
Expand Down Expand Up @@ -341,7 +336,9 @@ function mpCheckState() {
var token = images.pixel(img, profile.mp.token.x, profile.mp.token.y);
// log('token '+colors.toString(token))
var isToken = colors.equals(token, "#0090ff");
var isTokenClaim = colors.equals(token, "#0492fa");
// log('isToken '+isToken)
// log('isTokenClaim '+isTokenClaim)

// 积分
var credit = images.pixel(img, profile.mp.credit.x, profile.mp.credit.y);
Expand Down Expand Up @@ -374,7 +371,7 @@ function mpCheckState() {
else if (isNext && !isCredit && !isToken)
state = 5;
// 7 5/10/20奖杯包
else if (isToken && isCredit && isClaim)
else if (isTokenClaim && isCredit && isClaim)
state = 7;

return state;
Expand Down
8 changes: 4 additions & 4 deletions profile1920.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var mpStatus = [
];
var mpCarPick = {
// 传奇
legend: [1, 2],
legend: [1, 2, 3, 4],
// 白金
platinum: [1, 2, 3, 4],
// 黄金
Expand Down Expand Up @@ -108,13 +108,13 @@ module.exports = {
credit: { x: 1203, y: 42 },

// 多人块
multiplayer: { x: 795, y: 990},
multiplayer: { x: 690, y: 1050},

// 开始按钮
start: { x: 999, y: 963 },
start: { x: 960, y: 999 },

// 领奖按钮
claim: { x: 915, y: 1011},
claim: { x: 960, y: 750 },

// 青铜
bronze: { x: 1290, y: 168 },
Expand Down

0 comments on commit 0c9e38e

Please sign in to comment.