Skip to content

Duel.GetCurrentChain ​

Signature ​

lua
Duel.GetCurrentChain() -> int

Description ​

Returns the number of Chain Links currently stored in the active Chain. Use Duel.GetChainInfo to inspect a specific Chain Link; this function only returns the current Chain size.

How To Use It ​

Use this when a condition or operation needs the current Chain length.

lua
if Duel.GetCurrentChain()>0 then
    -- a Chain is currently being built or resolved
end

For data about a specific Chain Link, use Duel.GetChainInfo instead of treating the count as the data itself.

Returns ​

  • int

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 170 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetCurrentChain.
CardIDScriptDetected Calls
Eternal Favorite87532344Scripts/c87532344.lua2
Spellbook of the Grand Circle11911336Scripts/c11911336.lua2
Ghostrick Renovation61818176Scripts/c61818176.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua1
Bujinki Ahashima71095768Scripts/c71095768.lua1
Dracotail Shaulas42125140Scripts/c42125140.lua1
DoSolfachord Coolia80776622Scripts/c80776622.lua2
Artmage Pact -Awakening-23599634Scripts/c23599634.lua2
Magikey Dragon - Andrabime71159974Scripts/c71159974.lua2
Echelon of the Fire Kings38798785Scripts/c38798785.lua2
Grandpa Demetto44190146Scripts/c44190146.lua1
Flame Swordsrealm73714736Scripts/c73714736.lua2
Sea Stealth Attack19089195Scripts/c19089195.lua1
Dracotail Arthalion33760966Scripts/c33760966.lua1
Favorite Hero11881272Scripts/c11881272.lua1
Arcana Force EX - The Light Ruler5861892Scripts/c5861892.lua1
Triamid Dancer69529337Scripts/c69529337.lua1
Shimmering Shatterer of the Sacred Beasts3441553Scripts/c3441553.lua3
Fabled Realm's Revival57775790Scripts/c57775790.lua2
Dracotail Gulamel79755671Scripts/c79755671.lua1
Abyss Actor - Superstar25629622Scripts/c25629622.lua2
Clown Crew Meteor93172951Scripts/c93172951.lua2
LaSolfachord Angelia27993919Scripts/c27993919.lua2
...and 146 more

Script Examples ​

Eternal Favorite (87532344) ​

Source: Scripts/c87532344.lua

lua
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
	e:SetLabel(1)
	if Duel.GetCurrentChain()==0 then
		Duel.SetChainLimitTillChainEnd(aux.FALSE)
	elseif Duel.GetCurrentChain()==1 then

Spellbook of the Grand Circle (11911336) ​

Source: Scripts/c11911336.lua

lua
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
	e:SetLabel(1)
	if Duel.GetCurrentChain()==0 then
		Duel.SetChainLimitTillChainEnd(s.chainlm)
	elseif Duel.GetCurrentChain()==1 then

Ghostrick Renovation (61818176) ​

Source: Scripts/c61818176.lua

lua
			local cost=te:GetCost()
			if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
			Duel.RaiseEvent(sc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
		end
	end