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
| #!/bin/env python3 | |
| from sys import argv | |
| from typing import cast | |
| from json import loads, dumps | |
| from struct import unpack, pack | |
| from os import makedirs, scandir | |
| from os.path import join, split, sep | |
| def efasar(inFile: str, filename: str): |
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
| const std = @import("std"); | |
| const hclen_idxs = [_]u8{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; | |
| const H30 = Huff(u8, 30); | |
| const H288 = Huff(u16, 288); | |
| const fixed = fixed: { | |
| var hdist: H30 = undefined; | |
| var hlitlen: H288 = undefined; | |
| hdist.init(&(.{5} ** 30)); | |
| hlitlen.init(&(.{8} ** 144 ++ .{9} ** 112 ++ .{7} ** 24 ++ .{8} ** 8)); | |
| break :fixed .{ .hdist = hdist, .hlitlen = hlitlen }; |
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
| type Endian = '<' | '>'; | |
| function safeNumber(v: bigint) { | |
| const min = Number.MIN_SAFE_INTEGER; | |
| const max = Number.MAX_SAFE_INTEGER; | |
| if (v < min || v > max) throw new Error(`Number(${v})`); else return Number(v); | |
| } | |
| function many<T>(count: number, func: () => T) { | |
| const a: T[] = []; |
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
| 1. 需要字体: Ume P Gothic, IPAmjMincho | |
| 2. 文件结构 | |
| game_ete/ | |
| bgimage/ | |
| bgm/ (所有BGM文件名改为全小写) | |
| ... 除script.iga外其他iga文件解压,每个一个文件夹 | |
| scripts.js 使用我的 flowerscript-js 反编译的脚本,组合成一个js: const game_script = { "脚本文件名.s": { 反编译结果 }, ... }; | |
| index_hiver.html | |
| index.js (ts编译后) | |
| 3. 运行方法 |
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
| 'use strict'; | |
| module.exports = { | |
| workNextData, | |
| parseWorkHTML, | |
| parseEpisodeHTML, | |
| }; | |
| let lazy_JSDOM = null; |
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
| const std = @import("std"); | |
| const Allocator = std.mem.Allocator; | |
| pub fn box(allocator: Allocator, value: anytype) !*@TypeOf(value) { | |
| const ptr = try allocator.create(@TypeOf(value)); | |
| ptr.* = value; | |
| return ptr; | |
| } | |
| test { |
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
| const std = @import("std"); | |
| pub fn StructFieldsTuple(comptime T: type) type { | |
| var info = switch (@typeInfo(T)) { | |
| .Struct => |st| st, | |
| else => @compileError("T must be a struct"), | |
| }; | |
| var newFields = info.fields[0..info.fields.len].*; | |
| inline for (&newFields, 0..) |*f, i| f.name = std.fmt.comptimePrint("{}", .{i}); | |
| info.decls = &.{}; |
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
| fn Slice(comptime T: anytype) type { | |
| return struct { | |
| const Self = @This(); | |
| const Error = error{EOF}; | |
| left: T, | |
| pub fn take(self: *Self, n: anytype) Error!@TypeOf(self.left[0..n]) { | |
| if (self.left.len < n) return Error.EOF; | |
| defer self.left = self.left[n..]; | |
| return self.left[0..n]; | |
| } |
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
| document.body.onclick = () => { | |
| document.body.onclick = null; | |
| navigator.clipboard.writeText(location.href + '\n\n' + | |
| document.querySelector('article .mod-entry-set').innerText); | |
| al = document.querySelectorAll('div.entry-bottom-pn>a'); | |
| if (al.length < 3) return alert('no next link'); | |
| window.location = al[2].href; | |
| }; | |
| // bookmark this: |
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
| const c = @cImport(@cInclude("libdeflate.h")); | |
| pub const Error = error{ | |
| LibDeflateAlloc, | |
| LibDeflateBadData, | |
| LibDeflateShortOutput, | |
| LibDeflateInsufficientSpace, | |
| LibDeflateOther, | |
| }; |
NewerOlder