From 4dfb17533d7068f377fefe68696b063a9a4098db Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 10 May 2024 23:09:30 +0800 Subject: [PATCH] out limit! --- ica-rs/plugins/md5/md5-api.js | 9 +++++---- ica-rs/plugins/md5/md5-api.ts | 10 ++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ica-rs/plugins/md5/md5-api.js b/ica-rs/plugins/md5/md5-api.js index 468a129..d6dc252 100644 --- a/ica-rs/plugins/md5/md5-api.js +++ b/ica-rs/plugins/md5/md5-api.js @@ -151,6 +151,7 @@ function run_any(names, round) { }); }); } +var out_limit = 1000; function wrap_any(names, round) { return __awaiter(this, void 0, void 0, function () { var result, win_rate_1, win_rate_str, output_str_1, output_datas_1, win_rate_2, output_str_2, output_datas_2; @@ -168,10 +169,10 @@ function wrap_any(names, round) { win_rate_str = win_rate_1.toFixed(4); output_str_1 = "\u6700\u7EC8\u80DC\u7387:|".concat(win_rate_str, "%|(").concat(round, "\u8F6E)"); // 每 500 轮, 输出一次 - if (round > 500) { + if (round > out_limit) { output_datas_1 = []; result.raw_data.forEach(function (data, index) { - if (data.round % 500 === 0) { + if (data.round % out_limit === 0) { output_datas_1.push(data); } }); @@ -186,10 +187,10 @@ function wrap_any(names, round) { else { win_rate_2 = (result.score * 10000 / round).toFixed(2); output_str_2 = "\u5206\u6570:|".concat(win_rate_2, "|(").concat(round, "\u8F6E)"); - if (round > 500) { + if (round > out_limit) { output_datas_2 = []; result.raw_data.forEach(function (data, index) { - if (data.round % 500 === 0) { + if (data.round % out_limit === 0) { output_datas_2.push(data); } }); diff --git a/ica-rs/plugins/md5/md5-api.ts b/ica-rs/plugins/md5/md5-api.ts index 3b9c6c6..05712d9 100644 --- a/ica-rs/plugins/md5/md5-api.ts +++ b/ica-rs/plugins/md5/md5-api.ts @@ -139,6 +139,8 @@ async function run_any(names: string, round: number): Promise { const result = await run_any(names, round); if ('message' in result) { @@ -150,11 +152,11 @@ async function wrap_any(names: string, round: number): Promise { let win_rate_str = win_rate.toFixed(4); let output_str = `最终胜率:|${win_rate_str}%|(${round}轮)`; // 每 500 轮, 输出一次 - if (round > 500) { + if (round > out_limit) { // 把所有要找的数据拿出来 let output_datas: WinRate[] = []; result.raw_data.forEach((data, index) => { - if (data.round % 500 === 0) { + if (data.round % out_limit === 0) { output_datas.push(data); } }); @@ -169,11 +171,11 @@ async function wrap_any(names: string, round: number): Promise { // 分数结果其实还是个胜率, 不过需要 * 100 const win_rate = (result.score * 10000 / round).toFixed(2); let output_str = `分数:|${win_rate}|(${round}轮)`; - if (round > 500) { + if (round > out_limit) { // 把所有要找的数据拿出来 let output_datas: Score[] = []; result.raw_data.forEach((data, index) => { - if (data.round % 500 === 0) { + if (data.round % out_limit === 0) { output_datas.push(data); } });