
Originally Posted by
Skylark
Well after deciding to scrap the previous xml, I wrote one completely from scratch. This is my first attempt at writing one from bottom to top and was wondering if I could just get people's 2cents. It seems to have no errors when I check it, but I won't know until I go out and test it. If anyone see anything that's missing/needs to be fixed please let me know.
http://pastebin.com/NSW6u4Be
This:
Has several problems:
1) There is no 'prefix' rule; it's 'CommandPrefix'
2) CommandPrefix gets expanded to the full value for comparison, so "/ma" doesn't work; it needs to be "/magic"
3) It's almost always better to group by proper categories, such as type="WhiteMagic" (if you need separation for behavior between, say, white and black enfeebles), or just use the Skill="EnfeeblingMagic" type groupings, rather than using CommandPrefix. The instances where CommandPrefix is better do not apply to what you've written.
4) You've included additional specific spell checks after the prefix="/ma" rule (in particular, Bio and Bio 2) as <elseif>'s; these rules will never work since they would already have been trapped by the prefix check (well, they wouldn't work if the prefix check was done properly).
You have a lot of general problems with the if/elseif/else concept, it seems. Example:
Code:
<if skill="EnfeeblingMagic">
<if Spell="Slow*|Paralyze*|Silence|Dia*">
<equip when="precast|midcast" set="EnfeeblingMND">
<main>$%SpellElementStaff</main>
<sub>Reign Grip</sub>
</equip>
</if>
<if Spell="Bind|Gravity|Sleep*|Break*|Blind*|Dispel|Poison*">
<equip when="precast|midcast" set="EnfeeblingINT">
<main>$%SpellElementStaff</main>
<sub>Arbuda Grip</sub>
</equip>
</if>
<else>
<equip when="precast" set="MACC" />
</else>
</if>
You use two <if>s, where you should use <if><elseif>. The way it's currently written, if you cast Slow it will pass the first if check and equip EnfeeblingMND plus the staff/grip. It will then check the second if check and fail (it's not any of the specified spells), and finally pass the <else> check because it failed the <if Spell="Bind|etc."> check. That means the MACC set will override the EnfeeblingMND set you equipped earlier.
Every time it reaches an <if>, it will perform a test to see if it passes, even if it passed an earlier <if>. If you want to do an additional <if> check, but -not- let it pass if it passed an earlier check (or fail and use the <else> that goes with it), you need to use <elseif>.
Code:
<elseif spell="Warp*|Tele*|Haste|Escape|Refresh*|Regen*">
<equip when="precast" set="FastCast">
<main>Celeritas Pole</main>
<sub>Arbuda Grip</sub>
</equip>
<if spell="Regen*">
<equip when="precast">
<head>Savant's Bonnet +2</head>
</equip>
</if>
</elseif>
Warp/Tele spells will never get here; you used a rule at the start of the section to <return /> on those spells (to prevent crashing due to gear swaps when zoning).
Code:
<set name="Nuke">
<main>$%SpellElementStaff</main>
<sub>Wise Grip</sub>
<ammo>Witchstone</ammo>
<head>Nefer Khat +1</head>
<neck>Stoicheion Medal</neck>
<lear>Novio Earring</lear>
<rear>Hecate's Earring</rear>
<body>Anhur Robe</body>
<hands>Nares Cuffs</hands>
<lring>Strendu Ring</lring>
<rring>Diamond Ring</rring>
<back>Searing Cape</back>
<waist>Oneiros Sash</waist>
<legs>Rubeus Spats</legs>
<feet>Goliard Clogs</feet>
</set>
....
<if spell="Blizz*|Thund*|Water*|Stone*|Aero*|Fire*">
<equip when="precast|midcast" set="Nuke">
<main>$%SpellElementStaff</main>
<sub>Wise Strap</sub>
</equip>
You assign the staff for nukes twice, once in the set you use and once in the rules section. For consistency with how all your other spell types are set up, I'd suggest getting rid of the set entry and just use the rule.
For this:
Code:
<action type="command" when="aftercast">spellcast var inc bioid;wait 75;input /echo [$bioid:%spell] <%target> Wearing off in 45s On A MuGGGGGGGGGGGGGGGGGGGGGGG</action>
Two issues:
1) You never define the variable 'bioid'. As such, its behavior will be a bit wonky. Make sure to define any variable you use in the <vars> section.
1a) You do define 'BioTimers', but never use that variable.
1b) Same thing with 'sleepid' and 'SleepTimers' (plus 'SleepTimers' is defined twice in the <vars> section).
1c) Same thing with 'breakid' and 'BreakTimers'.
2) You can convert <action type="command"> to just <command>.
That covers the issues I found on a superficial review of the code.