Skip to content

Auxiliary.SelectCardFromFieldFirst ​

Signature ​

lua
Auxiliary.SelectCardFromFieldFirst(int tp, function f, int player, int s, int o, int min, int max, any ex, ... any) -> Group

Description ​

Selection helper that first offers matching on-field cards with HINTMSG_FIELD_FIRST. If that selection is canceled, it restores the previous hint and falls back to Duel.SelectMatchingCard.

Parameters ​

  • tp int
  • f function
  • player int
  • s int
  • o int
  • min int
  • max int
  • ex any
  • ... any

Returns ​

  • Group - The selected cards.

Source ​

  • Utilities/utility.lua:1382

Used By ​

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

  • Detected in 6 indexed script(s).
  • Search this function in the Script Explorer with Auxiliary.SelectCardFromFieldFirst.
CardIDScriptDetected Calls
Ekhajar, Descendant Dragon of the Ice Barrier65424481Scripts/c65424481.lua2
Majestic Mirage98020526Scripts/c98020526.lua1
Dark Contract with the Entities60168186Scripts/c60168186.lua1
Barian's Seal38001022Scripts/c38001022.lua1
Doomking Balerdroch39185163Scripts/c39185163.lua1
Kozmojo90452877Scripts/c90452877.lua1

Script Examples ​

Ekhajar, Descendant Dragon of the Ice Barrier (65424481) ​

Source: Scripts/c65424481.lua

lua
function s.thop(e,tp,eg,ep,ev,re,r,rp)
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
	local g=aux.SelectCardFromFieldFirst(tp,aux.NecroValleyFilter(Card.IsAbleToHand),tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
	if g:GetCount()>0 then
		Duel.HintSelection(g)

Majestic Mirage (98020526) ​

Source: Scripts/c98020526.lua

lua
	elseif opval[op]==2 then
		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
		local rg=aux.SelectCardFromFieldFirst(tp,aux.NecroValleyFilter(c98020526.rfilter),tp,0,LOCATION_MZONE+LOCATION_GRAVE,1,1,nil)
		Duel.HintSelection(rg)
		Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)

Dark Contract with the Entities (60168186) ​

Source: Scripts/c60168186.lua

lua
function c60168186.rmop(e,tp,eg,ep,ev,re,r,rp)
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
	local g=aux.SelectCardFromFieldFirst(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,1,1,nil)
	if g:GetCount()>0 then
		Duel.Remove(g,POS_FACEUP,REASON_EFFECT)