脚本记录

118 阅读1分钟
await (async function letUsGo(){
    // ····················自定义区域·START···················
    // 你的uid
let uid = '';
    // request header 中的 authorization
let authorization = '';
    // request header 中的 x-tt-gameid
let gameid = '';
    // 0:开局往左 1:开局往右 2:中期 3:后期飞翔 4:后期扫荡
let commandStep = 0;
    // ····················自定义区域·END·····················
  
let commandArr = [
        // 开局往左
        [{"times":2,"command":["2","L","D","L","4","D","6","R","D","R"]}],
        // 开局往右
        [{"times":2,"command":["2","R","D","R","6","D","4","L","D","L"]}],
        // 中期:赌万米
        [{"times":10,"command":[{"times":2,"command":["D","2","L","D","L","4","D","6","U","L","D","R"]},"L","D"]},{"times":2,"command":["U","U","8","R"]},{"times":10,"command":[{"times":2,"command":["D","2","R","D","R","6","D","4","U","R","D","L"]},"R","D"]},{"times":2,"command":["U","U","8","L"]}],
        // 后期:万米飞翔
        [{"times":10,"command":[{"times":2,"command":["D","2","L","D","L","4","D","6","U","L","D","R"]},"L","D"]},{"times":2,"command":["U","U","8","R"]},{"times":10,"command":[{"times":2,"command":["D","2","R","D","R","6","D","4","U","R","D","L"]},"R","D"]},{"times":2,"command":["U","U","8","L"]}],
        // 后期:无情扫荡
        [{"times":10,"command":["L","L","L","4","L","L","L","4","D","R","R","R","6","R","R","R","6"]},{"times":3,"command":["U","U","L","L","8","4"]},{"times":6,"command":["D","2","L","D","L","4","D","6","U","L","D","R"]},"L","D",{"times":10,"command":["R","R","R","6","R","R","R","6","D","L","L","L","4","L","L","L","4"]},{"times":3,"command":["U","U","R","R","8","6"]},{"times":6,"command":["D","2","R","D","R","6","D","4","U","R","D","L"]},"R","D"]
];
let coreCode = commandArr[commandStep];
let loop = commandStep <= 1 ? 2 : 4; // 外层循环次数
let params = {"command": []};
let linshiyinyong = params;
for (let i = 0;i<loop;i++){
  linshiyinyong['command'].push({"times": 10, "command": []});
  linshiyinyong = linshiyinyong.command[0];
  if (i >= loop-1) {
      linshiyinyong.command.push(...coreCode);
  }
}
linshiyinyong = null;
let datarus = await fetch('https://juejin-game.bytedance.com/game/sea-gold/game/command?uid=' + uid + '&time=' + Date.parse(new Date()), {
  method: 'POST',
  credentials: "include",
  headers: {
    'Content-type': 'application/json; charset=UTF-8',
    'authorization': authorization,
    'accept': 'application/json, text/plain, */*',
    'content-length': JSON.stringify(params).length,
    'x-tt-gameid': gameid,
  },
  body: JSON.stringify(params)
}).then(async (res) => {
    return res.json();
});
return datarus;
})();