I'm trying to set a variable name with multiple values I want to fit into this one variable.
A single variable that holds multiple values at one time? (EG: myVar = "one;blade;evasion") Or multiple possible values, and you want the variable to hold one (and only one) of them at a time? (EG: myVar = "PDT", myVar = "Evasion", etc)
So that I will return to the set value I've triggered as the current variable
This is confusingly written. A value can't be triggered. Or you've triggered a variable? Or...
You want the variable to hold the name of a set? And you want to equip that set? On an explicit trigger, or returning to that set as part of the aftercast?
Actually, let's back up. Forget variables entirely. Describe in detail exactly what you want to happen. A common issue is people asking for help about how to make a particular tool work, when they actually want to solve a particular problem, and the tool is just the means they were using to accomplish that.
Reading your posts, I get:
What I am trying to do is create trigger based variables.
You mean you want to have variables that you can change based on initiation a trigger action?
Here, for example, is one that I use:
Code:
<if Spell="ClassTrigger">
<!--
TH Modes:
None: Does not swap in TH gear under any circumstances.
Tag: Swaps in TH gear when using ranged attacks and Steps, and when engaging (considered a tagging action).
SATA: In addition to tagging actions, it will equip TH gear on all SATA sets (including weaponskills).
Fulltime: Will fulltime TH gear during melee.
-->
<if SpellTargetRaw="Cycle(THMode)">
<if advanced='"$THMode" = "None"'>
<var cmd="set THMode Tag" />
</if>
<elseif advanced='"$THMode" = "Tag"'>
<var cmd="set THMode SATA" />
</elseif>
<elseif advanced='"$THMode" = "SATA"'>
<var cmd="set THMode Fulltime" />
</elseif>
<else>
<var cmd="set THMode None" />
</else>
<addtochat>TH Mode: $THMode</addtochat>
</if>
</if>
Each time the user executes a macro with the command "/ma ClassTrigger Cycle(THMode)", this will change the current value of the variable "THMode", giving it one of four possible values: "None", "Tag", "SATA" and "Fulltime". It also uses <addtochat> to report back to the user what the new value is.
It determines what the new value should be based on what the current value is, which is done with a check in the 'advanced' attribute. It uses a combination of <if>, <elseif>, and <else> to be sure that every possible value that can exist in THMode is accounted for.
Your comment above was followed by:
I want be able to use //sc var set ____ ____ to change my current gear set whether engaged or idle
Note: this will not, and can never, change your current gear set. This is a direct command to Spellcast that sets a variable value, and that is -all- that it will do -- set the value of a variable. It will not equip gear. It will not update engaged sets or idle sets. None of that. Spellcast will not actually execute an evaluation of your rules until you take some actual action.
In my above example, I actually initiated an action with the "/ma ClassTrigger Cycle(THMode)" command. Spellcast has to evaluate the xml rules in order to get to the point where it can change a variable value, and will continue to execute after that point, allowing me to also equip different gear sets based on the new variable value.
have it so its set to swap back after weaponskills and out of movement speed boots when beginning to engage
This is part of normal Spellcast usage, and doesn't have anything to do with variables, per se.
I've heard you must use an action like a job ability or spell to activate the macro. If so can I just use one I don't have like spell on a DD job (i have just been using ones i have)?
As somewhat explained above, Spellcast will not execute anything within your xml <rules> section unless you attempt to perform some sort of action (whether from macro, command line, menu, key bind, whatever). This action does not have to be one that your job can normally perform, so yes, you could have your war use Invincible, and trap for Invincible in your war's xml, and change things any time you use that.
However a large number of special 'fake' actions are now included in the resources Spellcast uses, called trigger spells. These allow you to test for particular properties of these spells to make it easier to filter for these particular types of actions. For example, all trigger spells are type="Trigger", so you can isolate them the same way you would for type="Weaponskill" or type="JobAbility". They are grouped into 'skill' types (eg: skill="ControlTrigger", skill="ElementalTrigger"). There are also several that have specific elements tied to them (eg: spell="WaterTrigger" will also match element="Water"). This allows for a fair bit of flexibility for special use cases.
Now, on to your actual code. Here we have more confusing elements.
Code:
<var name="Trigger0">Firaga IV</var>
<if spell="trigger0">
You're testing for spell="trigger0". The question is, are you testing this using the actual macro command "/ma trigger0", or are you trying to trigger this using "/ma Firaga IV"? "Firaga IV" is a value contained within a variable. Your spell="trigger0" is checking an explicit value, not a variable. If you're trying to test the use of Firaga IV as a trigger, you'd need to use:
Code:
<var name="Trigger0">Firaga IV</var>
<if spell="$Trigger0">
Note the $ before Trigger0 when referenced in the <if> check. That means you want the -value- of the variable, not the name of the variable.
On the other hand, you might have just accidentally left the Trigger0 variable in from earlier testing, and actually were using the spell, 'trigger0'. I can't tell at this point.
Then you have your B.Group variable.
Code:
<var name="B.Group">420.TP|420.ACC|-DT</var>
First, realize that everything between the two <var> </var> tags is part of the variable value. If you were to equip the referenced sets, like:
Code:
<equip set="$B.Group" />
then it will attempt to equip the set named "420.TP", followed by adding/replacing the gear specified in set "420.ACC", followed by adding/replacing the gear specified in set "-DT". Is this intended? Because your comparisons later only use 420.TP or 420.ACC, not both.
They also explicitly reference Blankset, which is nonsensical in this configuration. In fact, I would say that a lot of what you've written just makes my head hurt.
I am going to pretend I know exactly what you're trying to do, and show you how to go about doing that.
1) You want to equip particular sets when engaged, and return to those sets after a weaponskill action.
2) You may want to have -DT gear equipped in priority over your normal gear.
3) When you weaponskill, you want to equip the appropriate weaponskill gear.
4) When you're no longer engaged you want to equip +movement gear.
Code:
<variables clear="true">
<var name="DT">None</var>
<var name="TP">TP</var>
</variables>
<sets>
<group name="Common" default="true">
<set name="None">
<!-- empty set -->
</set>
<set name="Idle">
<feet>Danzo Sune-ate</feet>
</set>
<set name="420.TP">
<!-- stuff -->
</set>
<set name="420.ACC">
<!-- stuff -->
</set>
<set name="DT">
<!-- stuff -->
</set>
<set name="Shoha">
<!-- stuff -->
</set>
</group>
</sets>
<rules>
<if type="Weaponskill">
<if Spell="Tachi: Shoha">
<equip when="precast" set="Shoha" />
</if>
</if>
<elseif type="Trigger">
<cancelspell />
<if spell="ClassTrigger">
<if SpellTargetRaw="+DT">
<var cmd="set DT DT" />
<addtochat>DT set on</addtochat>
</if>
<elseif SpellTargetRaw="-DT">
<var cmd="set DT None" />
<addtochat>DT set off</addtochat>
</elseif>
<elseif SpellTargetRaw="+Acc">
<var cmd="set TP Acc" />
<addtochat>TP set for accuracy</addtochat>
</elseif>
<elseif SpellTargetRaw="-Acc">
<var cmd="set TP TP" />
<addtochat>TP set for normal</addtochat>
</elseif>
</if>
<elseif spell="Reset">
<var cmd="set DT None" />
<var cmd="set TP TP" />
<addtochat>DT and TP sets reset</addtochat>
</elseif>
<if status="engaged">
<equip when="precast" set="420.$TP|$DT" />
</if>
<else>
<equip when="precast" set="Idle" />
</else>
<return />
</elseif>
<if status="engaged">
<equip when="engaged|aftercast" set="420.$TP|$DT" />
</if>
<else>
<equip when="idle|aftercast" set="Idle" />
</else>
</rules>
Note that if you use trigger spells, you need to use <cancelspell> to ensure that Spellcast doesn't try to actually send them as commands to the game. Also, because you're cancelling them, any <equip> commands have to happen at the precast level instead of the normal aftercast, which is why those <equip> commands are duplicated. I also put in a <return /> since at that point in the code we don't need it to go any further.
In this case, I've used variables to define which sets are being used, but I don't use a variable to define the entire equip set structure. I can define that explicitly in the <rules>, and just let the variables fill in the missing bits.
For this to work, you'd want up to 5 macros to control things:
/ma ClassTrigger +DT
/ma ClassTrigger -DT
/ma ClassTrigger +Acc
/ma ClassTrigger -Acc
/ma ClassTrigger Reset
This can be simplified and consolidated to save on macro space, but I wanted to make it as clear and explicit as possible, rather than try to use fancy tricks.
Hopefully this helps clear things up a little.