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

Quick Coding Questions

11617181921

Comments

  • KatalystKatalyst ✭✭✭ - Distinguished Member Posts: 20 ✭✭✭ - Distinguished
    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 StormMember Posts: 3,178 @@ - Legendary Achaean
    edited February 4
    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."
  • AustereAustere TennesseeMember Posts: 2,282 @@ - Legendary Achaean
    Klendathu said:
    It's a known fault with Mudlet, something to do with getLineNumber or some other internal function.
    @Hirst
  • ShubShub ✭✭✭ - Distinguished Member Posts: 200 ✭✭✭ - Distinguished
    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

  • AntoniusAntonius Member Posts: 4,925 @@ - Legendary Achaean
    No, there isn't any GMCP support for queueing.
  • DynosDynos ✭✭ - Stalwart Member Posts: 25 ✭✭ - Stalwart
    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 ✭✭✭ - Distinguished Ur mums house lolMember Posts: 408 ✭✭✭ - Distinguished
    try %%
  • CooperCooper Member Posts: 5,295 @@ - Legendary Achaean
    This might not be quick, but does anyone have Depthswalker tracking coded into AK?

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

  • AustereAustere TennesseeMember Posts: 2,282 @@ - Legendary Achaean
    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! 
  • CooperCooper Member Posts: 5,295 @@ - Legendary Achaean
    Oh, nice! I definitely forgot about that update. Thank you.

  • AustereAustere TennesseeMember Posts: 2,282 @@ - Legendary Achaean
    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 :(.

  • CooperCooper Member Posts: 5,295 @@ - Legendary Achaean
    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!

  • TahquilTahquil Member Posts: 4,374 @@ - Legendary Achaean
    edited July 1
    Austere, you made it to good to begin with. That's your problem.
    Austere
  • ArchaeonArchaeon ✭✭✭ - Distinguished Ur mums house lolMember Posts: 408 ✭✭✭ - Distinguished
    honestly without Austere I would have never got into coding.  Unsure if that is a rant or a rave.
    AustereDochitha
  • FarrahFarrah Member, Secret Squirrel Posts: 2,506 @@ - Legendary Achaean
    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?

    :(
    Cooper
  • CooperCooper Member Posts: 5,295 @@ - Legendary Achaean
    I don't need a tracker for that :)

    Caelan
  • GilliamGilliam ✭✭✭ - Distinguished Member Posts: 77 ✭✭✭ - Distinguished
    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?
  • DominiusDominius ✭✭✭ - Distinguished Member Posts: 130 ✭✭✭ - Distinguished
    edited September 12
    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!
  • ChubbsChubbs ✭✭✭ - Distinguished Member Posts: 78 ✭✭✭ - Distinguished
    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?
  • JakiroJakiro ✭✭✭ - Distinguished Member Posts: 117 ✭✭✭ - Distinguished
    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 ✭✭✭ - Distinguished Ur mums house lolMember Posts: 408 ✭✭✭ - Distinguished
    No there isn't
  • TorinnTorinn Member Posts: 1,281 @ - Epic Achaean
    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 ✭✭✭ - Distinguished Rally PointMember Posts: 111 ✭✭✭ - Distinguished
    (?:Sh|H)e, (\d+), (\w+)
  • TorinnTorinn Member Posts: 1,281 @ - Epic Achaean
    edited September 15
    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."
  • ChubbsChubbs ✭✭✭ - Distinguished Member Posts: 78 ✭✭✭ - Distinguished
    edited September 15
    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.
    SobriquetSophiPuxiTorinn
  • SophiSophi ✭✭✭ - Distinguished Rally PointMember Posts: 111 ✭✭✭ - Distinguished
    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. 
    TorinnChubbs
  • PyoriPyori Member Posts: 1,855 @@ - Legendary Achaean
    (\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 ✭✭✭ - Distinguished Ur mums house lolMember Posts: 408 ✭✭✭ - Distinguished
    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!
  • PyoriPyori Member Posts: 1,855 @@ - Legendary Achaean
    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.

  • SobriquetSobriquet Member Posts: 2,417 @@ - Legendary Achaean
    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....
    image
Sign In to Comment.