|
| 1 | +import { IFuncOrigin, IFuncOperatorOrigin, IFuncOperator } from '@/interface/IFunc'; |
| 2 | +import { Script } from '@/system/script'; |
| 3 | +// const normal = -1; //定义常量 |
| 4 | +const left = 0; |
| 5 | +const center = 1; |
| 6 | +const right = 2; |
| 7 | + |
| 8 | +export class Func101 implements IFuncOrigin { |
| 9 | + id = 101; |
| 10 | + name = '每月活动_经营'; |
| 11 | + operator: IFuncOperatorOrigin[] = [{ // 0 挑战准备界面 |
| 12 | + desc: [ |
| 13 | + 1280, 720, |
| 14 | + [ |
| 15 | + [right, 1134, 592, 0x42589f], |
| 16 | + [right, 1223, 590, 0x4259a1], |
| 17 | + [right, 1135, 674, 0x616890], |
| 18 | + [right, 1221, 674, 0x59628f], |
| 19 | + [right, 1176, 662, 0xfffdf6], |
| 20 | + [right, 1177, 594, 0xfffdf7], |
| 21 | + ] |
| 22 | + ], |
| 23 | + oper: [ |
| 24 | + [center, 1280, 720, 1129, 595, 1222, 667, 1000], |
| 25 | + ] |
| 26 | + }, { // 1 挑战界面 |
| 27 | + desc: [ |
| 28 | + 1280, 720, |
| 29 | + [ |
| 30 | + [left, 55, 36, 0xa06c3c], |
| 31 | + [center, 332, 10, 0xaf905b], |
| 32 | + [left, 26, 50, 0x845b3b], |
| 33 | + [left, 244, 37, 0x593716], |
| 34 | + [left, 169, 34, 0xf8f3e0], |
| 35 | + ] |
| 36 | + ] |
| 37 | + }, { // 2 挑战达成 |
| 38 | + desc: [ |
| 39 | + 1280, 720, |
| 40 | + [ |
| 41 | + [center, 767, 27, 0xd5ccad], |
| 42 | + [center, 795, 27, 0x75504a], |
| 43 | + [center, 789, 49, 0x745148], |
| 44 | + [center, 781, 53, 0x6d4941], |
| 45 | + [center, 804, 55, 0xe9d1b1], |
| 46 | + ] |
| 47 | + ], |
| 48 | + oper: [ |
| 49 | + [center, 1280, 720, 770, 27, 802, 51, 1000], |
| 50 | + [center, 1280, 720, 683, 401, 793, 441, 1000], |
| 51 | + ] |
| 52 | + }, { // 3 挑战选店长 |
| 53 | + desc: [ |
| 54 | + 1280, 720, |
| 55 | + [ |
| 56 | + [left, 89, 101, 0x76623c], |
| 57 | + [right, 1177, 105, 0x8c7d41], |
| 58 | + [left, 156, 598, 0x738cb7], |
| 59 | + [center, 438, 102, 0x2d3957], |
| 60 | + [right, 1066, 109, 0x26304a], |
| 61 | + ] |
| 62 | + ], |
| 63 | + oper: [ |
| 64 | + [center, 1280, 720, 266, 296, 406, 440, 200], |
| 65 | + [center, 1280, 720, 547, 296, 668, 433, 200], |
| 66 | + [center, 1280, 720, 806, 290, 939, 434, 200], |
| 67 | + [center, 1280, 720, 1054, 291, 1133, 434, 200], |
| 68 | + [center, 1280, 720, 1099, 604, 1177, 660, 1000], |
| 69 | + ] |
| 70 | + }, { // 4 结算 |
| 71 | + desc: [1280, 720, |
| 72 | + [ |
| 73 | + [center, 378, 303, 0x775630], |
| 74 | + [center, 375, 443, 0x836138], |
| 75 | + [right, 908, 289, 0x73542f], |
| 76 | + [right, 923, 449, 0x87643b], |
| 77 | + [right, 891, 349, 0xa68b73], |
| 78 | + [center, 396, 355, 0xa2846c], |
| 79 | + ] |
| 80 | + ], |
| 81 | + oper: [ |
| 82 | + [center, 1280, 720, 1065, 252, 1151, 425, 1000], |
| 83 | + [center, 1280, 720, 1065, 252, 1151, 425, 1000], |
| 84 | + ] |
| 85 | + }, { // 5 票不足 |
| 86 | + desc: [ |
| 87 | + 1280, 720, |
| 88 | + [ |
| 89 | + [left, 260, 545, 0xeecfa0], |
| 90 | + [center, 468, 543, 0xedcfa4], |
| 91 | + [center, 539, 549, 0xe8c894], |
| 92 | + [center, 713, 546, 0xe6c692], |
| 93 | + [center, 922, 543, 0xefd1a3], |
| 94 | + [right, 998, 548, 0xe8c793], |
| 95 | + ] |
| 96 | + ], |
| 97 | + oper: [ |
| 98 | + [center, 1280, 720, 1065, 252, 1151, 425, 1000], |
| 99 | + ] |
| 100 | + }]; |
| 101 | + operatorFunc(thisScript: Script, thisOperator: IFuncOperator[]): boolean { |
| 102 | + if (thisScript.oper({ |
| 103 | + id: 101, |
| 104 | + name: '经营_结束', |
| 105 | + operator: [thisOperator[5]] |
| 106 | + })) { |
| 107 | + thisScript.doPush(thisScript, { text: '经营活动已结束,请查看。', before() { thisScript.myToast('脚本即将停止,正在上传数据'); } }); |
| 108 | + thisScript.stop(); |
| 109 | + sleep(3000); |
| 110 | + return true; |
| 111 | + } |
| 112 | + if (thisScript.oper({ |
| 113 | + id: 101, |
| 114 | + name: '经营_杂项', |
| 115 | + operator: [thisOperator[0], thisOperator[2], thisOperator[4]] |
| 116 | + })) { |
| 117 | + return true; |
| 118 | + } |
| 119 | + |
| 120 | + if (thisScript.oper({ |
| 121 | + id: 101, |
| 122 | + name: '经营_选人', |
| 123 | + operator: [{ |
| 124 | + desc: thisOperator[3].desc, |
| 125 | + oper: [ |
| 126 | + thisOperator[3].oper[0], |
| 127 | + thisOperator[3].oper[1], |
| 128 | + thisOperator[3].oper[2], |
| 129 | + thisOperator[3].oper[3], |
| 130 | + ] |
| 131 | + }] |
| 132 | + })) { |
| 133 | + thisScript.regionSwipe(thisOperator[3].oper[2], thisOperator[3].oper[1], [500, 800]); |
| 134 | + thisScript.regionClick([thisOperator[3].oper[3], thisOperator[3].oper[4]]); |
| 135 | + return true; |
| 136 | + } |
| 137 | + |
| 138 | + if (thisScript.oper({ |
| 139 | + name: '经营_箱子', |
| 140 | + operator: [{ desc: thisOperator[1].desc }] |
| 141 | + })) { |
| 142 | + const point3 = thisScript.findMultiColor('经营_选取店长'); |
| 143 | + if (point3) { |
| 144 | + thisScript.regionClick([[point3.x + 20, point3.y - 80, point3.x + 60, point3.y - 60, 200]]); |
| 145 | + return true; |
| 146 | + } |
| 147 | + const point = thisScript.findMultiColor('经营_箱子'); |
| 148 | + if (point) { |
| 149 | + thisScript.regionClick([[point.x - 15, point.y - 15, point.x + 15, point.y + 15, 200]]); |
| 150 | + return true; |
| 151 | + } |
| 152 | + const point2 = thisScript.findMultiColor('经营_加号'); |
| 153 | + if (point2) { |
| 154 | + thisScript.regionClick([[point2.x - 15, point2.y - 15, point2.x + 15, point2.y + 15, 200]]); |
| 155 | + return true; |
| 156 | + } |
| 157 | + } |
| 158 | + |
| 159 | + |
| 160 | + return false; |
| 161 | + } |
| 162 | +} |
0 commit comments