Page 1 of 1

Muli-letter Alias - each letter relevant

Posted: Sun Jun 16, 2019 2:30 am
by Bookwyrmm
Not entirely certain how to explain what I am working on, but hoping that someone can help out.

In Achaea, the Dual Wielding Blunt classes have an ability that allows them to target two different body parts with a single strike. In addition, they can use an ability called Expend to "jazz up" some of those strikes. What I am trying to accomplish to to generate an alias that will allow me to enter a four letter alias and have it target the appropriate limbs and expend (or not) based on the alias.

The ability is Doublewhirl, and the syntax for it is: Doublewhirl <target> <limb one> <expend?> <limb two> <expend>

The target can actually be empty, as the system handles targetting differently. So what I am attempting is to come up with an alias that will take four characters, entered after a standard DW, and by using those characters, fill in the limbs and the expends (or not). For example, I would like to be able to use DWHXTX to translate it to: Doublewhirl <target> Head expend Torso expend. There are dozens, maybe hundreds of possible combinations, and setting up a unique alias for each is possible (it is what I am doing at the moment) but is very inelegant, and prone to mis-steps.

The limbs, in no particular order are Head (H), Torso (T), Right leg (R), Left Leg (L), Right Arm (D) and Left Arm (G).

From my understanding (very limited) and some help I have already received, I have tried these as my aliases:

^DW(\w\w\w\w)$
^DW([HTRLDG][XO][HTRLDG][XO])$
^DW(\w(?:\w)(?:\w)(?:\w))?$

None of which, as you can imagine, are working, because character class / sets only pulls the first hit. Is there a way to have it read all four of the characters in that alias, each independant of the others? So that the four specific letters would be matches[2] - matches[5]?

Re: Muli-letter Alias - each letter relevant

Posted: Sun Jun 16, 2019 2:37 am
by demonnic
^DW(\w)(\w)(\w)(\w)

so long as you always have 4 characters after the DW the above regex should work.

Re: Muli-letter Alias - each letter relevant

Posted: Sun Jun 16, 2019 3:07 am
by Bookwyrmm
Thank you! That was precisely what was wrong, and now it works! Inelegant, but the 20 if statements mean I don't need 50 aliases!

You, good person, are amazing.

Re: Muli-letter Alias - each letter relevant

Posted: Sun Jun 16, 2019 4:26 pm
by demonnic
Happy to help!