Skip to content

Auxiliary.SelectFromOptions ​

Signature ​

lua
Auxiliary.SelectFromOptions(int tp, ... table) -> any|nil

Description ​

Filters option tables by their condition, calls Duel.SelectOption with the available option labels, and returns the selected table's custom value or original index. Each option is {condition, option[, value]}. If no condition is true, the helper returns nil. Its default index return is 1-based, unlike Duel.SelectOption's 0-based return.

Parameters ​

  • tp int
  • ... table

Returns ​

  • any|nil - Selected option value or 1-based option index; nil if no option is available.

Source ​

  • Utilities/utility.lua:152

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 162 indexed script(s).
  • Search this function in the Script Explorer with Auxiliary.SelectFromOptions.
CardIDScriptDetected Calls
Gem-Knight Dispersion24220368Scripts/c24220368.lua1
Magnet Bonding65514302Scripts/c65514302.lua1
Hecahands Tartaros57809669Scripts/c57809669.lua1
Chimera Fusion63136489Scripts/c63136489.lua1
Vidolium the Unstable Power Patron of Unity70488851Scripts/c70488851.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Camelot, Realm of Noble Knights and Noble Arms15635751Scripts/c15635751.lua1
Earthbound Servant Geo Gremlin8690387Scripts/c8690387.lua1
Stars Align Above the Shrine15306543Scripts/c15306543.lua1
Mitsurugi Magatama76725398Scripts/c76725398.lua1
Witchcrafter Celebration6958567Scripts/c6958567.lua1
Super Duper Polymerization44886582Scripts/c44886582.lua1
Double Interlock38129297Scripts/c38129297.lua1
Number 101: Silent Honor ARK - Soul Asylum2419596Scripts/c2419596.lua1
Dark Contact77124096Scripts/c77124096.lua1
Clown Crew Soiree Operations70058649Scripts/c70058649.lua1
Sinful Spoils of the White Forest3496543Scripts/c3496543.lua1
Yummy☆Surprise29369059Scripts/c29369059.lua1
Spirit Poacher85150300Scripts/c85150300.lua1
Shimmering Shatterer of the Sacred Beasts3441553Scripts/c3441553.lua2
Megalith Anastasis29876299Scripts/c29876299.lua1
Fabled Realm's Revival57775790Scripts/c57775790.lua1
Psychic Omnibuster70659412Scripts/c70659412.lua1
Enneacraft Reverth80015408Scripts/c80015408.lua1
...and 138 more

Script Examples ​

Gem-Knight Dispersion (24220368) ​

Source: Scripts/c24220368.lua

lua
	end
	if b1 and b2 then
		op=aux.SelectFromOptions(tp,
			{b1,aux.Stringid(id,1)},
			{b2,aux.Stringid(id,2)})

Magnet Bonding (65514302) ​

Source: Scripts/c65514302.lua

lua
	local op=0
	if b1 or b2 or b3 then
		op=aux.SelectFromOptions(tp,
			{b1,aux.Stringid(id,1),1},
			{b2,aux.Stringid(id,2),2},

Hecahands Tartaros (57809669) ​

Source: Scripts/c57809669.lua

lua
	local op=0
	if b1 or b2 then
		op=aux.SelectFromOptions(tp,
			{b1,aux.Stringid(id,1),1},
			{b2,aux.Stringid(id,2),2})