脚本提交,兑换掉落修改礼包内容, 玩家新年头像框刷成永久

This commit is contained in:
yushunrui 2024-01-12 23:32:40 +08:00
parent 8c86b05fe1
commit 184bdd304e

View File

@ -0,0 +1,48 @@
import { patchFun, patchInit } from "../patch";
class Path {
async huodong2(a: any) {
const hdids = [2002,2003]
const hdinfos = await G.mongodb.find('hdinfo', { hdid: { $in: hdids } })
for (let i = 0; i < hdinfos.length; i++) {
let hdinfo = hdinfos[i]
hdinfo.data.gift = {}
await G.mongodb.collection('hdinfo').updateOne({ "hdid": hdinfo.hdid}, { "$set": {"data.figt": {}} });
console.log(hdinfo.hdid,"finish")
}
return "sucess!!!"
}
async headFrame(a: any) {
const users = await G.mongodb.find('user', {"headFrames.25": {"$exists": 1}})
for (let i = 0; i < users.length; i++) {
let user = users[i]
user.headFrames["25"] = -1
await G.mongodb.collection('user').updateOne({ "uid": user.uid}, { "$set": {"headFrames": user.headFrames} });
console.log(user.uid, user.headFrames)
}
return "sucess!!!"
}
async run() {
await this.huodong2(1);
await this.headFrame(1);
}
}
async function main() {
await patchInit()
let patch = new Path();
await patch.run();
console.log("逻辑执行完成,等待退出");
setTimeout(function () {
console.log('结束程序');
process.exit();
}, 3000);
}
main();