name: Flowerbot
card_text: If this card is sent to the Graveyard: Draw 1 card, then place 1 card from your hand on the top of the Deck.
lua: local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW + CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_TO_GRAVE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, nil, 1, tp, LOCATION_HAND)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	if Duel.Draw(p, d, REASON_EFFECT) == 0 then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Hint(HINT_SELECTMSG, p, HINTMSG_TODECK)
  	local g = Duel.SelectMatchingCard(p, Card.IsAbleToDeck, p, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
  end
  
  
source_text: Flowerbot
  If this card is sent to the Graveyard: Draw 1 card, then place 1 card from your hand on the top of the Deck.
target_text: -- Flowerbot
  local s, id, o = GetID()
  function s.initial_effect(c)
  	--token
  	local e1 = Effect.CreateEffect(c)
  	e1:SetDescription(aux.Stringid(id, 0))
  	e1:SetCategory(CATEGORY_DRAW + CATEGORY_TODECK)
  	e1:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_TRIGGER_F)
  	e1:SetCode(EVENT_TO_GRAVE)
  	e1:SetTarget(s.target)
  	e1:SetOperation(s.operation)
  	c:RegisterEffect(e1)
  end
  function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
  	if chk == 0 then
  		return true
  	end
  	Duel.SetTargetPlayer(tp)
  	Duel.SetTargetParam(1)
  	Duel.SetOperationInfo(0, CATEGORY_DRAW, nil, 0, tp, 1)
  	Duel.SetOperationInfo(0, CATEGORY_TODECK, nil, 1, tp, LOCATION_HAND)
  end
  function s.operation(e, tp, eg, ep, ev, re, r, rp)
  	local p, d = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER, CHAININFO_TARGET_PARAM)
  	if Duel.Draw(p, d, REASON_EFFECT) == 0 then
  		return
  	end
  	Duel.BreakEffect()
  	Duel.Hint(HINT_SELECTMSG, p, HINTMSG_TODECK)
  	local g = Duel.SelectMatchingCard(p, Card.IsAbleToDeck, p, LOCATION_HAND, 0, 1, 1, nil)
  	Duel.SendtoDeck(g, nil, SEQ_DECKTOP, REASON_EFFECT)
  end
  
  