Macro Creation

From Gralamin's Wiki

Jump to: navigation, search

Dox's Combat Stage Macro

Creation: Stage One

/self
[h:Stats="AtkStage, Stage2, Stage3, Stage4"]
<!-- Input goes here -->

[Base = 1]

[if(stageNumber >= 0), CODE:
{
[Mod = stageNumber/4]
};
{
[Mod = stageNumber/8]
}]

[SWITCH(Stats):
case "AtkStage": AtkStage = Base + Mod;
case "Stage2": Stage2 = Base + Mod;
case "Stage3": Stage3 = Base + Mod;
case "Stage4": Stage4 = Base + Mod]

[abort(0)]

Notes:

  • Abort(0) makes it display nothing if it successfully executes.
  • Stats contains a list of all stats it can effect.
  • Switch Statement should have form: "CharacterStat = Base + Mod", where CharacterStat is a property of your pog.

Creation: Stage Two

/self
[h:Stats="AtkStage, Stage2, Stage3, Stage4"]
[h:PossibleStageNumbers="-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6"]
[h:myInput=input("StatValue|" + Stats + "|Choose Stat|LIST|SELECT=0 VALUE=STRING",
"stageNumber|" + PossibleStageNumbers + "|Choose Number|LIST|SELECT=0")]
[h:abort(myInput)]
[h:stageNumber = stageNumber - 6]
[Base = 1]

[if(stageNumber >= 0), CODE:
{
[Mod = stageNumber/4]
};
{
[Mod = stageNumber/8]
}]

[SWITCH(StatValue):
case "AtkStage": AtkStage = Base + Mod;
case "Stage2": Stage2 = Base + Mod;
case "Stage3": Stage3 = Base + Mod;
case "Stage4": Stage4 = Base + Mod]

[abort(0)]

Notes:

  • Each argument of input follows the pattern:
    • Variable to put it in
    • Default Values (or if you set it to a list or similar thing, the possible values)
    • The Tooltip
    • Optional: Field Type
    • Optional: Field Type Options
  • In this case, we make Lists, we set the default value to the first entry, and we make it pass the choice as a string (such as "AtkStage"),
  • Stage number gets passed the index instead. So if we choose -6, it gets passed 0. Since we have a well ordered array, we can deduce that if first subtract 6 from the received value, we will have the picked value. This can instead be done as a simple text input field:
[h:myInput=input("StatValue|" + Stats + "|Choose Stat|LIST|SELECT=0 VALUE=STRING",
"stageNumber|0|Choose Number")]

In which case we have to do a bit more checking of input (Check if integer, make sure its between -6 and 6, etc.)

Personal tools