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

[APT] A (almost) trigger-less NDB.

AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
-- Log of it in action, for the needy people --

So when I started here, I found someone's NDB on the forums that I decided to play around with, since that's basically the only thing that was missing from WunderSys... The more I coded, the more I realised just how unfinished it felt... So I did what any normal person would do, and completely rewrote it from the ground up. This time without any wonky bugs in it.

It's much like the old one, with relatively similar syntax (after speaking with people, I realised how many others used it, so I figured this would help if they decided to switch)

Installation:
1) Make sure GMCP is enabled... Or don't, it doesn't actually use it really at all.
2) Install it via the package manager, as per usual.
3) Use 'aptinstall' to initialise everything.
Aliases used in the log:

  1. qwp will check qwho, and then grab missing information from anyone not currently tracked.
  2. apt stats will display player count of each city.
  3. apt citizens <city> will display the citizens of a chosen city.  'apt citizens eleusis' for example.
  4. apt class <class> will display the tracked players of the chosen class.  'apt class runewarden' for example.
  5. apt remove will clear out all unranked people from the database; useful if it gets super large.
  6. apt redo will update the information of everybody currently in the database; except this one is near instantaneous updating as opposed to waiting a few minutes to honours everybody.
  7. whois (person) will display information on a chosen individual. 'whois alyxeri' for example.
  8. aptc show will display the current settings.


Something the previous version was missing, which I've seen some people wanting. Highlighting!

  1. apt hl to toggle the highlighting on and off. Don't spam it, else it'll mess it up and you'll have to restart mudlet to fix it.
  2. aptc <arg1> <arg2> will change the highlighting of a city; the city can be either arg1 or arg2, for those who forget it. So 'aptc eleusis orange' will work, and 'aptc orange eleusis' will work. Currently there's no way to -not- highlight a city, sorry. I was too lazy for that. Just set it to grey, if you want the default serverside colouring.


Something else the previous version was sorely missing. An API to use with scripts, much like SVO's NDB has!


  1. apt_exists("person") will return true or false, depending on if they're currently in the database.
  2. apt_isAshtani("person") will return true or false, if they are Ashtani.
  3. apt_isCyrenian("person") will return true or false, if they are Cyrenian.
  4. apt_isEleusian("person") will return true or false, if they are Eleusian.
  5. apt_isHashani("person") will return true or false, if they are Hashani.
  6. apt_isMhaldorian("person") will return true or false, if they are Mhaldorian.
  7. apt_isTargossian("person") will return true or false, if they are Targossian.
  8. apt_isRogue("person") will return true or false, if they are a rogue.
  9. apt_getCity("person") will return what city the person is currently a part of (or 'Unspecified' if not tracked)
  10. apt_getClass("person") will return the current class the person was last seen as (or 'Unspecified' if not applicable)



Enjoy.

KoganAldwicYselaTysandrExelethrilLucianusRekhyrLyrinShirszaeAnzeRomRangor

