Generate a YGOPro Lua script for the following Yu-Gi-Oh card effect:
If this Attack Position card is changed to face-up Defense Position: Shuffle your Deck.
--悪魔の知恵
--Tainted Wisdom
local s,id=GetID()
function s.initial_effect(c)
	--shuffle
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id,0))
	e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
	e1:SetCode(EVENT_CHANGE_POS)
	e1:SetCondition(s.condition)
	e1:SetOperation(s.operation)
	c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
	return e:GetHandler():IsPreviousPosition(POS_ATTACK) and e:GetHandler():IsPosition(POS_DEFENSE)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
	Duel.ShuffleDeck(tp)
end