lua-api-reference

Documents YGOPro Lua scripting APIs for Card, Effect, Group, and Duel objects.

1|Updated Apr 16, 2026
One-click install
npx skills add https://github.com/ZisIsNotZis/ygoskill --skill lua-api-reference-zisisnotzis
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: lua-api-reference
Source: https://github.com/ZisIsNotZis/ygoskill/tree/main/ygopro/script/api
Command: npx skills add https://github.com/ZisIsNotZis/ygoskill --skill lua-api-reference-zisisnotzis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing YGOPro card scripts requires knowing hundreds of Lua API functions across Card, Effect, Group, and Duel objects, and this reference organizes them into focused, searchable documents so you can find exact signatures, parameters, and return types without reading the ocgcore C++ source. ## Core Features & Use Cases - Complete API Coverage: Documents Card getters, actions, identity, state, and effect management; Effect creation, setters, and callbacks; Group filtering and selection; and the global Duel controller. - Constants Reference: Lists all core constants including locations, positions, types, attributes, races, reasons, summon types, effect codes, events, and categories. - Procedure Helpers: Covers Auxiliary summoning procedures for Synchro, Xyz, Fusion, Ritual, Link, Pendulum, and Gemini monsters. - Use Case: When scripting a new custom card effect, look up the exact signature of Duel.SpecialSummon, the correct EFFECT_TYPE and EVENT constants, and the callback parameter order for condition, cost, target, and operation functions. ## Quick Start Ask the AI to look up the YGOPro Lua API for registering a trigger effect on a card, including the required constants and callback signatures.

Frequently Asked Questions about lua-api-reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register a card effect in YGOPro Lua scripting?▼

Create an effect with Effect.CreateEffect(card), configure it with setters like SetType, SetCode, SetRange, and SetOperation, then register it via card:RegisterEffect(effect) or Duel.RegisterEffect(effect, player). The reference documents every setter and its parameters.

What are the YGOPro Lua API callback signatures for effects?▼

All callbacks receive e, tp, eg, ep, ev, re, r, rp. Condition returns a boolean, Cost uses chk to check or pay, Target sets operation info via Duel.SetOperationInfo, and Operation resolves the effect with no return value.

Where do I find YGOPro constants like locations and effect codes?▼

The constants.md and consteffect.md files list all values from script/constant.lua, including LOCATION_MZONE, POS_FACEUP_ATTACK, TYPE_MONSTER, EFFECT_TYPE_TRIGGER_O, EVENT_SUMMONED, and CATEGORY_DESTROY with their hexadecimal values.

How do I add a Synchro or Xyz summoning procedure to a custom card?▼

Use Auxiliary.AddSynchroProcedure(c, f1, f2, minc, maxc) for Synchro or Auxiliary.AddXyzProcedure(c, f, lv, ct) for Xyz. The procedure.md file documents all Fusion, Ritual, Link, Pendulum, and Gemini procedure helpers as well.

Does the YGOPro Lua API support filtering and selecting card groups?▼

Yes, Group objects support Filter, FilterCount, IsExists, Select, FilterSelect, and sum-based operations like CheckWithSumEqual. Duel also provides GetMatchingGroup and SelectMatchingCards for field-wide filtered queries.