Skip to content

Duel.GetOperationInfo ​

Signature ​

lua
Duel.GetOperationInfo(int chainc, int category) -> bool,Group|nil,int|nil,int|nil,int|nil

Description ​

Returns operation information recorded for category on chainc. The first return value is false when that category is not recorded. Otherwise, the remaining values correspond to Duel.SetOperationInfo: targets, count, target_player, and target_param. Use this in response checks that need to inspect what a Chain Link announced, such as whether it is expected to destroy cards, move cards from a location, or change LP.

How To Use It ​

Use this in response checks or follow-up operations that need to read what a Chain Link announced with Duel.SetOperationInfo.

lua
local ex,g,ct,p,loc=Duel.GetOperationInfo(ev,CATEGORY_TOHAND)
if ex and bit.band(loc or 0,LOCATION_DECK)~=0 then
    -- the Chain Link announced adding from the Deck
end

The first return value is false when that category was not recorded. The remaining values mirror the targets, count, target_player, and target_param arguments.

Parameters ​

  • chainc int - Chain Link number to inspect. Use 0 for the current Chain Link.
  • category int - CATEGORY_* flag whose operation info should be read.

Returns ​

  • bool - true if operation info for category exists; false if not.
  • Group|nil - Recorded target cards, or nil when only count/player/param were recorded.
  • int|nil - Recorded expected count.
  • int|nil - Recorded target player.
  • int|nil - Recorded category-specific parameter, often a location or amount.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:5009

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 72 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetOperationInfo.
CardIDScriptDetected Calls
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua1
Ruddy Rose Dragon40139997Scripts/c40139997.lua1
Keaf, Murk of the Ghoti99529628Scripts/c99529628.lua2
Raiza the Mega Monarch69327790Scripts/c69327790.lua2
Meklord Emperor Wisel - Synchro Absorption30221870Scripts/c30221870.lua1
Underworld Goddess of the Closed World98127546Scripts/c98127546.lua1
Shield Handler93655221Scripts/c93655221.lua1
Shooting Star Dragon24696097Scripts/c24696097.lua1
Evil★Twin GG EZ34365442Scripts/c34365442.lua1
Stardust Dragon44508094Scripts/c44508094.lua1
Baxia, Brightness of the Yang Zing83755611Scripts/c83755611.lua2
Mind Mirror Force66247039Scripts/c66247039.lua1
Salamangreat Charge83533296Scripts/c83533296.lua2
Cyber Angel Vrash78316184Scripts/c78316184.lua1
Van'Dalgyon the Dark Dragon Lord24857466Scripts/c24857466.lua2
Meklord Astro Dragon Asterisk38522377Scripts/c38522377.lua1
Atomic Scrap Dragon92361635Scripts/c92361635.lua2
Scrap Twin Dragon50278554Scripts/c50278554.lua2
Tip of the Tinying Tongue85640370Scripts/c85640370.lua1
Vendread Chimera13482075Scripts/c13482075.lua1
Reptilianne Recoil17000165Scripts/c17000165.lua2
Engraver of the Mark50078320Scripts/c50078320.lua1
Number 39: Utopia Beyond21521304Scripts/c21521304.lua2
Hyper Psychic Blaster/Assault Mode37169670Scripts/c37169670.lua2
...and 48 more

Script Examples ​

Enneacraft - Archa.TAIL (81237046) ​

Source: Scripts/c81237046.lua

lua
	if re:IsHasCategory(CATEGORY_NEGATE)
		and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
	local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
	return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
		and ep~=tp and e:GetHandler():IsFacedown()

Ruddy Rose Dragon (40139997) ​

Source: Scripts/c40139997.lua

lua
function c40139997.discon(e,tp,eg,ep,ev,re,r,rp)
	if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) or ep==tp then return false end
	local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
	return ex and (tg~=nil or tc>0)
end

Keaf, Murk of the Ghoti (99529628) ​

Source: Scripts/c99529628.lua

lua
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
	local res1,tg1=Duel.GetOperationInfo(0,CATEGORY_REMOVE)
	local res2,tg2=Duel.GetOperationInfo(0,CATEGORY_SPECIAL_SUMMON)
	local c=e:GetHandler()