Skip to content

Commit fb6fa0b

Browse files
authored
Merge pull request #121 from Shenyu517/sy_dev
feat: 管理招募适配副会长招人,修改方案号521为1107防止默认方案冲突
2 parents a642596 + 6d127da commit fb6fa0b

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed
Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { IFuncOrigin, IFuncOperatorOrigin, IFuncOperator } from '@/interface/IFunc';
22
import { Script } from '@/system/script';
33

4-
// const normal = -1; //定义常量
54
const left = 0;
65
const center = 1;
76
const right = 2;
87

9-
export class Func521 implements IFuncOrigin {
10-
id = 521;
11-
name = '庭院进入寮信息与招募';
12-
desc = '庭院进入寮信息判断与自动招募功能';
8+
export class Func1107 implements IFuncOrigin {
9+
id = 1107;
10+
name = '管理招募';
11+
desc = '管理自动招募功能';
1312

1413
config = [{
1514
desc: '配置',
@@ -28,6 +27,11 @@ export class Func521 implements IFuncOrigin {
2827
desc: '下一个方案',
2928
type: 'scheme',
3029
default: '通用准备退出',
30+
}, {
31+
name: 'isViceLeader',
32+
desc: '是否为副会长',
33+
type: 'switch',
34+
default: false,
3135
}]
3236
}];
3337

@@ -110,14 +114,15 @@ export class Func521 implements IFuncOrigin {
110114
desc: [
111115
1280, 720,
112116
[
113-
[left, 304, 443, 0x96392d],
114-
[left, 309, 443, 0xeaa65a],
115-
[center, 344, 468, 0x2d2822],
116-
[center, 387, 464, 0x312b23]
117+
[left, 82, 642, 0xdb626e],
118+
[left, 86, 665, 0xbf314c],
119+
[left, 135, 665, 0x283080],
120+
[left, 130, 664, 0x438baa],
117121
]
118122
],
119123
oper: [
120-
[left, 1280, 720, 328, 371, 465, 411, 1200] // 点击进入招募
124+
[left, 1280, 720, 328, 371, 465, 411, 1200],
125+
[left, 1280, 720, 316, 436, 480, 474, 1200] // 点击进入招募(会长)
121126
]
122127
}, {
123128
// 8: 判断是否为招募界面
@@ -253,9 +258,9 @@ export class Func521 implements IFuncOrigin {
253258
}];
254259

255260
operatorFunc(thisScript: Script, thisOperator: IFuncOperator[]): boolean {
256-
console.log('Func521: 开始执行庭院进入寮信息与招募功能');
261+
console.log('开始执行庭院进入寮信息与招募功能');
257262

258-
const thisconf = thisScript.scheme.config['521'];
263+
const thisconf = thisScript.scheme.config['1107'];
259264
const maxRecruitTimes = parseInt(String(thisconf?.maxRecruitTimes || '100'));
260265

261266
// 初始化全局计数状态
@@ -302,7 +307,7 @@ export class Func521 implements IFuncOrigin {
302307
// 首先检查是否在招募界面
303308
console.log('检查是否在招募界面...');
304309
if (thisScript.oper({
305-
id: 521,
310+
id: 1107,
306311
name: '检查招募界面',
307312
operator: [thisOperator[8]]
308313
})) {
@@ -317,13 +322,13 @@ export class Func521 implements IFuncOrigin {
317322
break;
318323
}
319324

320-
console.log(`检查招募区域 ${i-8}...`);
325+
console.log(`检查招募区域 ${i-9}...`);
321326
if (thisScript.oper({
322-
id: 521,
323-
name: `执行招募操作-区域${i - 8}`,
327+
id: 1107,
328+
name: `执行招募操作-区域${i - 9}`,
324329
operator: [thisOperator[i]]
325330
})) {
326-
console.log(`招募区域${i - 8}操作完成`);
331+
console.log(`招募区域${i - 9}操作完成`);
327332
successfulRecruits++;
328333

329334
// 更新计数(使用全局状态)
@@ -362,13 +367,13 @@ export class Func521 implements IFuncOrigin {
362367

363368
sleep(300);
364369
} else {
365-
console.log(`招募区域${i - 8}操作失败,可能已被招募或条件不匹配`);
370+
console.log(`招募区域${i - 9}操作失败,可能已被招募或条件不匹配`);
366371
}
367372
}
368373

369374
// 执行换一批操作
370375
if (thisScript.oper({
371-
id: 521,
376+
id: 1107,
372377
name: '执行换一批操作',
373378
operator: [thisOperator[14]]
374379
})) {
@@ -413,8 +418,10 @@ export class Func521 implements IFuncOrigin {
413418
}
414419

415420
// 如果不在招募界面,执行原有的庭院进入寮信息流程
421+
const recruitEntryIndex = thisconf.isViceLeader ? 1 : 0; // 根据是否为副会长选择索引7中的点击坐标
422+
416423
const result = thisScript.oper({
417-
id: 521,
424+
id: 1107,
418425
name: '庭院进入寮信息',
419426
operator: [
420427
thisOperator[0], // 庭院打开菜单
@@ -424,10 +431,14 @@ export class Func521 implements IFuncOrigin {
424431
thisOperator[4], // 判断寮首页并点击寮信息
425432
thisOperator[5], // 判断寮信息页面并点击上方寮信息
426433
thisOperator[6], // 判断管理按钮并点击
427-
thisOperator[7] // 判断招募入口并点击
434+
{
435+
desc: thisOperator[7].desc,
436+
oper: [thisOperator[7].oper[recruitEntryIndex]] // 根据身份选择会长或副会长的招募入口
437+
}
428438
]
429439
});
430440

441+
431442
if (result) {
432443
recruitData.lastOperationTime = Date.now();
433444
console.log('庭院进入寮信息流程执行成功');
@@ -441,4 +452,4 @@ export class Func521 implements IFuncOrigin {
441452
}
442453
}
443454

444-
export default new Func521();
455+
export default new Func1107();

0 commit comments

Comments
 (0)