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

[HTML5] Funcition/Alias Help Needed!

HeconHecon Member Posts: 8
How can one do to translate this alias in Mudlet to HTML5 (Javascript): https://etherpad.mozilla.org/DfkiQgjFoF ?

I got the alias part working though I can't understand the matching part and what comes after, please help me.

Best Answer

Answers

  • AustereAustere TennesseeMember Posts: 1,877 @@ - Legendary Achaean
    edited April 2015
    This looks like it was coded for Godzilla/Svo, so you won't have most of the variables. I don't know Javascript,  so here is a simpler version of what the alias sends in lua.  Just make sure you define the table somewhere. 


    send("queue add bal wield dirk shield")
    send("queue add bal dstab "..target.." "..venomShort[matches[2]].." "..venomShort[matches[3]])

    I wrote it out on the phone, so forgive any errors. 

  • HeconHecon Member Posts: 8
    What I meant was this part:
    dsvenom1=venomShort[matches[2]]
    dsvenom2=venomShort[matches[3]]
    doublestab()


    Script:

    venomShort={
            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"}

    function doublestab()

    How to define it in Javascript, if I get that, I'm sure I could work it out on my own.

    Still needing an answer in Javascript.
  • HeconHecon Member Posts: 8
    This is what I have got so far

    ALIAS:
    ^(xe|ol|er|ka|di|da|cu|et|pr|mo|ef|co|oc|ve|es|la|sl|vo|de|va|ac|se|ge)(xe|ol|er|ka|di|da|cu|et|pr|mo|ef|co|oc|ve|es|la|sl|vo|de|va|ac|se|ge)$
    SCRIPT:
    //Enter the script here
    venomShort={
            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"}
        print(venomShort, "red");
        
    dsvenom1=venomShort[@1]
    dsvenom2=venomShort[@2]


    However, it just sends:

    Error in alias script [DstabTest]:
    SyntaxError: Unexpected token =

    back at me, how should I proceed?

  • HeconHecon Member Posts: 8
    The point is, I want to DSTAB @TAR dsvenom1 dsvenom2
  • HeconHecon Member Posts: 8
    Also, would this work?

    client.send_direct("dstab @tar dsvenom1 dsvenom2");

    if I added it at the end of the script?
  • HeconHecon Member Posts: 8
    I changed the script and added a command instead, still does not work as intended, instead it tries DSTABBING with the short for a venom (e.g. kalmia).

    //Enter the script here
            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"
        print("DOUBLESTABBING!", "orange");

    SEND COMMAND: DSTAB @TAR @1 @2
  • KeneanungKeneanung Member Posts: 504 ✭✭✭✭ - Eminent
    Since accepting it as answer somehow got rid of the attached file, here a dropbox link for future reference: https://dl.dropboxusercontent.com/u/7146752/Reflex Package Serpenty stuff 2015-4-27.js.zip
Sign In to Comment.