npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mar7th/genshin-wish-create

v1.0.2

Published

[![English](https://img.shields.io/badge/English-blue)](./README.en.md) [![中文](https://img.shields.io/badge/中文-red)](./README.md)

Downloads

10

Readme

English 中文

@mar7th/genshin-wish-create

根据文本配置生成原神抽卡记录(UIGF 格式),方便导入第三方工具(如寻空、椰羊等)。

简介

本工具通过读取一系列简单的文本列表(每行 名称 数量),模拟生成完整的抽卡历史记录。输出文件符合 UIGF v4.1 标准,可直接导入主流抽卡记录管理工具。

使用抽卡工具导出的json作为抽卡记录文件时,可以直接把生成的记录添加到原本的记录前面,可用于补充历史记录

主要特性

  • 支持五种卡池:角色活动池(301)、武器活动池(302)、混池(400)、常驻池(200)、新手池(100)
  • 自动处理保底机制:每10抽一个4星,最后一个是5星
  • item-id-dict.json 读取物品真实ID,并根据ID长度自动判断类型(8位为角色,其它为武器)
  • 增量追加:将新生成的记录插入到已有 JSON 文件的 list 头部,不覆盖原有记录
  • 多UIG支持:可指定用户UID,自动匹配或创建对应条目

安装

npm install @mar7th/genshin-wish-create

使用方法

1. 准备输入文件

在项目根目录下创建以下文件(路径可自定义,见配置):

角色列表.txt武器列表.txt混池列表.txt常驻列表.txt新手列表.txt
格式均为每行:

角色/武器名称 预期总出现次数

例如:

纳西妲 1
芙宁娜 2
  • 次数表示最终抽取到该五星的次数(最后一个五星)。
  • 每个物品的抽取过程自动按保底规则填充3星/4星物品。

用户uid.txt
仅包含一行,你的原神UID(字符串,如 "123456789")。

抽卡记录文件名.txt
仅包含一行,要生成或追加的JSON文件名(如 wish_data.json)。

item-id-dict.json
来自 UIGF 物品 ID 字典,格式:

{
  "lang": {
    "chs": {
      "纳西妲": "10000049",
      "神射手之誓": "15302",
      ...
    }
  }
}
  • ID为字符串,长度8为角色,否则为武器。

2. 在代码中使用

const { main } = require('@mar7th/genshin-wish-create');

main();

默认从当前工作目录读取上述 .txt.json 文件,并生成/更新抽卡记录。

3. 自定义文件路径

如果你想修改文件路径,可修改 main 函数中的路径变量(源代码中硬编码)。未来版本可能支持配置对象。

输出格式

生成的 JSON 文件结构(UIGF v4.1):

{
  "info": {
    "export_timestamp": 1778324784,
    "export_app": "genshin-wish-export",
    "export_app_version": "v0.12.1",
    "version": "v4.1"
  },
  "hk4e": [
    {
      "uid": "123456789",
      "timezone": 8,
      "lang": "zh-cn",
      "list": [
        /* 生成的抽卡记录,每条包含 uigf_gacha_type, gacha_type, item_id, time, name, item_type, rank_type, id */
      ]
    }
  ]
}
  • time2020-09-15 04:00:00(原神开服时间)开始,每次抽取增加 1 秒,保证时序递增。
  • id 为唯一ID,从 100000000000000000n(BigInt)开始自增,最后转为字符串存入 JSON。

注意事项

  • Node.js 版本需支持 BigInt(Node 10.4 以上)。
  • 首次运行不要求目标 JSON 文件存在,会自动创建。
  • 生成的记录会插入到现有 list头部,即新记录在前。
  • 物品ID字典必须完整覆盖你使用的所有物品名称,否则会警告并使用默认ID。
  • item-id-dict.json 更新至莉奈娅,如果有新增需要更新文件

License

MIT © mar7th


示例项目结构

your-project/
├── node_modules/
├── 角色列表.txt
├── 武器列表.txt
├── 混池列表.txt
├── 常驻列表.txt
├── 新手列表.txt
├── 用户uid.txt
├── 抽卡记录文件名.txt
├── item-id-dict.json
├── index.js          // 调用 main()
└── package.json

示例效果

根据示例代码生成的效果图如下

源代码

本npm仓库即为源代码,同时也可以访问以下仓库地址:

  • gitee: https://gitee.com/march7th-online/genshin-wish-create
  • github: https://github.com/mar7th-org/genshin-wish-create