name: Automatic
card_text: When your opponent Normal or Special Summons a monster(s) with 1000 or more ATK, reveal 1 "Iron Core of Koa'ki Meiru" in your hand to activate this card. Destroy that Summoned monster(s).
external_ids: local CARD_ID_0 = 36623431 --Iron Core of Koa'ki Meiru
  
lua: local CARD_ID_0 = 36623431 --Iron Core of Koa'ki Meiru
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate(summon)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_ACTIVATE)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.target2)
  	e2:SetOperation(s.activate2)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsCode(CARD_ID_0) and not c:IsPublic()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.ShuffleHand(tp)
  end
  function s.filter(c, tp, ep)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and ep ~= tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local tc = eg:GetFirst()
  	if chk == 0 then
  		return s.filter(tc, tp, ep)
  	end
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, tc, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = eg:GetFirst()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(1000) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.filter2(c, tp)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and c:IsSummonPlayer(1 - tp)
  end
  function s.target2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return eg:IsExists(s.filter2, 1, nil, tp)
  	end
  	local g = eg:Filter(s.filter2, nil, tp)
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.filter3(c, e, tp)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and c:IsSummonPlayer(1 - tp) and c:IsRelateToEffect(e)
  end
  function s.activate2(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(s.filter3, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.Destroy(g, REASON_EFFECT)
  	end
  end
  
  
source_text: Automatic
  When your opponent Normal or Special Summons a monster(s) with 1000 or more ATK, reveal 1 "Iron Core of Koa'ki Meiru" in your hand to activate this card. Destroy that Summoned monster(s).
target_text: -- Automatic
  local CARD_ID_0 = 36623431 --Iron Core of Koa'ki Meiru
  local s, id, o = GetID()
  function s.initial_effect(c)
  	aux.AddCodeList(c, CARD_ID_0)
  	--Activate(summon)
  	local e1 = Effect.CreateEffect(c)
  	e1:SetCategory(CATEGORY_DESTROY)
  	e1:SetType(EFFECT_TYPE_ACTIVATE)
  	e1:SetCode(EVENT_SUMMON_SUCCESS)
  	e1:SetCost(s.cost)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.activate)
  	c:RegisterEffect(e1)
  	local e2 = Effect.CreateEffect(c)
  	e2:SetCategory(CATEGORY_DESTROY)
  	e2:SetType(EFFECT_TYPE_ACTIVATE)
  	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e2:SetCost(s.cost)
  	e2:SetTarget(s.target2)
  	e2:SetOperation(s.activate2)
  	c:RegisterEffect(e2)
  end
  function s.cfilter(c)
  	return c:IsCode(CARD_ID_0) and not c:IsPublic()
  end
  function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.IsExistingMatchingCard(s.cfilter, tp, LOCATION_HAND, 0, 1, nil)
  	end
  	Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_CONFIRM)
  	local g = Duel.SelectMatchingCard(tp, s.cfilter, tp, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.ConfirmCards(1 - tp, g)
  	Duel.ShuffleHand(tp)
  end
  function s.filter(c, tp, ep)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and ep ~= tp
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	local tc = eg:GetFirst()
  	if chk == 0 then
  		return s.filter(tc, tp, ep)
  	end
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, tc, 1, 0, 0)
  end
  function s.activate(e, tp, eg, ep, ev, re, r, rp)
  	local tc = eg:GetFirst()
  	if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(1000) then
  		Duel.Destroy(tc, REASON_EFFECT)
  	end
  end
  function s.filter2(c, tp)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and c:IsSummonPlayer(1 - tp)
  end
  function s.target2(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return eg:IsExists(s.filter2, 1, nil, tp)
  	end
  	local g = eg:Filter(s.filter2, nil, tp)
  	Duel.SetTargetCard(eg)
  	Duel.SetOperationInfo(0, CATEGORY_DESTROY, g, g:GetCount(), 0, 0)
  end
  function s.filter3(c, e, tp)
  	return c:IsFaceup() and c:IsAttackAbove(1000) and c:IsSummonPlayer(1 - tp) and c:IsRelateToEffect(e)
  end
  function s.activate2(e, tp, eg, ep, ev, re, r, rp)
  	local g = eg:Filter(s.filter3, nil, e, tp)
  	if g:GetCount() > 0 then
  		Duel.Destroy(g, REASON_EFFECT)
  	end
  end
  
  