ygo_ensure_script
Generates and verifies Yu-Gi-Oh! Lua scripts for cards without official versions, using reveal articles or card database text, and swaps in official ProjectIgnis scripts when available.
Instructions
Manage Lua scripts for cards that have no official one. from-news reads a reveal article (e.g. YGOrganization), extracts the card name, artwork URLs, text and stats, assigns a temporary ID and generates the script; resolve generates from the cards.cdb text when the card is already in the database. Every generated script is verified by loading it into ocgcore and is automatically replaced by the official ProjectIgnis script as soon as one exists. Returns provenance (manual/custom/official/generated), confidence, recognised patterns, engine errors and the replacedGenerated flag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Article URL for topic=from-news (e.g. a YGOrganization reveal post) | |
| topic | Yes | resolve = fetch/generate a script for one card; from-news = read a reveal article, extract the card and generate its script; upgrade = sweep every generated script and replace it if an official one exists; inventory = counts; list = generated scripts | |
| tempId | No | Temporary ID to assign (defaults to the next free 990000000+ value) | |
| cardName | No | Override the card name extracted from the article | |
| passcode | No | Card passcode (required for topic=resolve) | |
| skipVerify | No | Skip engine verification (faster, but not guaranteed to run) | |
| allowGenerate | No | Allow generating a script when no official one exists | |
| refreshOfficial | No | Bypass the cache and check ProjectIgnis now |