name: Deskbot
card_text: Gains 500 ATK/DEF for each Machine monster you control. If 2 or more Machine monsters are Special Summoned at the same time, while this card is in your GY (except during the Damage Step): You can Special Summon this card.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--same effect send this card to grave and summon another card check
  	local e0 = aux.AddThisCardInGraveAlreadyCheck(c)
  	--atk/def
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetLabelObject(e0)
  	e3:SetCondition(s.spcon)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c, se)
  	return c:IsFaceup() and c:IsRace(RACE_MACHINE) and (se == nil or c:GetReasonEffect() ~= se)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.filter, c:GetControler(), LOCATION_MZONE, 0, nil) * 500
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	local se = e:GetLabelObject():GetLabelObject()
  	return eg:IsExists(s.filter, 2, nil, se)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  
source_text: Deskbot
  Gains 500 ATK/DEF for each Machine monster you control. If 2 or more Machine monsters are Special Summoned at the same time, while this card is in your GY (except during the Damage Step): You can Special Summon this card.
target_text: -- Deskbot
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--same effect send this card to grave and summon another card check
  	local e0 = aux.AddThisCardInGraveAlreadyCheck(c)
  	--atk/def
  	local e1 = Effect.CreateEffect(c)
  	e1:SetType(EFFECT_TYPE_SINGLE)
  	e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
  	e1:SetRange(LOCATION_MZONE)
  	e1:SetCode(EFFECT_UPDATE_ATTACK)
  	e1:SetValue(s.atkval)
  	c:RegisterEffect(e1)
  	local e2 = e1:Clone()
  	e2:SetCode(EFFECT_UPDATE_DEFENSE)
  	c:RegisterEffect(e2)
  	--spsummon
  	local e3 = Effect.CreateEffect(c)
  	e3:SetDescription(aux.Stringid(id, 0))
  	e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
  	e3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_TRIGGER_O)
  	e3:SetCountLimit(1, EFFECT_COUNT_CODE_CHAIN)
  	e3:SetRange(LOCATION_GRAVE)
  	e3:SetProperty(EFFECT_FLAG_DELAY)
  	e3:SetCode(EVENT_SPSUMMON_SUCCESS)
  	e3:SetLabelObject(e0)
  	e3:SetCondition(s.spcon)
  	e3:SetTarget(s.sptg)
  	e3:SetOperation(s.spop)
  	c:RegisterEffect(e3)
  end
  function s.filter(c, se)
  	return c:IsFaceup() and c:IsRace(RACE_MACHINE) and (se == nil or c:GetReasonEffect() ~= se)
  end
  function s.atkval(e, c)
  	return Duel.GetMatchingGroupCount(s.filter, c:GetControler(), LOCATION_MZONE, 0, nil) * 500
  end
  function s.spcon(e, tp, eg, ep, ev, re, r, rp)
  	local se = e:GetLabelObject():GetLabelObject()
  	return eg:IsExists(s.filter, 2, nil, se)
  end
  function s.sptg(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and e:GetHandler():IsCanBeSpecialSummoned(e, 0, tp, false, false)
  	end
  	Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, e:GetHandler(), 1, 0, 0)
  end
  function s.spop(e, tp, eg, ep, ev, re, r, rp)
  	local c = e:GetHandler()
  	if c:IsRelateToEffect(e) then
  		Duel.SpecialSummon(c, 0, tp, tp, false, false, POS_FACEUP)
  	end
  end
  
  