Nicer? looking QWHO.

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!


Comments

  • Something may be missing to make it work with svof. 


  • edited January 2018
    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.

  • Tahquil breaking things as per usual.

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



  • @Pyori

    Make for Mudlet!





    "All we have to decide is what to do with the time that is given to us."

  • Tysandr said:
    @Pyori

    Make for Mudlet!

                

  • Tysandr said:
    @Pyori

    Make for Mudlet!





    What are the characters inside the square brackets meant to indicate?
  • 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. 
  • edited January 2018
    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.
    "All we have to decide is what to do with the time that is given to us."

  • edited January 2018
    Interesting idea, you can echo them in Mudlet too
  • edited January 2018
    @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 State
    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.

  • 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)
  • 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.
    "All we have to decide is what to do with the time that is given to us."

  • edited January 2018
    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.
    "All we have to decide is what to do with the time that is given to us."

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

  • edited February 2018
    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.
  • 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.

  • I got another thing. Sorry.

    Columns bump out with longer names.

  • edited February 2018
    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.


  • Gotta love it when my name screws things up.
  • 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.
  • I miss when you could WTF people's posts...
  • edited April 2018
    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


  • edited April 2018

    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 or Register to comment.