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

Quick Coding Questions

11415161719

Comments

  • KeneanungKeneanung Posts: 596Member ✭✭✭✭ - Eminent
    This has been there pretty much since the beginning. But since it didn't break anything and I didn't quickly see what was the cause, it got buried in my todo list.
  • ShubShub Posts: 56Member ✭✭ - Stalwart
    edited December 2017
    I'm tempted to just store the info tables in a variable somewhere and switch it to a manual 'info refresh' command instead of handling every single gmcp.char.skill.list/info event.

    I figure it ought not to need a refresh on every login, just on things like level up, class switch, and when the gods adjust the rage abilities. I bet those gmcp messages are coming back with empty tables during the login, or something else outside of the basher is making gmcp send info that the basher is not liking. I guess the first thing to try is the basher on a naked profile.
  • KeneanungKeneanung Posts: 596Member ✭✭✭✭ - Eminent
    It should run through getting the skill info only when class changed or on login. Of course there might be a bug there of course. It doesn't store any information between sessions that it doesn't need to.
  • KlendathuKlendathu Eye of the StormPosts: 3,065Member @@ - Legendary Achaean
    How do others handle this? Whenever I take deafness off serverside defence keepup (aria), it spams curing and re-doing blindness, never getting to cure deafness until I curing off and then manually apply to ears.

    From the options available, serverside should default to "apply epidermal to ears" to cure deafness: Where do you want to apply the salve? You may spread it on your head, your ears, your arms, your legs, or your body.

    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."
  • AntoniusAntonius Posts: 4,626Member @@ - Legendary Achaean
    Sounds like you're not just taking deafness off defence upkeep, but also setting it as an affliction to be cured. It's possible serverside curing isn't doing the right thing to cure deafness, in which case bug it.

    I just take deafness off keepup and then apply epidermal to ears along with aria (if I have deafness) as part of the script.
  • KlendathuKlendathu Eye of the StormPosts: 3,065Member @@ - Legendary Achaean
    Antonius said:
    Sounds like you're not just taking deafness off defence upkeep, but also setting it as an affliction to be cured. It's possible serverside curing isn't doing the right thing to cure deafness, in which case bug it.

    I just take deafness off keepup and then apply epidermal to ears along with aria (if I have deafness) as part of the script.
    I did bug it. It never actually cures deafness, because it's curing blindness / reafflicting blindness with every salve balance. I'll make some local tweaks to manually apply epidermal instead of relying on serverside for now.

    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."
  • CaledCaled Posts: 77Member ✭✭ - Stalwart
    Does class balance show in gmcp somewhere?
    I've been trying to find fury balance in gmcp.Char.Vitals but not seeing it.
  • KriexKriex Posts: 150Member ✭✭✭ - Distinguished
    Iirc it does not show
  • KlendathuKlendathu Eye of the StormPosts: 3,065Member @@ - Legendary Achaean
    Caled said:
    Does class balance show in gmcp somewhere?
    I've been trying to find fury balance in gmcp.Char.Vitals but not seeing it.

    For bards it's part of gmcp.Char.Vitals.charstats:
    "Bleed: 5",
    "Rage: 11",
    "Stance: None",
    "Voice: Yes"
    You can't read it out as gmcp.Char.Vitals.charstats.Voice though, you'll need to do some gsubbing

    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."
  • BrenexBrenex Posts: 105Member ✭✭✭ - Distinguished
    Keneanung said:
    This has been there pretty much since the beginning. But since it didn't break anything and I didn't quickly see what was the cause, it got buried in my todo list.
    it's because after each skill you always call requestNextSkillDetails which always tries to remove something every time even if it has just removed the last entry. That causes a blank to populate in that string format. Just place a check in that function, maybe next(...) or whatever

  • KeneanungKeneanung Posts: 596Member ✭✭✭✭ - Eminent
    Brenex said:
    Keneanung said:
    This has been there pretty much since the beginning. But since it didn't break anything and I didn't quickly see what was the cause, it got buried in my todo list.
    it's because after each skill you always call requestNextSkillDetails which always tries to remove something every time even if it has just removed the last entry. That causes a blank to populate in that string format. Just place a check in that function, maybe next(...) or whatever
    This is... I can't believe I didn't see it myself... I created a PR with the very simple change, I just need to test it some time later.
  • GilliamGilliam Posts: 42Member ✭✭✭ - Distinguished
    Anyone know if there is a function or anything in mudlet that I can call to open the scripting menu? I'd like to make a button in my UI that pulls it up.
  • DragonknightDragonknight Posts: 252Member ✭✭✭✭ - Eminent
    Gilliam said:
    Anyone know if there is a function or anything in mudlet that I can call to open the scripting menu? I'd like to make a button in my UI that pulls it up.
    You mean like the script button at the top. No I don't know of a function, I imagine asking on the mudlet discord would get a better answer tho.
  • RekhyrRekhyr Posts: 56Member ✭✭✭ - Distinguished
    edited April 2
    Edit: nevermind
  • DominiusDominius Posts: 116Member ✭✭✭ - Distinguished
    Does anyone have a tip for how to reduce the prompt showing up twice every once in a while? Running on Mudlet and I use a lot of movecursor deleteline() gags.
  • KriexKriex Posts: 150Member ✭✭✭ - Distinguished
    Dominius said:
    Does anyone have a tip for how to reduce the prompt showing up twice every once in a while? Running on Mudlet and I use a lot of movecursor deleteline() gags.
    Use deleteFull()  will delete the line and the following prompt
  • KriexKriex Posts: 150Member ✭✭✭ - Distinguished
    Is it possible to get mudlets notepad into a miniconsole? Or is there an "always on top" option for the notepad window?
  • LeffeLeffe Posts: 38Member
    Not that I'm aware.
    But you could create your own notepad using a miniconsole. It could be part of tabbed chat as well.
  • CaelanCaelan Posts: 1,247Member @ - Epic Achaean
    How do I randomly remove an element from a table BUT if "t" is there, don't ever remove it?

    X = {y, a, m, t, b, r}

  • CaledCaled Posts: 77Member ✭✭ - Stalwart
    Caelan said:
    How do I randomly remove an element from a table BUT if "t" is there, don't ever remove it?

    X = {y, a, m, t, b, r}
    local i = 1
    local X = {'y', 'a', 'm', 't', 'b', 'r',}
     
    repeat
        i = math.random(1, #X)
        print(i, X[i])
    until X[i] ~= 't'
    
    table.remove(X, i)







  • CaelanCaelan Posts: 1,247Member @ - Epic Achaean
    Thanks. I will test later but I had a total brainfart. It wasnt quite how I was doing it but then..  it didn't work anyway so.   Thanks again

  • CaledCaled Posts: 77Member ✭✭ - Stalwart
    All good. Until you asked the question I didn't know the 'repeat-until' structure even existed. The last time I tried something like this it was a monster. 
  • CaelanCaelan Posts: 1,247Member @ - Epic Achaean
    I didn't either, was gonna try a while loop, myself.


  • ExelethrilExelethril Posts: 3,322Member @@ - Legendary Achaean
    5 creds to the first person to teach me how to swap between svof parry modes via aliases (if it's possible)

    [ SnB PvP Guide | Link ]

    [ Runewarden Sparring Videos | Link ]
  • MinifieMinifie Posts: 2,002Member @@ - Legendary Achaean
    5 creds to the first person to teach me how to swap between svof parry modes via aliases (if it's possible)
    vp nextprio <limb>
    sets the next limb in priority for the parry setup.
    vp or vshowprios <balance>
    shows the current priority lists for a particular balance. Possible balances are: herb, focus, salve, purgative, sip, balance, misc and slowcuring. The misc balance is for all things that work on their own balances and typically don’t make sense to prioritize. slowcuring is referred to slow curing - where since you can only be doing one thing at a time, all cures are placed into one priority and you can change them about as you wish.
    vp parrystrat
    lists all of the available parry strats, with clickable links to select them.
    vp parrystrat <strategy name>
    sets the parry strategy that the system should use.
    vp show
    shows system information on all about parry.


    (Mhaldor's Next Top Model): Taryius says, "Oops, thats not a foray. Thats two novices going at it in the wilderness."
    ExelethrilSobriquet
  • KriexKriex Posts: 150Member ✭✭✭ - Distinguished
    Minifie said:
    5 creds to the first person to teach me how to swap between svof parry modes via aliases (if it's possible)
    vp nextprio <limb>
    sets the next limb in priority for the parry setup.
    vp or vshowprios <balance>
    shows the current priority lists for a particular balance. Possible balances are: herb, focus, salve, purgative, sip, balance, misc and slowcuring. The misc balance is for all things that work on their own balances and typically don’t make sense to prioritize. slowcuring is referred to slow curing - where since you can only be doing one thing at a time, all cures are placed into one priority and you can change them about as you wish.
    vp parrystrat
    lists all of the available parry strats, with clickable links to select them.
    vp parrystrat <strategy name>
    sets the parry strategy that the system should use.
    vp show
    shows system information on all about parry.
    You can also use the aliases. Such as 

    Prl to parry right leg
    Pla to parry left arm
    Etc
    @Exelethril
  • RiellRiell Posts: 27Member ✭✭ - Stalwart
    Hi!  I'm trying to make a script to select different random elements from a table (like a random emote chosen from a list), and while I have figured out how to do that, I need to make it so that I can pick multiple things without picking the same thing twice.

    I sure hope that's clear enough.  Any helps?
  • AntoniusAntonius Posts: 4,626Member @@ - Legendary Achaean
    If you need to randomly select items, but don't want to duplicate them, the easiest way is to remove the items as they're selected.

    You'll eventually need to re-initialise the list to its starting state. When you do that depends on how exactly you want it to work. Either every time you call the alias, when it's completely empty, or when X number of items have been selected.
    Riell
  • RiellRiell Posts: 27Member ✭✭ - Stalwart
    Thank you, @Antonius! I'll go teach myself how to do that now.

    (um that's supposed to be like genuine; i can see how it would read as sarcasm)
  • PyoriPyori Posts: 994Member ✭✭✭✭✭ - Grand Achaean
    edited July 24
    @Riell simple!
    --This is the initialising of the tables. You want something to revert back to this.
    emoteTable = { "hi", "wavehi", "hello", "greet", "smile" }

    --Separate alias for sending the emote itself.
    --Create a random number between 1 and the number of items in the table.
    emNum = math.random(1, #emoteTable)

    --Send the emote
    send(emoteTable[emNum],false)

    --Remove it from the table.
    table.remove(emoteTable, emNum)
    The alternative method for random selection could be something like...
    --Initialise the tables here; again, have something to revert back to this state.
    emoteTable = { "hi", "wavehi", "hello", "greet", "smile" }
    usedEmotes = {}

    --Separate alias for sending the emote itself.
    emoteSend = false
    while emoteSend == false do
    emNum = math.random(1, #emoteTable)
    if not table.contains(usedEmotes, emoteTable[emNum]) then
    emoteSend = emoteTable[emNum]
    end
    end

    table.insert(usedEmotes, emoteSend)
    send(emoteSend, false)
    The way that works is that it'll continuously create a random number, until it meets a value that hasn't been used yet (isn't in the usedEmotes table). Once it does, it breaks the 'while' loop, and sends it, then adds that emote to the usedEmotes table until you reset it. The first one is probably the easiest.


    Riell
Sign In to Comment.