Code xml
<if mode="or" spell="Restraint" buffactive="Restraint">
<equip when="precast|midcast|aftercast|engaged">
<hands lock="True">Ravager's Mufflers +2</hands>
</equip>
</if>
That'll swap gear over when you have or use Restraint. Apparently anyway, while I'm not playing I've not had the chance to test it myself.
EDIT: Also, don't forget that ordering is important. Here's the full rules section for the Restraint code further up. I hope the guy whose XML it is won't mind me posting it. (Also, if you see this and you do, let me know and I'll pull it :P)
Code xml
<rules>
<!--Rules-->
<equip when="Engaged" set="TP" />
<equip when="Idle" set="IDLE" />
<if status="idle">
<equip when="aftercast|idle" set="IDLE" />
</if>
<if mode="or" buffactive="Weakness" HPPLT="20">
<equip when="all">
<head lock="yes">Twilight Helm</head>
<body lock="yes">Twilight Mail</body>
</equip>
</if>
<!--JAs-->
<if mode="or" spell="Restraint" buffactive="Restraint">
<equip when="precast|midcast|aftercast|engaged">
<hands lock="True">Ravager's Mufflers +2</hands>
</equip>
</if>
<if spell="Blood Rage">
<equip when="precast">
<body>Rvg. Lorica +2</body>
</equip>
</if>
<if spell="Tomahawk">
<equip when="precast">
<ammo>Thr. Tomahawk</ammo>
</equip>
</if>
<if spell="Spectral Jig">
<command when="PreCast">cancel 71</command>
</if>
<!--Weapon skills-->
<if spell="Ukko's Fury">
<if buffactive="Berserk|Attack Boost|Potency|Blood Rage">
<action type="equip" when="precast" set="Ukko-Bes" />
<action type="equip" when="aftercast" set="TP" />
</if>
<if buffactive="Restraint">
<action type="equip" when="precast" set="Ukko-res" />
<action type="equip" when="aftercast" set="TP-Res" />
</if>
<if notbuffactive="Berserk|Attack Boost|Potency|Blood Rage">
<action type="equip" when="precast" set="Ukko" />
<action type="equip" when="aftercast" set="TP" />
</if>
<if day="Windsday|Lightningday|Lightsday">
<equip lock="yes"><head>Mekira-oto +1</head></equip>
</if>
</if>
</rules>
Basically, it will equip all your standard TP gear, then swap out Restraint gear when appropriate.