Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

multiple alias limb targetting (HTML5)

BreanBrean Posts: 194Member ✭✭✭ - Distinguished
edited May 2015 in Tech Support
I'm not really sure what to call this, but the title is the best I've got so I'll try to describe it so it makes sense.

What I'm trying to do is work out my combat targetting for combination to work fluidly off of 2 letter aliases in a sort of stickman formation using the html5 web client.
Example: ww would be COMBINATION <target> slice head [venom] smash high
OR
aw would be COMBINATION <target> slice left arm [venom] smash high

Now, is there any way to do this outside of writing each individual combination? Or, better question, is the scripting for that so complex that it would be BETTER to just write every individual combination?


Comments

  • TaelTael Posts: 1,197Member @ - Epic Achaean
    edited May 2015
    There is arguably a better way to do this than writing every combination as its own alias, though some people do like to do it that way.

    What you want first is a regex alias. Usually, people will use a letter or two to start the alias to make sure it doesn't collide with any other commands. So you'll have a regex alias with a pattern something like ^co([wa])([ww])$ and "coww" will be what you use instead of "ww" for instance. You can add whatever letters you want to check for to the [wa] or [ww]. If you want to understand how regex like this works, following the tutorial at regular-expressions.info is easy, fast, and helpful. Set aside an afternoon sometime and it will pay dividends. Make sure to actually set the alias type to regex in the dropdown menu.

    Since [wa] and [ww] are in parentheses, they'll be saved to the args table. So you can get at them with args[1] and args[2], respectively.

    Then you can have it do the thing you want for each of the letters:
    if (args[1] == "w" && args[2] == "w") {
        send("combination " + target + " slice head voyria smash high")
    } else if (args[1] == "w" && args[2] == "a") { send("combination " + target + " slice left arm voyria smash high") }
    You can of course substitute the predefined venom here for a variable if you want to set the venom some other way, just like target is here. Same for which shield strike and slice/rend.

    If you want to get fancier, it would maybe be smarter to use a dictionary to do this than a bunch of ifs. If you look up an introductory Javascript tutorial, you can learn to do that pretty easily.
    Brean
  • BreanBrean Posts: 194Member ✭✭✭ - Distinguished
    Tael said:
    There is arguably a better way to do this than writing every combination as its own alias, though some people do like to do it that way.

    What you want first is a regex alias. Usually, people will use a letter or two to start the alias to make sure it doesn't collide with any other commands. So you'll have a regex alias with a pattern something like ^co([wa])([ww])$ and "coww" will be what you use instead of "ww" for instance. You can add whatever letters you want to check for to the [wa] or [ww]. If you want to understand how regex like this works, following the tutorial at regular-expressions.info is easy, fast, and helpful. Set aside an afternoon sometime and it will pay dividends. Make sure to actually set the alias type to regex in the dropdown menu.

    Since [wa] and [ww] are in parentheses, they'll be saved to the args table. So you can get at them with args[1] and args[2], respectively.

    Then you can have it do the thing you want for each of the letters:
    if (args[1] == "w" && args[2] == "w") {
        send("combination " + target + " slice head voyria smash high")
    } else if (args[1] == "w" && args[2] == "a") { send("combination " + target + " slice left arm voyria smash high") }
    You can of course substitute the predefined venom here for a variable if you want to set the venom some other way, just like target is here. Same for which shield strike and slice/rend.

    If you want to get fancier, it would maybe be smarter to use a dictionary to do this than a bunch of ifs. If you look up an introductory Javascript tutorial, you can learn to do that pretty easily.
    I'll check that stuff out, and we'll see how it goes, thanks!
Sign In to Comment.