feat: send challenge every battle
parent
f2dce12532
commit
d953279549
10
README.md
10
README.md
|
|
@ -9,6 +9,16 @@ Export your battles from SplatNet to stat.ink
|
|||
2. Run
|
||||
`deno run -Ar https://raw.githubusercontent.com/spacemeowx2/s3si.ts/main/s3si.ts`
|
||||
|
||||
```
|
||||
Options:
|
||||
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
||||
--exporter <exporter>, -e Exporter list to use (default: stat.ink)
|
||||
Multiple exporters can be separated by commas
|
||||
(e.g. "stat.ink,file")
|
||||
--no-progress, -n Disable progress bar
|
||||
--help Show this help message and exit
|
||||
```
|
||||
|
||||
## Credits
|
||||
|
||||
- https://github.com/frozenpandaman/s3s
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
|
||||
|
||||
export const AGENT_NAME = "s3si.ts";
|
||||
export const S3SI_VERSION = "0.1.1";
|
||||
export const S3SI_VERSION = "0.1.2";
|
||||
export const NSOAPP_VERSION = "2.3.1";
|
||||
export const WEB_VIEW_VERSION = "1.0.0-216d0219";
|
||||
|
||||
|
|
|
|||
|
|
@ -164,8 +164,7 @@ export class StatInkExporter implements BattleExporter<VsBattle> {
|
|||
return result;
|
||||
}
|
||||
async mapBattle(
|
||||
{ lastInChallenge, bankaraMatchChallenge, listNode, detail: vsDetail }:
|
||||
VsBattle,
|
||||
{ bankaraMatchChallenge, listNode, detail: vsDetail }: VsBattle,
|
||||
): Promise<StatInkPostBody> {
|
||||
const {
|
||||
knockout,
|
||||
|
|
@ -257,12 +256,10 @@ export class StatInkExporter implements BattleExporter<VsBattle> {
|
|||
result.rank_after = result.rank_before;
|
||||
result.rank_after_s_plus = result.rank_before_s_plus;
|
||||
}
|
||||
if (lastInChallenge) {
|
||||
result.challenge_win = bankaraMatchChallenge.winCount;
|
||||
result.challenge_lose = bankaraMatchChallenge.loseCount;
|
||||
result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ??
|
||||
undefined;
|
||||
}
|
||||
result.challenge_win = bankaraMatchChallenge.winCount;
|
||||
result.challenge_lose = bankaraMatchChallenge.loseCount;
|
||||
result.rank_exp_change = bankaraMatchChallenge.earnedUdemaePoint ??
|
||||
undefined;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
6
s3si.ts
6
s3si.ts
|
|
@ -86,20 +86,16 @@ class BattleFetcher {
|
|||
return {
|
||||
bankaraMatchChallenge: null,
|
||||
listNode: null,
|
||||
lastInChallenge: null,
|
||||
};
|
||||
}
|
||||
|
||||
const { bankaraMatchChallenge } = group;
|
||||
const listNode = group.historyDetails.nodes.find((i) => i._bid === bid) ??
|
||||
null;
|
||||
const idx = group.historyDetails.nodes.indexOf(listNode!);
|
||||
|
||||
return {
|
||||
bankaraMatchChallenge,
|
||||
listNode,
|
||||
lastInChallenge: (bankaraMatchChallenge?.state !== "INPROGRESS") &&
|
||||
(idx === 0),
|
||||
};
|
||||
}
|
||||
async getBattleDetail(id: string): Promise<VsHistoryDetail> {
|
||||
|
|
@ -143,7 +139,7 @@ class App {
|
|||
constructor(public opts: Opts) {
|
||||
if (this.opts.help) {
|
||||
console.log(
|
||||
`Usage: deno run --allow-net --allow-read --allow-write ${Deno.mainModule} [options]
|
||||
`Usage: deno run -A ${Deno.mainModule} [options]
|
||||
|
||||
Options:
|
||||
--profile-path <path>, -p Path to config file (default: ./profile.json)
|
||||
|
|
|
|||
Loading…
Reference in New Issue