1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question GroundItem's QueryBuilder ~ Querying item id?

Discussion in 'Developer Support' started by DevTucker, May 27, 2016.

  1. DevTucker

    Joined:
    May 1, 2016
    Messages:
    42
    Likes Received:
    7
    Perhaps I'm missing something simple, It's not that big of a deal that I'm Querying right now using names, however considering my script bot is only supposed to pick up noted items and sometimes the npc drops the item unnoted my Inventory fills up with trash sometimes.

    I found a way to loot an item based on the ID, however I want to know if there is a build in way to do this.

    Code (Text):
    1. GroundItems.newQuery()
    2.                 .filter(i -> lootable.contains(i.getId()))
    3.                 .results()
    4.                 .nearest();
    Where lootable would be a collection of integers.
     
  2. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    The current solution is to just use the quantity(int minQuantity) option, but I'll add methods for getting noted items only. Or should it be stackable? hmm... @SlashnHax
     
  3. DevTucker

    Joined:
    May 1, 2016
    Messages:
    42
    Likes Received:
    7
    #stackable() and #noted() should both be available. #noted() would always be #stackable() but #stackable() would not always be #noted().

    I feel like adding .ids() to this QueryBuilder shouldn't be that big of a deal, as it's available in the Inventory query builder.

    Code (Text):
    1.  
    2.         GroundItems.newQuery().ids(0, 1, 2).results().nearest();  // Not Available
    3.         Inventory.newQuery().ids(0, 1, 2).results().random();  // Available
     
    Algo_ likes this.
  4. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    I feel like stackable and noted would both be useful
     

Share This Page

Loading...