Ok, I decided to mess around with this a bit and see if I could get it to work...there were some errors that needed to be corrected, but this code does work (I tested it and got it working):
<script type="text/worker">
//Set Active Defense, Movement, and Description according to the Maneuver value
on("sheet:opened change:maneuver", function() {
getAttrs(["maneuver", "activedefense", "movement", "description"], function(value) {
if (value.maneuver === "0") {
console.log("Setting Active Defense, Movement, and Description to blank");
setAttrs({activedefense: " ",
movement: " ",
description: " "});
}
else if (value.maneuver === "1") {
console.log("Updating Active Defense, Movement, and Description for Aim");
setAttrs({activedefense: "Any*",
movement: "Step|None",
description: "Aim a ranged weapon to get its Acc bonus (+1 for tracking, +1 for 2 turn, +2 for 3+ turns, the combined bonus for all targeting systems cannot exceed the weapons base Accuracy)|You get no step if your tw-handed weapon is braced"});
}
else if (value.maneuver === "2") {
console.log("Updating Active Defense, Movement, and Description for AOA-Melee: Determined");
setAttrs({activedefense: "None",
movement: "1/2 forward",
description: "+4 to hit"});
}
else if (value.maneuver === "3") {
console.log("Updating Active Defense, Movement, and Description for AOA-Melee: Double");
setAttrs({activedefense: "None",
movement: "1/2 forward",
description: "2 attacks on same foe with ready weapon (-4 to off-hand without Ambidexterity"});
}
else if (value.maneuver === "4") {
console.log("Updating Active Defense, Movement, and Description for AOA-Melee: Feint");
setAttrs({activedefense: "None",
movement: "1/2 forward",
description: "Make one feint and one attack on the same foe"});
}
else if (value.maneuver === "5") {
console.log("Updating Active Defense, Movement, and Description for AOA-Melee: Long");
setAttrs({activedefense: "None",
movement: "1/2 forward",
description: "Increase reach by 1 yard (Swing attacks at -2 dmg or -1 per die), may end in crouch (MA87)"});
}
else if (value.maneuver === "6") {
console.log("Updating Active Defense, Movement, and Description for AOA-Melee: Strong");
setAttrs({activedefense: "None",
movement: "1/2 forward",
description: "+2 to damage (or +1 per damage die)"});
}
else {
console.log("Didn't update anything...");
}
console.log("Finished with doing stuff!");
});
});
//End Maneuver
</script>
<div class='sheet-main'>
<select name='attr_maneuver'>
<option value='0'>N/A</option>
<option value='1'>Aim</option>
<option value='2'>All-Out-Attack - Melee (Determined)</option>
<option value='3'>All-Out-Attack - Melee (Double)</option>
<option value='4'>All-Out-Attack - Melee (Feint)</option>
<option value='5'>All-Out-Attack - Melee (Long)</option>
<option value='6'>All-Out-Attack - Melee (Strong)</option>
</select>
<textarea name='attr_activedefense' readonly></textarea>
<textarea name='attr_movement' readonly></textarea>
<textarea name='attr_description' readonly></textarea>
</div>
You'll notice that I set the text areas to readonly so that players couldn't modify those, but the sheet worker still can. The type of input doesn't have to be text area, you just need to make sure you are using the correct naming conventions, but I do think that for the description you will at least want a text area so it's easier to read...
Anyway, I hope this helps.