Pot
Excavate the top 3 cards of your Deck, add 1 of them to your hand, also, after that, shuffle the rest back into your Deck. You can only activate 1 "Pot of Duality" per turn. You cannot Special Summon during the turn you activate this card.
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetActivityCount(tp, ACTIVITY_SPSUMMON) == 0
	end
	--oath effects
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetReset(RESET_PHASE + PHASE_END)
	e1:SetTargetRange(1, 0)
	Duel.RegisterEffect(e1, tp)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) < 3 then
			return false
		end
		local g = Duel.GetDecktopGroup(tp, 3)
		local result = g:FilterCount(Card.IsAbleToHand, nil) > 0
		return result
	end
	Duel.SetTargetPlayer(tp)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, LOCATION_DECK)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
	Duel.ConfirmDecktop(p, 3)
	local g = Duel.GetDecktopGroup(p, 3)
	if g:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_ATOHAND)
		local sg = g:Select(p, 1, 1, nil)
		if sg:GetFirst():IsAbleToHand() then
			Duel.SendtoHand(sg, nil, REASON_EFFECT)
			Duel.ConfirmCards(1 - p, sg)
			Duel.ShuffleHand(p)
		else
			Duel.SendtoGrave(sg, REASON_RULE)
		end
		Duel.ShuffleDeck(p)
	end
end


Pot
Excavate the top 3 cards of your Deck, add 1 of them to your hand, also, after that, shuffle the rest back into your Deck. You can only activate 1 "Pot of Duality" per turn. You cannot Special Summon during the turn you activate this card.
-- Pot
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_TOHAND + CATEGORY_SEARCH)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
	e1:SetCode(EVENT_FREE_CHAIN)
	e1:SetCountLimit(1, id + EFFECT_COUNT_CODE_OATH)
	e1:SetCost(s.cost)
	e1:SetTarget(s.target)
	e1:SetOperation(s.activate)
	c:RegisterEffect(e1)
end
function s.cost(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return Duel.GetActivityCount(tp, ACTIVITY_SPSUMMON) == 0
	end
	--oath effects
	local e1 = Effect.CreateEffect(e:GetHandler())
	e1:SetType(EFFECT_TYPE_FIELD)
	e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_OATH)
	e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
	e1:SetReset(RESET_PHASE + PHASE_END)
	e1:SetTargetRange(1, 0)
	Duel.RegisterEffect(e1, tp)
end
function s.target(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		if Duel.GetFieldGroupCount(tp, LOCATION_DECK, 0) < 3 then
			return false
		end
		local g = Duel.GetDecktopGroup(tp, 3)
		local result = g:FilterCount(Card.IsAbleToHand, nil) > 0
		return result
	end
	Duel.SetTargetPlayer(tp)
	Duel.SetOperationInfo(0, CATEGORY_TOHAND, nil, 1, 0, LOCATION_DECK)
end
function s.activate(e, tp, eg, ep, ev, re, r, rp)
	local p = Duel.GetChainInfo(0, CHAININFO_TARGET_PLAYER)
	Duel.ConfirmDecktop(p, 3)
	local g = Duel.GetDecktopGroup(p, 3)
	if g:GetCount() > 0 then
		Duel.Hint(HINT_SELECTMSG, p, HINTMSG_ATOHAND)
		local sg = g:Select(p, 1, 1, nil)
		if sg:GetFirst():IsAbleToHand() then
			Duel.SendtoHand(sg, nil, REASON_EFFECT)
			Duel.ConfirmCards(1 - p, sg)
			Duel.ShuffleHand(p)
		else
			Duel.SendtoGrave(sg, REASON_RULE)
		end
		Duel.ShuffleDeck(p)
	end
end

