Quick Coding Questions

11819212324

Comments

  • Just updated mudlet and my alertness is being strange.

    This is what I'm seeing.
    https://ada-young.appspot.com/pastebin/n5Yn9ufF

    this is the error.
    https://ada-young.appspot.com/pastebin/hpo7gbm5

    Not really sure where to go from here, used to work fine pre-update to 3.17.0 mudlet.
  • KlendathuKlendathu Eye of the Storm
    edited February 2019
    It's a known fault with Mudlet, something to do with getLineNumber or some other internal function.

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • Klendathu said:
    It's a known fault with Mudlet, something to do with getLineNumber or some other internal function.
    @Hirst
  • Are there gmcp messages for server side queueing? I'd love to get better handling of when the queue is full, empty, when a command has gone through, etc. 'Queue full' would be particularly helpful, I tend to spam when I'm desperately trying to escape

  • No, there isn't any GMCP support for queueing.
  • Likely a super easy answer that I just can't seem to find, but how do you get string.format() to put the % sign in the text and not interpreted as a variable? Trying to get svo.cc to announce the precent health following assess and it doesn't seem to like lonely % signs and I can't figure out how to escape the interpreter for % symbols- example below of where the percent sign would go to appear in front of the calculated health percent.

    In this example multimatches[2][2] is the name, and removing the second % sign does report properly just sans % sign in the sentence.

    local percent = math.floor((100/tonumber(multimatches[2][4])) * tonumber(multimatches[2][3]))
    
    svo.cc("%s at % %s",multimatches[2][2],percent)
    


  • ArchaeonArchaeon Ur mums house lol
    try %%
  • This might not be quick, but does anyone have Depthswalker tracking coded into AK?

    If not, I'll pay someone to do that.

  • AustereAustere Tennessee
    Cooper said:
    This might not be quick, but does anyone have Depthswalker tracking coded into AK?

    If not, I'll pay someone to do that.
    I do! 
  • Oh, nice! I definitely forgot about that update. Thank you.

  • AustereAustere Tennessee
    Cooper said:
    Oh, nice! I definitely forgot about that update. Thank you.
    Aww, here I was hoping to break into the aftermarket scene and make some sweet credits with ak add-ons. No one ever asks me for stuff except when it breaks :(.

  • I don't need anything fancy for that, just basic tracking! I was struggling with how to make loop track even semi accurately, and also how to make the progressive stuff work decently. This seems to do that out of the box!

  • edited July 2019
    Austere, you made it to good to begin with. That's your problem.
  • ArchaeonArchaeon Ur mums house lol
    honestly without Austere I would have never got into coding.  Unsure if that is a rant or a rave.
  • Cooper said:
    I don't need anything fancy for that, just basic tracking! I was struggling with how to make loop track even semi accurately, and also how to make the progressive stuff work decently. This seems to do that out of the box!

    If aeon < 100 then chrono aeon farrah end?

    :(
  • I don't need a tracker for that :)

  • Is there a way to get full gmcp access on nexus or are you limited to what is shown to you in the help pages and whatnot?
  • edited September 2019
    Something is super off with my logic and it feels I'm in a loop at making things worse. Who can help?

    Problem is that the script stops working at a stage where paralysis haemophilia and impatience are all given, then works again when the opponent loses the affliction. Grrr.

    function paralysislock()

    if affstrack.score.paralysis<99 and
                    affstrack.score.impatience<99 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia<99 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "paralysis"
    curse2 = "haemophilia"
    relapsecurse = "paralysis"
    bloodletcurse = "haemophilia"
    coagcurse = "impatience"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis<99 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia<99 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "paralysis"
    curse2 = "haemophilia"
    relapsecurse = "paralysis"
    bloodletcurse = "haemophilia"
    coagcurse = "impatience"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience<99 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia<99 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "haemophilia"
    curse2 = "impatience"
    relapsecurse = "impatience"
    bloodletcurse = "haemophilia"
    coagcurse = "impatience"


    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia<99 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "haemophilia"
    curse2 = "haemophilia"
    relapsecurse = "impatience"
    bloodletcurse = "haemophilia"
    coagcurse = "impatience"


    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis<99 and
                    affstrack.score.impatience<99 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "paralysis"
    curse2 = "impatience"
    relapsecurse = "impatience"
    bloodletcurse = "haemophilia"
    coagcurse = "impatience"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience<99 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "impatience"
    curse2 = "asthma"
    coagcurse = "asthma"
    relapsecurse = "asthma"
    bloodletcurse = "haemophilia"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma<99 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "asthma"
    curse2 = "weariness"
    coagcurse = "weariness"
    relapsecurse = "weariness"
    bloodletcurse = "haemophilia"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness<99 and
                    affstrack.score.asthma>40 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "weariness"
    curse2 = "anorexia"
    coagcurse = "anorexia"
    relapsecurse = "anorexia"
    bloodletcurse = "haemophilia"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness>40 and
                    affstrack.score.asthma>40 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia<99 and
                    affstrack.score.slickness<99 then
    curse1 = "anorexia"
    curse2 = "lethargy"
    coagcurse = "slickness"
    relapsecurse = "lethargy"
    bloodletcurse = "haemophilia"

    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness>40 and
                    affstrack.score.asthma>40 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia>40 and
                    affstrack.score.slickness<99 then
    curse1 = "lethargy"
    curse2 = "clumsiness"
    coagcurse = "slickness"
    relapsecurse = "lethargy"
    bloodletcurse = "haemophilia"


    kickassparalysiscoagulate()

    elseif affstrack.score.paralysis>40 and
                    affstrack.score.impatience>40 and
                    affstrack.score.weariness>40 and
                    affstrack.score.asthma>40 and
                    affstrack.score.haemophilia>40 and
                    affstrack.score.anorexia>40 and
                    affstrack.score.slickness<99 then
    curse1 = "lethargy"
    coagcurse = "slickness"

    kickassparalysislockdown()

    end
    end



    ----------------------

    Would also love to learn how to make tables for this kind of stuff, but can't seem to grasp it!
  • Gilliam said:
    Is there a way to get full gmcp access on nexus or are you limited to what is shown to you in the help pages and whatnot?

    No idea. Are you looking for anything in particular?
  • Anyone here know if there's a publically available self limb counter (something that counts your limbs and estimates when they'll break)? All I have is an old copy of SLC and that was pre-Weaponmastery days.
    image
  • ArchaeonArchaeon Ur mums house lol
    No there isn't
  • Regex help with Nexus: 
    ^She|He suffers from (/d) (/w) fractures\.$
    The line:
    She suffers from 10 leg fractures.
    It gives me undefined and undefined for the two values.  Why is that??
    Deucalion says, "Torinn is quite nice."
  • SophiSophi Rally Point
    (?:Sh|H)e, (\d+), (\w+)
  • edited September 2019
    The non capturing sh/he part is required?  Also why w+ when I only want the one word there?  (Also thank you @Sophi )
    Deucalion says, "Torinn is quite nice."
  • edited September 2019
    Torinn said:
    The non capturing sh/he part is required?  Also why w+ when I only want the one word there?  (Also thank you @Sophi )
    No, the non capturing part isn't required. (She|he) or (Sh|H)e would work just fine.

    In the (\w+) and (\d+) expressions, the + sign signifies the presence of one or more of that type of symbol/character. Having (\w) or (\d) would only capture a single instance of the sought for characters. So they only recognize a single letter or a single digit number respectively.

    i.e. Given the line and trigger:
    She suffers from 10 leg fractures.
    ^(She|He) suffers from (\d+) (\w) fractures\.$

    The trigger wouldn't recognize the line because the only thing (\w) captures is the 'l' of leg. The trigger would go "Here's a lowercase L. Is it followed by a space and the word fractures? No. This is not the line I'm looking for." and move on.

    You want (\w+) because that tells the trigger to look for one or more alphanumeric symbols instead of simply one such symbol. If (\w+) were in the above trigger, the trigger would go, "Here's a lowercase L. Are there any more alphanumeric symbols? Yes, there are. We'll put those all in a single argument. Is this collection of alphanumeric symbols followed by a space and the word fractures? Yes, it is. This is the line we're looking for!"

    And you'd have a happily working regex trigger.

    TL;DR: (\w) and (\d) only capture 1 letter/number respectively. (\w+) and (\d+) capture collections of letters (words) and multi digit numbers.
  • SophiSophi Rally Point
    Thanks for a great explanation!

    Since I'm late I just wanted to add the reason why I used (?:Sh|H)e. While (She|He) works just fine, regex should be as literal as possible (excludes the most variations) in order to optimize for speed and performance. This seems like a small thing but most people have hundreds to thousands of lines of code and it can make a difference. And capturing a match would be more resource intensive than not capturing it, of course. 

    Basically just a best practice kinda thing, like escaping your end periods. Same idea. 
  • (\w+) covers for the eventuality of Achaea following Imperian/Starmourn with gender-neutral terms (Their/They etc).

    Performance is all well and good, but Achaea/Mudlet in general is not going to get to the point of it being noticeable unless you're running on it on a literal toaster.
  • ArchaeonArchaeon Ur mums house lol
    Pyori said:
    (\w+) covers for the eventuality of Achaea following Imperian/Starmourn with gender-neutral terms (Their/They etc).

    Performance is all well and good, but Achaea/Mudlet in general is not going to get to the point of it being noticeable unless you're running on it on a literal toaster.
    But Pyori, I play achaea on a literal toaster!
  • Archaeon said:
    Pyori said:
    (\w+) covers for the eventuality of Achaea following Imperian/Starmourn with gender-neutral terms (Their/They etc).

    Performance is all well and good, but Achaea/Mudlet in general is not going to get to the point of it being noticeable unless you're running on it on a literal toaster.
    But Pyori, I play achaea on a literal toaster!
    You are a toaster.
  • Archaeon said:
    Pyori said:
    (\w+) covers for the eventuality of Achaea following Imperian/Starmourn with gender-neutral terms (Their/They etc).

    Performance is all well and good, but Achaea/Mudlet in general is not going to get to the point of it being noticeable unless you're running on it on a literal toaster.
    But Pyori, I play achaea on a literal toaster!
    I grew up in East Anglia. I'm surprised you have enough electricity to even run one of those....

    (Party): Mezghar says, "Stop."
Sign In or Register to comment.