Quick Coding Questions

1161719212224

Comments

  • 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.
  • 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.

  • 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 Storm
    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."
  • 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 Storm
    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."
  • Does class balance show in gmcp somewhere?
    I've been trying to find fury balance in gmcp.Char.Vitals but not seeing it.
  • Iirc it does not show
  • KlendathuKlendathu Eye of the Storm
    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",<br>"Rage: 11",<br>"Stance: None",<br><b>"Voice: Yes"</b>
    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."
  • 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

  • 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.
  • 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.
  • 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.
  • edited April 2018
    Edit: nevermind
  • 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.
  • 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
  • Is it possible to get mudlets notepad into a miniconsole? Or is there an "always on top" option for the notepad window?
  • Not that I'm aware.
    But you could create your own notepad using a miniconsole. It could be part of tabbed chat as well.
  • 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}

  • 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)







  • 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

  • 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. 
  • I didn't either, was gonna try a while loop, myself.


  • 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 ]
  • 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.
  • 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
  • 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?
  • 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.
  • 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)
  • edited July 2018
    @Riell simple!
    --This is the initialising of the tables. You want something to revert back to this.<br>emoteTable = { "hi", "wavehi", "hello", "greet", "smile" }<br><br>--Separate alias for sending the emote itself.<br>--Create a random number between 1 and the number of items in the table.<br>emNum = math.random(1, #emoteTable)<br><br>--Send the emote<br>send(emoteTable[emNum],false)<br><br>--Remove it from the table.<br>table.remove(emoteTable, emNum)<br>
    The alternative method for random selection could be something like...
    emoteTable = { "hi", "wavehi", "hello", "greet", "smile" }<br>usedEmotes = {}<br><br>--Separate alias for sending the emote itself.<br>emoteSend = false<br>while emoteSend == false do<br>  emNum = math.random(1, #emoteTable)<br>  if not table.contains(usedEmotes, emoteTable[emNum]) then<br>    emoteSend = emoteTable[emNum]<br>  end<br>end<br><br>table.insert(usedEmotes, emoteSend)<br>send(emoteSend, false)<br>--Initialise the tables here; again, have something to revert back to this state.<br>
    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.


Sign In or Register to comment.