Skip to content

Commit

Permalink
312的退出功能独立为320。
Browse files Browse the repository at this point in the history
缩小打开卷轴延时
  • Loading branch information
shui670 committed Feb 1, 2025
1 parent 21279da commit a233756
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 44 deletions.
40 changes: 0 additions & 40 deletions src/common/funcList/312_通用活动.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ export class Func312 implements IFuncOrigin {
type: 'text',
default: '1134,590,1225,645',
value: null,
}, {
name: 'exit',
desc: '达到时间后退出(需要ocr)',
type: 'switch',
default: false,
value: null,
}, {
name: 'time',
desc: '目标时间(输入数字,逗号分隔)',
type: 'text',
default: '1,20',
value: null,
}]
}]
operator: IFuncOperatorOrigin[] = [{
Expand Down Expand Up @@ -102,34 +90,6 @@ export class Func312 implements IFuncOrigin {
thisScript.keepScreen();
}

if (thisConf.exit && thisScript.oper({
name: '当前成绩',
operator: [{ desc: thisOperator[0].desc }]
}) && thisScript.getOcrDetector()) {
const time = String(thisConf.time).split(',');
const result = thisScript.findText('.+', 0, thisOperator[0].oper[1], '包含');
if (result.length === 0) {
console.log('未识别到任何字样');
return false;
} else {
const realTime = String(result[0].label).split(':');
if (Number.isNaN(realTime[0]) && Number.isNaN(realTime[1])) {
console.log('非数字,等待5秒继续检测');
sleep(5000);
} else if (Number(realTime[0]) == Number(time[0]) && Number(realTime[1]) <= Number(time[1]) || Number(realTime[0]) < Number(time[0])) {
return thisScript.oper({
id: 312,
name: '退出',
operator: [{
oper: [thisOperator[0].oper[2], thisOperator[0].oper[3]]
}]
}, 0)
} else {
sleep(5000);
}
}
}

if (curCnt) {
return true;
}
Expand Down
72 changes: 72 additions & 0 deletions src/common/funcList/320_计时退出.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { IFuncOrigin, IFuncOperatorOrigin, IFuncOperator } from '@/interface/IFunc';
import { Script } from '@/system/script';

// const normal = -1; //定义常量
const left = 0;
const center = 1;

export class Func320 implements IFuncOrigin {
id = 320;
name = '计时退出';
desc: '进入战斗后开始计时,达到设置时间后退出';
config = [{
desc: '',
config: [{
name: 'time',
desc: '时间(单位:秒)',
type: 'number',
default: 5,
}]
}]
operator: IFuncOperatorOrigin[] = [{
desc: '战斗界面',
oper: [
[left, 1280, 720, 22, 19, 52, 47, 1500], // 左上角返回
[center, 1280, 720, 683, 401, 795, 442, 500], // 确认
]
}, { // 1 战字
desc: [
1280, 720,
[
[center, 528, 311, 0xe2ceba],
[center, 593, 316, 0x030303],
[center, 660, 332, 0x030303],
[center, 749, 297, 0xe4d0b6],
[center, 569, 523, 0x8e2214],
[center, 709, 524, 0x881509],
[center, 638, 472, 0xf3daaa],
]
]
}];
operatorFunc(thisScript: Script, thisOperator: IFuncOperator[]): boolean {
const thisConf = thisScript.scheme.config['320'];
if (!thisScript.global.finght_time && thisScript.oper({
id: 320,
name: '战斗界面',
operator: [{
desc: thisOperator[0].desc
}]
})) {
thisScript.global.finght_time = new Date().getTime() + Number(thisConf.time) * 1000;
}
if (thisScript.global.finght_time && new Date().getTime() > thisScript.global.finght_time) {
thisScript.global.finght_time = null;
return thisScript.oper({
id: 320,
name: '计时退出',
operator: [thisOperator[0]]
});
}
if (thisScript.oper({
id: 320,
name: '战字',
operator: [{
desc: thisOperator[1].desc
}]
})) {
thisScript.global.finght_time = new Date().getTime() + Number(thisConf.time) * 1000;
return true;
}
return false;
}
}
2 changes: 1 addition & 1 deletion src/common/funcList/518_邮箱签到.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Func518 implements IFuncOrigin {
// 0 页面是否为庭院(菜单未展开) 只支持默认庭院皮肤与默认装饰
desc: '页面是否为庭院_菜单未展开_只支持默认庭院皮肤与默认装饰',
oper: [
[right, 1280, 720, 1168, 592, 1230, 690, 5000], // 庭院打开菜单
[right, 1280, 720, 1168, 592, 1230, 690, 1200], // 庭院打开菜单
[center, 1280, 720, 882, 626, 924, 668, 1200], // 庭院点击好友
[center, 1280, 720, 660, 626, 697, 664, 1200], // 庭院点击商店
],
Expand Down
2 changes: 1 addition & 1 deletion src/common/funcList/993_应用启动登录.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class Func993 implements IFuncOrigin {
// 7
desc: '页面是否为庭院_菜单未展开_只支持默认庭院皮肤与默认装饰',
oper: [
[right, 1280, 720, 1168, 592, 1230, 690, 5000], // 在首页打开菜单
[right, 1280, 720, 1168, 592, 1230, 690, 1200], // 在首页打开菜单
],
},
{
Expand Down
1 change: 0 additions & 1 deletion src/common/multiDetectColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const multiDetectColors: IMultiDetectColorsOrigin = {
[left, 106, 24, 0xcfa375],
[right, 1270, 132, 0x48371f],
[right, 1270, 700, 0x241919],
// [right, 1268, 80, 0x946430],
[right, 1266, 545, 0x573f26],
]
]
Expand Down
4 changes: 3 additions & 1 deletion src/system/GlobalStore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export type globalRootType = {
HJmin: number, // 304 绘卷系统刷新CD
HJsec: number, // 304 绘卷系统刷新CD
fengNa: boolean, // 302奉纳
finght_time: number, // 320战斗时间
}

export const globalRoot: globalRootType = {
Expand Down Expand Up @@ -193,5 +194,6 @@ export const globalRoot: globalRootType = {
HJmin: null,
HJsec: null,
fengNa: false,
xsFilter: {}
xsFilter: {},
finght_time: null,
}

0 comments on commit a233756

Please sign in to comment.