更新ruaa
This commit is contained in:
parent
6fc85322cd
commit
a99467dfbf
3
ica-rs/plugins/md5/.gitignore
vendored
3
ica-rs/plugins/md5/.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
input.txt
|
||||
node_modules
|
||||
package.json
|
||||
package.json
|
||||
package-lock.json
|
@ -47,7 +47,7 @@ function fight(names) {
|
||||
case 0:
|
||||
// 检查一下输入是否合法
|
||||
// 比如里面有没有 !test!
|
||||
if (names.startsWith("!test!")) {
|
||||
if (names.indexOf("!test!") !== -1) {
|
||||
throw new Error("你怎么在对战输入里加 !test!(恼)\n${names}");
|
||||
}
|
||||
return [4 /*yield*/, md5_module.fight(names)];
|
||||
@ -164,10 +164,11 @@ function main() {
|
||||
fs = require("fs");
|
||||
path = require("path");
|
||||
names = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8");
|
||||
return [4 /*yield*/, fight(names)];
|
||||
return [4 /*yield*/, md5_module.run_any(names, 50000)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
console.log("\u8D62\u5BB6:|".concat(result.source_plr, "|"));
|
||||
// console.log(`赢家:|${result.source_plr}|`);
|
||||
console.log(result);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
|
@ -156,8 +156,10 @@ async function main() {
|
||||
const path = require("path");
|
||||
|
||||
const names = fs.readFileSync(path.resolve(__dirname, "input.txt"), "utf-8");
|
||||
const result = await fight(names);
|
||||
console.log(`赢家:|${result.source_plr}|`);
|
||||
// const result = await fight(names);
|
||||
const result = await md5_module.run_any(names, 50000);
|
||||
// console.log(`赢家:|${result.source_plr}|`);
|
||||
console.log(result);
|
||||
}
|
||||
|
||||
main();
|
||||
|
@ -21845,6 +21845,30 @@ const runner = {
|
||||
});
|
||||
});
|
||||
},
|
||||
run_any: (names, round) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let data = [];
|
||||
// 三种情况都带上
|
||||
finish_trigger.on("done_fight", (data) => {
|
||||
resolve(fmt_RunUpdate(data));
|
||||
});
|
||||
finish_trigger.on("win_rate", (run_round, win_count) => {
|
||||
data.push({ round: run_round, win_count: win_count });
|
||||
if (run_round >= round) {
|
||||
stop_bomb = true;
|
||||
resolve({ score: win_count, raw_data: data });
|
||||
}
|
||||
});
|
||||
finish_trigger.on("score_report", (run_round, score) => {
|
||||
data.push({ round: run_round, score: score });
|
||||
if (run_round >= round) {
|
||||
stop_bomb = true;
|
||||
resolve({ score: score, raw_data: data });
|
||||
}
|
||||
});
|
||||
main(names);
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
if (run_env.from_code) {
|
||||
|
@ -15,7 +15,7 @@ else:
|
||||
IcaNewMessage = TypeVar("NewMessage")
|
||||
IcaClient = TypeVar("IcaClient")
|
||||
|
||||
_version_ = "0.3.0"
|
||||
_version_ = "0.4.0"
|
||||
|
||||
COMMAND = "/namerena"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user