Comments

  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    I won't lie, I love this.  It was one of the things on my "next to do" list but I grabbed PT_track and have been using it (adapting it for things I wanted to do like coloring names in my "Players Here" window by city).   This does everything I would have wanted to implement.  Thanks for saving me the time...again

    Tysandr
  • LucianusLucianus Posts: 385Member ✭✭✭ - Distinguished
    Thank you. Much appreciation for your contribution to this little community with your code. I'll let you know if I find any bugs. (p.s. also check your character for... uh... donations. it's not much... but I can't express my gratitude enough.))
    That is not an ordinary star, my son. That star is the tear of a warrior. A lost soul who has finished his battles somewhere on this planet. A pitiful soul who could not find his way to the lofty realm where the great spirit awaits us all.

    Free Community System for Achaea: TReX System <link here>
    - I have decided to become involve in developing and maintaining this community system for Achaea. Feel free to message me in-game or on forum for help or bugfixing.
    Dochitha
  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    edited October 25
    Lucianus said:
    Thank you. Much appreciation for your contribution to this little community with your code. I'll let you know if I find any bugs. (p.s. also check your character for... uh... donations. it's not much... but I can't express my gratitude enough.))
    :O Thank you. Let me know if you want any more functionality added to it.
  • DochithaDochitha Posts: 1,061Member ✭✭✭✭✭ - Grand Achaean
    So clean, so light, so fast, yet so complete. Highly recommended. A+++++
  • NehmrahNehmrah Posts: 41Member ✭✭✭ - Distinguished
    edited November 9
    Mind if I hand out your package as part of TReX? TReX Doesnt have an NDB as of yet. Also Goodwork!!
    Dochitha
  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    • Will now auto grab info for people from the newbie trial, when they join your city.
    • Added city tracking of people currently online, since people asked me for it. This will only show when you do 'qwp' - if there's people to add then it will do that, before being allowed to display who's around. This is to prevent untracked people erroneously being displayed/added to false cities.
    The latter uses the colouring of whatever highlights you choose, sorry if you didn't want that. It saved me having to pick colours.

    @Nehmrah would prefer to not have my scripts packaged with other people's stuff, for a number of reasons. Sorry.


  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    Also thanks to @Penwize for detailing the proper way to use string.format for echoes. It shortens a lot of things.
  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    edited November 14
    Alyxeri said:
    • Will now auto grab info for people from the newbie trial, when they join your city.
    • Added city tracking of people currently online, since people asked me for it. This will only show when you do 'qwp' - if there's people to add then it will do that, before being allowed to display who's around. This is to prevent untracked people erroneously being displayed/added to false cities.
    The latter uses the colouring of whatever highlights you choose, sorry if you didn't want that. It saved me having to pick colours.

    @Nehmrah would prefer to not have my scripts packaged with other people's stuff, for a number of reasons. Sorry.


    After I asked for it, I figured it out myself.  But then I left it at work.  So this just saved me a bit of time re-writing what I had (and is likely very similar).  

    Thanks.

    edit:  Doesn't appear to do the online players *every* time I do QWP  

    Didn't do it the first time, figured maybe it just needed to be initialised.  Worked the second time.  hasn't since.

  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    [ERROR:] object:<APT Qwho> function:<Trigger1256>
             <[string "function apt_exists(name)..."]:104: bad argument #1 to 'insert' (table expected, 
    got nil)>

  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    edited November 14
    Caelan said:
    [ERROR:] object:<APT Qwho> function:<Trigger1256>
             <[string "function apt_exists(name)..."]:104: bad argument #1 to 'insert' (table expected, 
    got nil)>
    Judging by what that line is, you probably have someone whose city is hidden from the API. Means you gotta manually honours them!

    Try do 'apt redo' to regrab the honours of everybody, shouldn't take more than 10s or so to parse through them all if your internet is fine. It'll alert you to anyone who needs manual honours to update their city. Big red WARNING line.

    Also as stated in the post, it won't show online people if there's data of people that need to be grabbed. You'll have to do it a second time, for it to display. QWP prios grabbing data > displaying citizens online.
  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    edited November 14
    When it gave the red line for manualling, I did it.  Then did QWP again and again until it didn't catch new people.  Still didn't show.

    I'm at work right now and will install it here and see if maybe there was something on the home profile interfering.


    edit:  Seems to be working now. 

  • KayleKayle Posts: 65Member ✭✭✭ - Distinguished
    Can you add a city/house/order enimies highlight to this @Alyxeri?
  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    edited November 15
    Kayle said:
    Can you add a city/house/order enimies highlight to this @Alyxeri?
    Can I? Probably.

    Will I? Probably not. Who knows.

    I don't really feel like adding a highlight hierarchy. I've been meaning to add the ability to disable highlighting for <x> cities, if the user chooses, though.
  • DochithaDochitha Posts: 1,061Member ✭✭✭✭✭ - Grand Achaean
    edited November 15
    I hooked over to SVO NDB to color my enemies.

    So..you can find this function and add this bolded line and it will bold italic underline your enemies from svo's enemy database:
    function apt_highlight(name, colour)

      local c, k = 1, 1

      while k > 0 do
        k = line:find(name, k)
        if k == nil then return end
        c = c + 1

        if k == line:find("%f[%a]"..name.."%f[%A]", k) then
          if selectString(name, c-1) > -1 then
            if colour     then fg(colour) end
            if ndb.isenemy(name) then setItalics(true) setUnderline(true) setBold(true) end --doch added
            resetFormat()
          else return end
        end

        k = k + 1
      end
    end



    I use APT for highlighting specifically...


  • KayleKayle Posts: 65Member ✭✭✭ - Distinguished
    Svos ndb doesnt capture all the enemies though. Its weird. I have to go in and set people and it sometimes doesnt save the manual change
  • AhmetAhmet Wherever I wanna bePosts: 3,302Member @@ - Legendary Achaean
    Kayle said:
    Svos ndb doesnt capture all the enemies though. Its weird. I have to go in and set people and it sometimes doesnt save the manual change
    It doesnt do personal enemies, but it does house/city/order, plus you can set a whole city as enemy or ally.
    Huh. Neat.
  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    [ERROR:] object:<event handler function> function:<apt_gotInfo>
             <InvalidJSONInput: lexical error: invalid char in json text.
                                           C:\Users\MyNameHere\.conf
                         (right here) ------^
     at lua_yajl1.c line 256>

  • CaelanCaelan Posts: 738Member ✭✭✭✭✭ - Grand Achaean
    edited November 17
    Got it working for the displaying of the numbers by toggling the highlighting and specials a few times, but it's doing that.

    Assuming it's because I'm on 2.1 on my home PC because I couldn't be bothered to upgrade.  Now that I did at work, I won't be doing so here at home because I'm not about to have the same issue with UserWindows


  • AlyxeriAlyxeri Posts: 265Member ✭✭✭ - Distinguished
    Caelan said:
    Got it working for the displaying of the numbers by toggling the highlighting and specials a few times, but it's doing that.

    Assuming it's because I'm on 2.1 on my home PC because I couldn't be bothered to upgrade.  Now that I did at work, I won't be doing so here at home because I'm not about to have the same issue with UserWindows

    No idea about that error, never seen it before.
Sign In to Comment.