Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: invdb.lic - Cross-character searching & tracking of inventory, lockers, bank accounts

  1. #1

    Default invdb.lic - Cross-character searching & tracking of inventory, lockers, bank accounts

    script name: invdb.lic

    Cross-character searching & tracking of inventory, lockers, bank accounts, and other data.

    tldr: run `;invdb` to load your stuff, then `;invdb thing` to find your thing. More options? read the rest.

    If you find a bug, send me a message on discord Xanlin#4407


    getting started:

    Code:
      +---------------------------------------------------------------+
      ;invdb help      > help text (this)
      ;invdb menu      > basic starter menu
      ;invdb examples  > examples 
      ;invdb changelog > changelog
    
      first parameter: action (default to refresh all if no parameters provided)
        options: refresh, query, sum (or total), export, reset, delete, drop
          refresh   load/update your database
          query     prints out results to your story window
          sum       less detail than query, aggregates by type and item
          export    export table or query to a file
          reset     clear everything and start over
          delete    delete stuff, can be complicated, more on this later
          drop      drops a table, (item|bank|char)
    
          
      second parameter: target (defaults to all or item)
        options: bank, char, item, inv, locker
          bank      bank account & silvers
          char      character info
          item      both inventory and lockers
          inv       inventory, but not lockers
          locker    locker(s), but not inventory
          
      optional parameters: 
        char=name                           # supports wildcards
        game=gsiv                           # ignore this if you only play one game
        type=gem                            # based on your GameObj type data.
        amount(<|<=|=|>|>=)42               # amount greater than, equal to, etc a number
        qty(<|<=|=|>|>=)42                  # qty greater than, equal to, etc a number
        noun=stone                          # buggy on items from locker manifest,
                                                grabs the last word in the name
        path=backpack                       # all items that start in a backpack
        stack=(jar|bundle|stack|pack)       # only jars implemented so far
        status=(empty|partial|full)         # to help find empty or full jars
        marked=Y                            # not recorded in standard lockers
        registered=Y                        # not recorded in standard lockers
        worn=                               # not yet implemented
    
        delay=5                             #adds a delay before doing stuff
                                             useful for adding to autostart
        
      All other input is used as a search string in the primary name in the target.
    
      If no parameters are provided, defaults to `refresh all`
    
      If no applicatable action & target are specified, 
      defaults to querying for items based on other input
      +---------------------------------------------------------------+
      exporting:
        ;invdb export (char|item|inv|locker|bank) (optional parameters)
        - additional optional export parameters:
          format=(csv|txt|pipe)  default = csv
          dir="directory path"   default = $lich_dir\\inv\\   
          file="filename.ext"    default = (params)_target_timestamp.csv
      +---------------------------------------------------------------+
      most commands have abbreviations:
        q  = query      c = char        m = marked
        i  = item       g = game        r = registered
        in = inv        t = type        s = stack
        l  = locker     n = noun        status = status 
        b  = bank       p = path        w = worn
      
      +--------------------------------------------------------------+
      |                             invdb                            |
      +--------------------------------------------------------------+
    
        Run #1 first if your database is empty:
         1: ;invdb refresh all to create/update the database
        
        some examples: 
         2: character list       ;invdb query char
         3: bank accounts        ;invdb q bank
         4: landing bank total   ;invdb sum bank amount>100000 elan
         5: all gems in inv(s)   ;invdb q inv type=gem
         6: your stuff           ;invdb q item c=Xanlin
         7: all locker stuff     ;invdb q locker
         8: all empty jars       ;invdb type=jar status=empty
         9: total gems           ;invdb sum type=gem
        10: total uncut diamonds ;invdb sum type=gem =uncut dia*
        
        Add an optional delay for autostart: ;autostart add invdb delay=3
      +--------------------------------------------------------------+
    note: If you don't have premium lockers, your locker location is just listed as `locker`

    After you've run ;invdb on each of the characters you want to load:

    example in-game output:

    searching for something related to button:

    Code:
    >;inv q button
    --- Lich: invdb active.
    ...  loc: location of the item (hands|inv|locker|town abbr if multi locker)
    ... path: the path to an item, e.g. `backpack > box` is in a box, in a backpack
    ... type: object type, per GameObj.type_data
    ...  stk: stack, a non-standard container, e.g. jar|bundle|voucher pack
    ...  epf: status (empty|partial|full) for jars/stacks
    ...    m: marked (Y or blank)
    ...    r: registered (Y or blank)
    -------------------------------------------------------------------------------------------------------
     name         |loc   | path             | qty|type      |stk|epf|m|r| item                             
    -------------------------------------------------------------------------------------------------------
     Somealt1     |locker| locker           |   1|armor     |   |   | | | reinforced silver-buttoned leathers 
     Xanlin       |locker| locker           |   1|          |   |   | | | silvery moon-shaped button painted with the words, "Community.  Unity.  Icemule.  Vote Tawariell." 
    -------------------------------------------------------------------------------------------------------
    matched 2 rows from item.
    --- Lich: invdb has exited.
    finding where you stashed some gems:

    Code:
    >;inv type=gem =uncut diamond
    --- Lich: invdb active.
    --------------------------------------------------------------------------------------------------------
     name         |loc   | path             | qty|type      |stk|epf|m|r| item                             
    --------------------------------------------------------------------------------------------------------
     Somealt1     |inv   | satchel          |   2|gem       |   |   | | | uncut diamond 
     Mule1        |inv   | sack > jar       | 100|gem       |jar|   | | | uncut diamond 
     Mule2        |hands | jacket > jar     |  42|gem       |jar|   | | | uncut diamond 
     Mule2        |inv   | greatcloak > jar |  63|gem       |jar|   | | | uncut diamond 
     Mule3        |inv   | bag              |   1|gem       |   |   | | | uncut diamond 
    --------------------------------------------------------------------------------------------------------
    matched 5 rows from item.
    --- Lich: invdb has exited.
    getting a total number of an item:

    Code:
    >;inv sum type=gem =uncut diamond
    --- Lich: invdb active.
    --------------------------------------------------------------
    type      |        amount | item                             
    --------------------------------------------------------------
    gem       |           208 | uncut diamond 
    gem       |           208 | total                            
    --------------------------------------------------------------
    matched 2 rows from item.
    --- Lich: invdb has exited.

    bank accounts:

    Can't remember how much that one character has in their bank?

    Code:
    >;inv q bank char=xanlin
    --- Lich: invdb active.
    ------------------------------------------------------------------------
     name         | bank                         |        amount | updated 
    ------------------------------------------------------------------------
     Xanlin       | First Elanith Secured Bank   |       ###,### | 06/25/18 
     Xanlin       | Great Bank of Kharam-Dzu     |        ##,### | 06/25/18 
     Xanlin       | Vornavis Bank of Solhaven    |       ###,### | 06/25/18 
     Xanlin       | Bank of Torre County         |       ###,### | 06/25/18 
     Xanlin       | Icemule Trace Bank           |     #,###,### | 06/25/18 
     Xanlin       | Bank of Kharag 'doth Dzulthu |        ##,### | 06/25/18 
     Xanlin       | United City-States Bank      |     #,###,### | 06/28/18 
     Xanlin       | Cysaegir Bank                |        ##,### | 06/26/18 
     Xanlin       | Total                        |     #,###,### | 06/28/18 
    ------------------------------------------------------------------------
    matched 9 rows from bank.
    --- Lich: invdb has exited.
    total up all your bank accounts:

    Code:
    >;inv sum bank
    --- Lich: invdb active.
    --------------------------------------------------------------
     bank                         |        amount |   characters 
    --------------------------------------------------------------
     Bank of Kharag 'doth Dzulthu |        ##,### | Xanlin, Somealt 
     Bank of Torre County         |       ###,### | Xanlin, Somealt, Somealt2
     Cysaegir Bank                |        ##,### | Xanlin, Somealt, Somealt2
     First Elanith Secured Bank   |       ###,### | Xanlin, Somealt, Somealt2 
     Great Bank of Kharam-Dzu     |        ##,### | Xanlin, Somealt, Somealt2
     Icemule Trace Bank           |     #,###,### | Xanlin, Somealt, Somealt2 
     United City-States Bank      |     #,###,### | Xanlin, Somealt, Somealt2 
     Vornavis Bank of Solhaven    |       ###,### | Xanlin, Somealt, Somealt2
     grand total                  |     #,###,### | Xanlin, Somealt, Somealt2
    --------------------------------------------------------------
    matched 9 rows from bank.
    --- Lich: invdb has exited.
    Get your total at just one bank if you prefer:

    Code:
    >;inv sum bank elan
    --- Lich: invdb active.
    --------------------------------------------------------------
     bank                         |        amount |   characters 
    --------------------------------------------------------------
     First Elanith Secured Bank   |       ###,### | Xanlin, Somealt, Somealt2
    --------------------------------------------------------------
    matched 1 rows from bank.
    --- Lich: invdb has exited.

    Don't care for the in game queries and prefer your spreadsheets instead? You can export to csv (or tab/pipe delimited) and do whatever you want with it:

    Code:
    >;inv export item
    --- Lich: invdb active.
    exported 1166 rows from item to
    C:/.../lich/inv/item_2018-06-28_12-59-35.csv.
    --- Lich: invdb has exited.
    item_2018-06-28_12-59-35.csv :
    Code:
    name,loc,path,qty,type,stk,epf,m,r,item
    Xanlin,inv,"",1,clothing,"", ,"","",thick ebonwood armband
    Xanlin,inv,"",1,clothing,"", ,Y,"",translucent spidersilk backpack
    Xanlin,inv,"",1,jewelry,"", ,"","",copper-bound linen badge
    Xanlin,inv,"",1,clothing,"", ,Y,"",oiled light leather courier bag  with polished faenor buckles
    Xanlin,inv,"",1,"","", ,Y,"",black leather disarming case
    Xanlin,inv,"",1,clothing,"", ,Y,Y,translucent spidersilk cloak
    Xanlin,inv,"",1,"","", ,Y,Y,pair of rolaren-studded gauntlets
    Xanlin,inv,"",1,"","", ,Y,"",pair of black-tinted glasses
    Xanlin,inv,"",1,"","", ,Y,"",onyx-studded shadowy black hip-satchel
    Xanlin,inv,"",1,"","", ,"",Y,black hand insignia
    Xanlin,inv,"",1,clothing,"", ,Y,Y,silver locksmith kit
    Xanlin,inv,"",1,jewelry,"", ,"","",tiny iron catapult pin
    Xanlin,inv,"",1,magic,"", ,Y,"",dull gold ring
    Xanlin,inv,"",1,clothing,"", ,Y,"",matte black satchel
    Xanlin,inv,"",1,"","", ,Y,"",dark leather scalemail
    Xanlin,inv,"",1,"","", ,Y,"",leather swordbelt
    Xanlin,inv,"",1,"","", ,Y,"",emerald-hued imflass trident symbol  adorned with blue coral
    Xanlin,inv,backpack,1,magic,"", ,"","",white flask
    Xanlin,inv,backpack,1,herb,"", ,"","",ambrominas leaf
    Xanlin,inv,backpack,1,lockpick,"", ,"","",copper lockpick
    Xanlin,inv,backpack,1,magic,"", ,"","",flawless gold ring
    Xanlin,inv,backpack,1,magic,"", ,"","",small statue
    Xanlin,inv,bag,1,magic,"", ,"","",ruby amulet
    Xanlin,inv,bag,1,"","", ,Y,Y,thin coarse linen blindfold
    Xanlin,inv,bag,3,"","", ,"","",crisp parchment bloodscrip
    Xanlin,inv,bag,1,clothing,"", ,Y,Y,pair of rolaren-toed boots
    Xanlin,inv,bag,2,gem,"", ,"","",uncut star-of-Tamzyrr diamond
    New as of v0.1.9:
    Added extra columns for some types (gem,reagent) for sum/total queries to help differentiate between jarred and non-jarred (loose) gems/reagents:

    These aren't included in ;inv help yet, pending further testing (but seem to be stable so far).

    Code:
     
    >;inv sum type=gem 
    --- Lich: invdb active.
    ... type: object type, per GameObj.type_data
    --------------------------------------------------------------------------------
    type      |        amount |  loose | jarred | item                             
    --------------------------------------------------------------------------------
    gem       |             1 |      1 |      0 | black deathstone                 
    ... (more rows)
    gem       |           208 |     58 |    150 | violet sapphire                  
    gem       |           218 |     18 |    200 | white opal                       
    gem       |           287 |      8 |    279 | uncut emerald                    
    gem       |           313 |     13 |    300 | star sapphire                    
    gem       |         7,871 |  1,105 |  6,766 | total                            
    --------------------------------------------------------------------------------
    Code:
    >;inv sum type=reagent
    --- Lich: invdb active.
    ... type: object type, per GameObj.type_data
    --------------------------------------------------------------------------------
    type      |        amount |  loose | jarred | item                             
    --------------------------------------------------------------------------------
    reagent   |             1 |      0 |      1 | crimson troll king bezoar        
    reagent   |             1 |      0 |      1 | vial of farlook vitreous humor   
    reagent   |             5 |      0 |      5 | inky necrotic core               
    reagent   |             7 |      0 |      7 | tiny golden seed                 
    reagent   |            11 |      0 |     11 | glowing violet essence shard     
    reagent   |            35 |      0 |     35 | n'ayanad crystal                 
    reagent   |            51 |      0 |     51 | ayanad crystal                   
    reagent   |           111 |      0 |    111 | total                            
    --------------------------------------------------------------------------------
    Added preliminary support for changing the order of rows, and optional grouping for sum/total queries using orderby= and/or groupby=

    for order by, ascending is assumed if not included:

    desc = descending = from highest to lowest value
    asc = ascending = from lowest to highest value

    If I want to see how many gems I have that I haven't jarred yet, I can do something like this:

    Code:
    >;inv sum type=gem orderby="jarred desc,loose asc"
    --- Lich: invdb active.
    ... type: object type, per GameObj.type_data
    --------------------------------------------------------------------------------
    type      |        amount |  loose | jarred | item                             
    --------------------------------------------------------------------------------
    ..... (lots of rows)...
    gem       |             8 |      8 |      0 | piece of blue quartz             
    gem       |             8 |      8 |      0 | rock crystal                     
    gem       |            10 |     10 |      0 | piece of yellow jasper           
    gem       |            12 |     12 |      0 | banded sardonyx stone            
    gem       |            15 |     15 |      0 | piece of black jasper            
    gem       |            26 |     26 |      0 | star diopside                    
    --------------------------------------------------------------------------------
    matched 163 rows from item.
    If I like being able to see the total amount of an item I have without all the extra rows and path information, but don't want to run a query with a character filter, I can add an optional grouping by character with groupby=character

    Code:
    >;inv sum statue groupby=character
    --- Lich: invdb-test active.
    ... type: object type, per GameObj.type_data
    -----------------------------------------------------------------------------
    type      |        amount | name         | item                             
    -----------------------------------------------------------------------------
    magic     |             1 | Mule1        | jacinth-inset lounging cat statue 
    magic     |             2 | Alt1         | small statue 
    magic     |             2 | Alt2         | small statue 
    magic     |             2 | Alt3         | small statue 
    magic     |             5 | Alt4         | small statue 
    magic     |             8 | Mule1        | small statue 
    magic     |             9 | Alt5         | small statue 
    magic     |             9 | Xanlin       | small statue 
    magic     |            17 | Mule2        | small statue 
    magic     |            55 | total        | total                            
    -----------------------------------------------------------------------------
    matched 10 rows from item.
    Last edited by Xanlin; 07-05-2018 at 12:55 PM.

  2. #2

    Default

    As people who run with different front ends and settings play with the script, I'll post bugs that come up here until I get them fixed.

    current bugs:


    persistent bugs (bugs that I'm not sure how to correct just yet):
    • scraping items from the locker manifest for towns you aren't in won't return a noun in the item link like you see when you are nearby or like you see in inventory full. Best guess right now is the last word in the item name, but that's hit or miss. It'll effect the item type, as the noun is passed along with the name to get that based on your `GameObj.type_data`. For now, I've tried to set it so that it will update the noun and type of items if you are getting the local manifest, and leave them alone if you aren't.


    squished bugs: as of v0.2.3
    • Dirvy provided xml and testing scraping for locker manifest, as well as helped catch tons of bugs before release
    • Dirvy found and helped resolve an inventory scraping bug (sometimes spaces are in weird places)
    • Rovvigen found and helped resolve a bug that would stall on checking bank accounts (I need to watch out for plurals in regex)
    • Jalodg found and helped resolve a bug with jars in nested containers "I could not find what you were referring to." - Jalodg found a bug with getting the contents of jars in nested containers in inventory e.g. greatcloak > backpack > jar.
    • locker transit bug, probably.
    • Szyxt found an unhandled manifest issue for when you haven't visited the local locker before using the manifest for it
    • Selaesia found and helped resolve a bug where opened secure gem pouches weren't closed again
    • inventory window in stormfront is blank after running refresh. (now runs unsquelched 'inven' command after refreshing inventory)
    • Ondreian found and helped resolve some query bugs and linux/profanity specific issues
    • Luxelle pointed out the need for a default game_filter for the current game, so you wouldn't have to remember to add a game filter if you load invdb up on the test server as well.
    • Kragdruk found issues with using an old version of sqlite, script updated to check sqlite versions.
    • Tsalin found and helped solve an issue with standard lockers that aren't visible in the room (RR / Twilight)
    • Luxelle pointed out some confusion with the delete command, updated to make it behave more intuitively.


    temporary patches
    • Patches in collectible item type data when it doesn't exist.


    Sometimes the script will output some debug information to let you know it's having trouble with something, e.g.

    For whatever reason, sometimes the amount of lines pulled for inventory scans doesn't add up to the number of lines it should be. So it will try again (up to 4 times at the moment). That can look like this:

    Code:
    updating inventory...
    [invdb: parse count: 398 != displayed count: 425]
    [invdb: retrying after error in scan & parse: inv full]
    [invdb: match_fail_count = 0]
    [invdb: match_fail_lines: ]
    [invdb: starting attempt #2]
    [invdb: parse count: 0 != displayed count: 425]
    [invdb: retrying after error in scan & parse: inv full]
    [invdb: match_fail_count = 0]
    [invdb: match_fail_lines: ]
    [invdb: starting attempt #3]
    [invdb: parse count: 0 != displayed count: 425]
    [invdb: retrying after error in scan & parse: inv full]
    [invdb: match_fail_count = 0]
    [invdb: match_fail_lines: ]
    [invdb: starting attempt #4]
    updating locker(s)...
    finished updating all
    The above managed to grab the correct amount of lines of the fourth attempt. If it hadn't, it would have given up (and spit out a bunch more debug information).
    Last edited by Xanlin; 07-08-2018 at 07:52 PM.

  3. #3

    Default

    Impressive!
    Find me in game as Alastir
    Or on Discord as: Alastir#9661

  4. #4

    Default

    Does this/can this dump out to text files?

  5. #5

    Default

    This is the best script EVERRRRRRRR <3 <3 <3 thank you!
    Maags#2011

  6. #6

    Default

    Quote Originally Posted by Erous View Post
    Does this/can this dump out to text files?
    yep, check the 2nd to last and last examples

  7. Default

    holy shit

  8. #8

    Default

    so i am probably dumb but when i run invdb it just says updating bank account then nothing else. guessing i am supposed to do something else too

  9. Default

    Huzzah! I feel a fog lifting from my brain!

  10. #10

    Default

    Quote Originally Posted by beldannon5 View Post
    so i am probably dumb but when i run invdb it just says updating bank account then nothing else. guessing i am supposed to do something else too
    Updated to fix that bug, thank Rovvigen for also only having 1 inter-town bank transfer option!
    Last edited by Xanlin; 06-29-2018 at 09:22 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •