This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| "use strict"; | |
| /** | |
| * Heaps PAK single-file extract + replace (repack) | |
| * Based on heaps: hxd/fmt/pak/Reader.hx, Writer.hx, Build.hx, FileSystem.hx | |
| * | |
| * Commands: | |
| * Extract one file: | |
| * node pak_onefile_edit.js extract <pakFile> "<path/in/pak.ext>" <outFile> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env node | |
| "use strict"; | |
| /** | |
| * Extract all assets from a Heaps-style PAK file (like hxd.fmt.pak.Build -x), | |
| * and convert DDS payloads to PNG using texconv.exe (must be in PATH). | |
| * | |
| * Usage: | |
| * node extract-pak.js "C:\path\to\res.pak" | |
| * node extract-pak.js "C:\path\to\res.pak" --out "C:\output\folder" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from "fs"; | |
| import crypto from "crypto"; | |
| import { decompress } from "@mongodb-js/zstd"; | |
| import { Image } from "image-js"; | |
| import Bcdec from "./wasm/bcdec.js"; | |
| // ---------------- CLI ---------------- | |
| const OLD_PATH = process.argv[2]; | |
| const NEW_PATH = process.argv[3]; | |
| if (!OLD_PATH || !NEW_PATH) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {spawn} from 'child_process'; | |
| import {EOL} from 'os'; | |
| import {request} from 'http'; | |
| const assetRipperPath = 'C:\\Users\\jaspe\\Downloads\\AssetRipper\\AssetRipper.GUI.Free.exe'; | |
| const assetFolderPath = 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\BitCraft Online Demo'; | |
| const outPath = 'C:\\Users\\jaspe\\projects\\bitcraft-assets'; | |
| let port; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {spawn} from 'child_process'; | |
| import {EOL} from 'os'; | |
| const assetRipperPath = 'C:\\Users\\kattoor\\Downloads\\AssetRipper\\AssetRipper.GUI.Free.exe'; | |
| const assetFolderPath = 'C:\\Program Files (x86)\\Steam\\steamapps\\common\\BitCraft Online Demo'; | |
| const outPath = 'C:\\Users\\kattoor\\projects\\bitcraft-assets'; | |
| let apiBase; | |
| function startAssetRipperAndListenToStdOut(executablePath) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; | |
| import fs from 'fs'; | |
| import {WebSocket} from 'ws'; | |
| import {execSync} from 'child_process'; | |
| async function getIdentityToken() { | |
| const response = await fetch('https://131.153.155.197/v1/identity', {method: 'POST'}); | |
| const {token: identityToken} = await response.json(); | |
| return identityToken; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; | |
| import fs from 'fs'; | |
| import {WebSocket} from 'ws'; | |
| async function getIdentityToken() { | |
| const response = await fetch('https://131.153.155.197/v1/identity', {method: 'POST'}); | |
| const {token: identityToken} = await response.json(); | |
| return identityToken; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; | |
| import fs from 'fs'; | |
| import {WebSocket} from 'ws'; | |
| async function getIdentityToken() { | |
| const response = await fetch('https://131.153.155.197/v1/identity', {method: 'POST'}); | |
| const {token: identityToken} = await response.json(); | |
| return identityToken; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from 'fs'; | |
| import createKbuffer from "./kbuffer.js"; | |
| import pg from 'pg'; | |
| const {Pool} = pg; | |
| const pool = new Pool({ | |
| host: 'localhost', port: 5432, user: 'postgres', password: 'nope', database: 'postgres', | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fs from 'fs'; | |
| import https from 'https'; | |
| const cutOffDate = '2024-07-15'; | |
| const dictionaryFilePath = './replays.json'; | |
| const replayFilesOutPath = './replays'; | |
| const discordUrl = 'https://discord.com/api/v9/channels/760349009192943656/messages?limit=100'; |
NewerOlder