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

Nicer? looking QWHO.

PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
edited January 27 in Curing Systems and Scripts
eta: Use 'player report' to show it like this. You can change the alias if you want.

Originally from Kali over in Lusternia, I touched it up and made it able to work with Achaea. I don't actually use it, but I figured some people might like it.

Judging by discord, some of them liked the look of it at least.

Needs SVOF's ndb to work. Preview below, note that it uses the colours that your ndb uses, not necessarily the colours shown below. Below are just from when I was testing with my own personal ndb, to see if it worked.




Enjoy!


ShirszaeVadimusesTysandrVoliCailinZackery

Comments

  • TahquilTahquil Posts: 4,002Member @@ - Legendary Achaean
    Something may be missing to make it work with svof. 


  • PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
    edited January 27
    Fixed an issue or two, from when I forgot to convert the code back to svof API.

    @Tahquil I had it grab the colours/orgs in backwards spots, because my personal ndb handled it a little differently. Didn't change them back around when I put it back to using svo.

    Tysandr
  • PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
    Tahquil breaking things as per usual.

    Fixed rogues incorrectly/erroneously displaying, ndb works a little differently in Lusternia it seems.



    TahquilTysandr
  • TysandrTysandr Posts: 439Member ✭✭✭✭ - Eminent
    @Pyori

    Make for Mudlet!





    Nexus: Accents, Autotriggers, Dragon Talismans
    "As the child did... without the rope. Then fear will find you again."

    ShirszaeVoli
  • PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
    Tysandr said:
    @Pyori

    Make for Mudlet!

                

    KyrraTysandr
  • AntoniusAntonius Posts: 4,528Member @@ - Legendary Achaean
    Tysandr said:
    @Pyori

    Make for Mudlet!





    What are the characters inside the square brackets meant to indicate?
  • KoganKogan Posts: 401Member ✭✭✭✭ - Eminent
    Antonius said:
    Tysandr said:
    @Pyori

    Make for Mudlet!





    What are the characters inside the square brackets meant to indicate?
    Seems everyone of the same class gets the same character. I'm assuming that's just another class identifier using uni that makes it easier to distinguish class on the ones further right. Maybe even used in other instances of the name outside of qw? Seems neat either way. 
  • TysandrTysandr Posts: 439Member ✭✭✭✭ - Eminent
    edited January 28
    Classes, can peg them (and target numbers) to name triggers in team-combat mode

    Eg: (Party): Dunn says, "Enemies: Taryius ($), Aegoth (&), Crixos (+)."

    Typing on phone no don't have actual symbols to paste.

    Also they are super cute.
    Nexus: Accents, Autotriggers, Dragon Talismans
    "As the child did... without the rope. Then fear will find you again."

    Kogan
  • VadimusesVadimuses Posts: 1,081Member @ - Epic Achaean
    edited January 28
    Interesting idea, you can echo them in Mudlet too
  • VoliVoli Posts: 82Member ✭✭✭ - Distinguished
    edited January 29
    @Pyori Do you know why every time I reload mudlet, it resets and places myself, and a number of other people in various cities, into the 'rogue' column?

    My assumption is that my NDB doesn't save, because it updates after I honours them... but I don't really have much knowledge in NDBs and such.


  • KayeilKayeil Washington StatePosts: 2,805Member @@ - Legendary Achaean
    Voli said:
    @Pyori Do you know why every time I reload mudlet, it resets and places myself, and a number of other people in various cities, into the 'rogue' column?

    My assumption is that my NDB doesn't save, because it updates after I honours them... but I don't really have much knowledge in NDBs and such.
    My NDB does this ALL the time so I just turn the damn thing off and I check the errors and it does output some kind of error. Like all of Cyrene goes into rogues, ALMOST everyone goes into rogues eventually. It's so annoying. Even if I manually set their city they end up back in rogues. I have no idea how to fix this issue. Clean installs has not fixed this problem.
    What doesn't kill you gives you exp.

  • TahquilTahquil Posts: 4,002Member @@ - Legendary Achaean
    Mine puts random people into rogues, but gives them Ashtani colouring. I found this usually happens if there is people in the QW that NDB has not record of their citizenship. Even people noted as Targossas/Cyrene will appear in Rogue in this case even though they have their flags properly set.

    Fix : QW and honours those who aren't coloured yet. Sets everything right for me. (I have the auto honours thing on)
  • TysandrTysandr Posts: 439Member ✭✭✭✭ - Eminent
    Not entirely sure if this is related to the described NDB issue, but some players have strange .jsons when you use the API.

    For example, Esenna, Mercer & Austere consistenly have in their json file,

    'city' : '(hidden)'

    A little bit irritating because if you QW them, that data is available.
    Nexus: Accents, Autotriggers, Dragon Talismans
    "As the child did... without the rope. Then fear will find you again."

    Caelan
  • TysandrTysandr Posts: 439Member ✭✭✭✭ - Eminent
    edited January 30
    Not entirely sure if this is related to the described NDB issue, but some players have strange .jsons when you use the API.

    For example, Esenna, Mercer & Austere consistently have in their json file,

    'city' : '(hidden)'

    A little bit irritating because if you QW them, that data is available.


    e: hilariously, every time I open @Austere's json file, Chrome thinks its Norwegian and wants to translate it.
    Nexus: Accents, Autotriggers, Dragon Talismans
    "As the child did... without the rope. Then fear will find you again."

  • PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
    Tysandr said:
    Not entirely sure if this is related to the described NDB issue, but some players have strange .jsons when you use the API.

    For example, Esenna, Mercer & Austere consistently have in their json file,

    'city' : '(hidden)'

    A little bit irritating because if you QW them, that data is available.


    e: hilariously, every time I open @Austere's json file, Chrome thinks its Norwegian and wants to translate it.
    It's an option you can toggle on, to prevent people seeing what city/house you are outside of the game. I'm not really sure why they added the option to do that, but yeah.

    Tysandr
  • LaerinLaerin Posts: 3Member ✭✭ - Stalwart
    edited February 1
    Bug report thing.
    It's only putting people nameDb hasn't recorded yet into the Rogues column, and not actual rogues. Svo's ndb stores them as 'rogue', so the script creates a 'rogue' subtable and sorts them into it. It needs to be title case, as the 'Rogue' subtable is the one actually being displayed.
  • PyoriPyori Posts: 714Member ✭✭✭✭ - Eminent
    Laerin said:
    Bug report thing.
    It's only putting people nameDb hasn't recorded yet into the Rogues column, and not actual rogues. Svo's ndb stores them as 'rogue', so the script creates a 'rogue' subtable and sorts them into it. It needs to be title case, as the 'Rogue' subtable is the one actually being displayed.
    That was already fixed in the last one I posted.

  • TahquilTahquil Posts: 4,002Member @@ - Legendary Achaean
    I got another thing. Sorry.

    Columns bump out with longer names.

    Dragonknight
  • VoliVoli Posts: 82Member ✭✭✭ - Distinguished
    edited February 1
    time to blame Dragonknight for his long name!!

    Weird.. Phelia, Kasa, Sabetha, Shirszae, and myself are always being put back into the Rogue colum on every mudlet restart, still.

    That's just to name a couple people.


    Dragonknight
  • DragonknightDragonknight Posts: 252Member ✭✭✭✭ - Eminent
    Gotta love it when my name screws things up.
    CaelanKiet
  • TahquilTahquil Posts: 4,002Member @@ - Legendary Achaean
    Well, to be honest there is also a rogue with a 'N' name that breaks it as well.. But you can keep feeling special if you like.
  • DragonknightDragonknight Posts: 252Member ✭✭✭✭ - Eminent
    I miss when you could WTF people's posts...
    Solnir
  • BrenexBrenex Posts: 105Member ✭✭✭ - Distinguished
    edited April 28
    I present here two options for lengthy names. A truncate option and an option to use if you have a wider monitor that will support longer column lengths.

    If you want to truncate long names to "Dragonk..." use the following for the script "Player Report":

    playerreport = playerreport or {}
    function playerreport.getpeople()
      sendGMCP("Comm.Channel.Players")
      send(" ", false)
      tempLineTrigger(0, 1, [[if isPrompt() then deleteLine() end]])
      if not lfs.attributes(getMudletHomeDir() .. "/Player Report") then
        lfs.mkdir(getMudletHomeDir() .. "/Player Report")
      end
      downloadFile(getMudletHomeDir().."/Player Report/characters.json", [[http://api.achaea.com/characters.json]])
    end
    
    function playerreport.buildpeople(_, filepath)
      local greatest_length = 0
      if not filepath:find("Player Report", 1, true) then
        return
      end
      io.input(filepath)
      local rawfile = io.read("*all")
      playerreport.players = {}
      for name in string.gmatch(rawfile:gsub("\"", ""), "name:%w+") do
        table.insert(playerreport.players, name:sub(6))
      end
    
      for k, name in pairs(gmcp.Comm.Channel.Players) do
        if not table.contains(playerreport.players, name.name) then
          table.insert(playerreport.players, name.name)
        end
      end
    
      playerreport.nicify(playerreport.players)
    end
    
    registerAnonymousEventHandler("sysDownloadDone", "playerreport.buildpeople")
    
    function playerreport.nicify(tbl)
      local orgtable, maxcount, echoline, shortened_name = {}, 0, "", ""
      --Configurable stuff. The order of orglist is the order they'll be displayed in, the colors are the default 'score' colors, but you can change them to whatever.
      local orglist = {"Ashtan", "Cyrene", "Eleusis", "Hashan", "Mhaldor", "Targossas", "Rogue"}
      local bordercolor = "<NavajoWhite>"
      local wordcolor = "<DimGrey>"
    
      for k, name in pairs(tbl) do
        local org = (ndb.getcity(name) or "Rogue")
        if org == "" or org:title() == "None" or org:title() == "Rogue" then
          org = "Rogue"
        end
        orgtable[org:title()] = orgtable[org] or {}
            table.insert(orgtable[org], name)
            maxcount = math.max(#orgtable[org], maxcount)
        end
      echoline = bordercolor .. "+"
    
      for k, orgname in ipairs(orglist) do
        table.sort(orgtable[orgname] or {})
        echoline = echoline.."-"..wordcolor..orgname..bordercolor..string.rep("-", 11 - #orgname).."+"
      end
    
      for i = 1, maxcount do
        echoline = echoline .. "\n" .. bordercolor .. "| "
        for k, orgname in ipairs(orglist) do
          orgtable[orgname] = orgtable[orgname] or {}
          if i <= #orgtable[orgname] then
            local tempname = orgtable[orgname][i]
            shortened_name = tempname
            if #tempname > 11 then
              shortened_name = string.cut(tempname, #tempname - 18)
              shortened_name = string.cut(shortened_name .. "...", 11) .. " "
            end 
            echoline = echoline..ndb.getcolor(tempname)..shortened_name..string.rep(" ", 11 - #tempname)..bordercolor.."| "
              else
            echoline = echoline..string.rep(" ", 10)..bordercolor.." | "
          end
        end
      end
      echoline = echoline .. "\n" .. bordercolor .. "+"
      for k, orgname in ipairs(orglist) do
        echoline = echoline .."-" ..wordcolor .."Players:" ..#orgtable[orgname] ..bordercolor ..(#orgtable[orgname] < 10 and "-" or "") .."-+"
      end
      cecho(echoline .. "\n")
      send(" ", false)
    end

    If instead you want to account for longer names and have a wider monitor, use the following:
    playerreport = playerreport or {}
    function playerreport.getpeople()
      sendGMCP("Comm.Channel.Players")
      send(" ", false)
      tempLineTrigger(0, 1, [[if isPrompt() then deleteLine() end]])
      if not lfs.attributes(getMudletHomeDir() .. "/Player Report") then
        lfs.mkdir(getMudletHomeDir() .. "/Player Report")
      end
      downloadFile(getMudletHomeDir().."/Player Report/characters.json", [[http://api.achaea.com/characters.json]])
    end
    
    function playerreport.buildpeople(_, filepath)
      local greatest_length = 0
      if not filepath:find("Player Report", 1, true) then
        return
      end
      io.input(filepath)
      local rawfile = io.read("*all")
      playerreport.players = {}
      for name in string.gmatch(rawfile:gsub("\"", ""), "name:%w+") do
        table.insert(playerreport.players, name:sub(6))
        if #name:sub(6) > greatest_length then greatest_length = #name:sub(6) end
      end
    
      for k, name in pairs(gmcp.Comm.Channel.Players) do
        if not table.contains(playerreport.players, name.name) then
          table.insert(playerreport.players, name.name)
          if #name.name > greatest_length then greatest_length = #name end
        end
      end
    
      if greatest_length < 9 then greatest_length = 9 end
      playerreport.nicify(playerreport.players, greatest_length)
    end
    
    registerAnonymousEventHandler("sysDownloadDone", "playerreport.buildpeople")
    
    function playerreport.nicify(tbl, length_max)
      local orgtable, maxcount, echoline = {}, 0, ""
      --Configurable stuff. The order of orglist is the order they'll be displayed in, the colors are the default 'score' colors, but you can change them to whatever.
      local orglist = {"Ashtan", "Cyrene", "Eleusis", "Hashan", "Mhaldor", "Targossas", "Rogue"}
      local bordercolor = "<NavajoWhite>"
      local wordcolor = "<DimGrey>"
    
      for k, name in pairs(tbl) do
        local org = (ndb.getcity(name) or "Rogue")
        if org == "" or org:title() == "None" or org:title() == "Rogue" then
          org = "Rogue"
        end
    
        orgtable[org:title()] = orgtable[org] or {}
            table.insert(orgtable[org], name)
            maxcount = math.max(#orgtable[org], maxcount)
        end
    
    -- Header Begin
      echoline = bordercolor .. "+"
    
      for k, orgname in ipairs(orglist) do
        table.sort(orgtable[orgname] or {})
        echoline = echoline.."-"..wordcolor..orgname..bordercolor..string.rep("-", (length_max+1) - #orgname).."+"
      end
    
    -- Body Begin
      for i = 1, maxcount do
        echoline = echoline .. "\n" .. bordercolor .. "| "
        for k, orgname in ipairs(orglist) do
          orgtable[orgname] = orgtable[orgname] or {}
          if i <= #orgtable[orgname] then
            local tempname = orgtable[orgname][i]
            echoline = echoline..ndb.getcolor(tempname)..tempname..string.rep(" ", (length_max+1) - #tempname)..bordercolor.."| "
              else
            echoline = echoline..string.rep(" ", length_max)..bordercolor.." | "
          end
        end
      end
    
    -- Footer Begin
      echoline = echoline .. "\n" .. bordercolor .. "+"
    
      for k, orgname in ipairs(orglist) do
        echoline = echoline .."-" ..wordcolor .."Players:" ..#orgtable[orgname] ..bordercolor ..(#orgtable[orgname] < 10 and "-" or "") .. string.rep("-", length_max-10) .."-+"
      end
    
      cecho(echoline .. "\n")
      send(" ", false)
    end


  • BrenexBrenex Posts: 105Member ✭✭✭ - Distinguished
    edited April 28

    I was having some weird problem now where I had to change

    orgtable[org:title()] = orgtable[org] or {}
    to
    org = org:title()
    orgtable[org] = orgtable[org] or {}



Sign In to Comment.