Help getting multiple commands from table(html5/nexus client)

edited October 2015 in Tech Support
At least I think it's a table...

Anyway, I've been shamelessly using the script I found (forums.achaea.com/discussion/3554/html5-funcition-alias-help-needed) for my combat table purposes, just moving things around to suit my needs.  Now I've hid a roadblock and haven't found anything I can use to reverse engineer a solution.

Here's the base version I acquired
//Enter the script here
var venoms = {
    su: "sumac",
    xe: "xentio",
    ol: "oleander",
    er: "eurypteria",
    ka:"kalmia",
    di: "digitalis",
    da: "darkshade",
    cu: "curare",
    et: "epteth",
    pr: "prefarar",
    mo: "monkshood",
    ef: "euphorbia",
    co: "colocasia",
    oc: "oculus",
    ca: "camus",
    ve: "vernalius",
    es: "epseth",
    la: "larkspur",
    sl: "slike",
    vo: "voyria",
    de: "delphinium",
    no: "notechis",
    va: "vardrax",
    lo: "loki",
    ac: "aconite",
    se: "selarnia",
    ge: "gecko",
    sc: "scytherus",
    ne: "nechamandra"
};
   
var venom1 = venoms[args[1]];
var venom2 = venoms[args[2]];
if(typeof venom1 == "undefined"){
    display_notice("venom " + args[1] + " unknown.");
}else if (typeof venom2 == "undefined"){
    display_notice("venom " + args[2] + " unknown.");
}else{
    client.send_direct("dstab " + venom1 + " " + venom2);
    display_notice("dstab " + venom1 + " " + venom2);
}

What I used as a knight(no changes to aliases because lazy)

//Enter the script here
var venoms = {
    w: "head",
    a: "left arm",
    s: "torso",
    d: "right arm",
    z: "left leg",
    x: "right leg",
    ww: "head expend",
    aa: "left arm expend",
    ss: "torso expend",
    dd: "right arm expend",
    zz: "left leg expend",
    xx: "right leg expend"
};
   
var venom1 = venoms[args[1]];
var venom2 = venoms[args[2]];
if(typeof venom1 == "undefined"){
    display_notice("venom " + args[1] + " unknown.");
}else if (typeof venom2 == "undefined"){
    display_notice("venom " + args[2] + " unknown.");
}else{
    client.send_direct("doublewhirl " + venom1 + " " + venom2);
    display_notice("doublewhirl " + venom1 + " " + venom2);
}

And both worked like a charm, but I'm struggling with how to get it to work with the multiple command inputs for blademaster.  It's not all nested nicely in one command, is there a way to pull from a table like this using the aliases but making it fire multiple commands?

example:
Alias:^ii(\w+)(\w+)$

//Enter the script here
var venoms = {
    asl: "armslash left",
    asr: "armslash right",
    st: "strike sternum",
};
   
var venom1 = venoms[args[1]];
var venom2 = venoms[args[2]];
if(typeof venom1 == "undefined"){
    display_notice("venom " + args[1] + " unknown.");
}else if (typeof venom2 == "undefined"){
    display_notice("venom " + args[2] + " unknown.");
}else{
    client.send_direct("infuse ice " + "venom1 " + "venom2 ");
}

so I would want to infuse ice, armslash and strike sternum, but I have no idea where to even start to make that happen.

