Can anyone help me with my spellcast?  I have looked through many spellcast and have cobbled together a simple one for farming dyna on bst.  However my weapsonskill gear swap does not work when I am enagaged, only when I am not> can anyone tell me where I am going wrong.
Thanks
<?xml version="1.0" ?>
<spellcast>
    <config RequiredVersion="2.22" />
<variables clear="True">
 
   
<!-- Engaged Set Rule -->
        <var name="Attack">Normal</var> <!-- Normal, Evasion -->
   </variables>
    <sets>
        <group name="BST" default="yes">
            <set name="Normal">
                <main></main>
                <sub></sub>
                <ammo>Pet Food Theta</ammo>
                <head>Ocelo. Headpiece</head>
                <neck>Rancor Collar</neck>
                <lear>Brutal Earring</lear>
                <rear>Suppanomimi</rear>
                <body>Porthos Byrnie</body>
                <hands>Ocelot Gloves</hands>
                <lring>Rajas Ring</lring>
                <rring>Spiral Ring</rring>
                <back>Atheling Mantle</back>
                <waist>Twilight belt</waist>
                <legs>Ferine Quijotes +2</legs>
                <feet>Monster Gaiters +2</feet>
            </set>
            
            <set name="Idle" Baseset="$Attack">
                <head>Twilight Helm</head>
                <body>Twilight Mail</body>
		<neck>Orochi Nodowa</neck>                
            </set>
		 <set name="Reward">
                 <head>Twilight Helm</head>
                <body>Twilight Mail</body>
                <hands>Ogre Gloves</hands>
                <feet>Monster Gaiters +2</feet>
            </set>
            <set name="Attack" Baseset="$Normal">
                <head>Ocelo. Headpiece</head>
                <neck>Rancor Collar</neck>
                <lear>Brutal Earring</lear>
                <rear>Suppanomimi</rear>
                <body>Porthos Byrnie</body>
                <hands>Ocelot Gloves</hands>
                <lring>Rajas Ring</lring>
                <rring>Spiral Ring</rring>
                <back>Atheling Mantle</back>
                <waist>Twilight belt</waist>
                <legs>Ferine Quijotes +2</legs>
                <feet>Monster Gaiters +2</feet>
            </set>
		<set name="Ruinator" Baseset="$Attack">
                <head>Twilight Helm</head>
                <body>Twilight Mail</body>
		<neck>Breeze Gorget</neck>
                <hands>Frn. Manoplas +2</hands>
                <waist>Snow Belt</waist>
                <legs>Dux Cuisses</legs>
                <feet>Monster Gaiters +2</feet>
		</set>
                </group>
    </sets>
 
    <rules>
        
        <if Status="engaged">
            <action type="equip" when="aftercast|idle|engaged" set="$Attack" />
        </if>
        <if NotStatus="engaged">            
                <action type="equip" when="aftercast|idle" set="Idle" />
            
           
<if Spell="Ruinator">             
        <equip set="Ruinator" when ="precast" /> 
</if>
        
  </if>      
</rules>
</spellcast>                                    
                
            