edit: Apparently putting in links evades me as well :(
edit2: ohhhh, the actual alias might help.

Comments

  • edited October 2015
    How I handled Blademaster:

    ^par$

    strike = "strike " ..target.. " neck"
    cecho("<Blue>\n Strike: Paralysis")

    ^ice$

    infuse = "infuse ice"
    cecho("<Blue>\n Infuse: Ice")

    ^lsl$
    send("queue add eqbal "infuse"/legslash " ..target.. " left/" ..strike)

    so you could make an alias for any strike/infuse you wanted and just quick swap with your alias list. That's how I handled it!


    In regards to what you're trying to do:

    ^a([a-z])([a-z]?)([a-z]?)$

    local slash = {
    l= "armslash " ..target.. " left"
    r = "armslash " ..target.. " right"
    n = "strike " ..target.. " neck"
    a = "strike " ..target.. " throat"
    i = "infuse ice"
    f = "infuse fire"
    v = "infuse void"
    e = "lightning"
    }

    infuse = slash[matches[2]]
    slashDir = slash[matches[3]]
    strike = slash[matched[4]]

    send("queue add eqbal " ..infuse.. " " ..slashDir.. " " ..strike)

    It's late here, so that may not be 100% accurate, but that's the gist of what you want to do.




    Penwize has cowardly forfeited the challenge to mortal combat issued by Atalkez.
  • Atalkez said:
    How I handled Blademaster:

    ^par$

    strike = "strike " ..target.. " neck"
    cecho("<Blue>\n Strike: Paralysis")

    ^ice$

    infuse = "infuse ice"
    cecho("<Blue>\n Infuse: Ice")

    ^lsl$
    send("queue add eqbal "infuse"/legslash " ..target.. " left/" ..strike)

    so you could make an alias for any strike/infuse you wanted and just quick swap with your alias list. That's how I handled it!


    In regards to what you're trying to do:

    ^a([a-z])([a-z]?)([a-z]?)$

    local slash = {
    l= "armslash " ..target.. " left"
    r = "armslash " ..target.. " right"
    n = "strike " ..target.. " neck"
    a = "strike " ..target.. " throat"
    i = "infuse ice"
    f = "infuse fire"
    v = "infuse void"
    e = "lightning"
    }

    infuse = slash[matches[2]]
    slashDir = slash[matches[3]]
    strike = slash[matched[4]]

    send("queue add eqbal " ..infuse.. " " ..slashDir.. " " ..strike)

    It's late here, so that may not be 100% accurate, but that's the gist of what you want to do.
    That helps a lot, thank you! I can work backwards from this.

    So you used variables to toggle various strikes and infuses, then linked the variables to the various slashes? That might even work better, if I'm understanding it right

    Appreciate the help
  • Do note that everything he wrote there is for mudlet. The web client uses javascript, not lua.
    retired
  • edited October 2015
    Brean said:
    Atalkez said:
    How I handled Blademaster:

    ^par$

    strike = "strike " ..target.. " neck"
    cecho("<Blue>\n Strike: Paralysis")

    ^ice$

    infuse = "infuse ice"
    cecho("<Blue>\n Infuse: Ice")

    ^lsl$
    send("queue add eqbal "infuse"/legslash " ..target.. " left/" ..strike)

    so you could make an alias for any strike/infuse you wanted and just quick swap with your alias list. That's how I handled it!


    In regards to what you're trying to do:

    ^a([a-z])([a-z]?)([a-z]?)$

    local slash = {
    l= "armslash " ..target.. " left"
    r = "armslash " ..target.. " right"
    n = "strike " ..target.. " neck"
    a = "strike " ..target.. " throat"
    i = "infuse ice"
    f = "infuse fire"
    v = "infuse void"
    e = "lightning"
    }

    infuse = slash[matches[2]]
    slashDir = slash[matches[3]]
    strike = slash[matched[4]]

    send("queue add eqbal " ..infuse.. " " ..slashDir.. " " ..strike)

    It's late here, so that may not be 100% accurate, but that's the gist of what you want to do.
    That helps a lot, thank you! I can work backwards from this.

    So you used variables to toggle various strikes and infuses, then linked the variables to the various slashes? That might even work better, if I'm understanding it right

    Appreciate the help
    Yes I personally had a variable for:
    Infuse
    Strike

    and in my aliases for the slashes, I called the variable that I had set with an earlier alias.

    So the alias input of -- ice, ast, lsr -- would define an ice infuse, kalmia/throat strike, legslash right
    as -- void, sli, asl -- would define a void infuse, gecko/underarm strike, armslash left

    Also note that if you did ice, the variable would stay ice as long as it's called and you haven't changed it. You don't need to re-define the variable repeatedly.




    Penwize has cowardly forfeited the challenge to mortal combat issued by Atalkez.
Sign In or Register to comment.