Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question GroundItem's QueryBuilder ~ Querying item id?

Joined
May 1, 2016
Messages
42
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 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:
GroundItems.newQuery()
                .filter(i -> lootable.contains(i.getId()))
                .results()
                .nearest();

Where lootable would be a collection of integers.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
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 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:
GroundItems.newQuery()
                .filter(i -> lootable.contains(i.getId()))
                .results()
                .nearest();

Where lootable would be a collection of integers.
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
 
Joined
May 1, 2016
Messages
42
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

#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:
        GroundItems.newQuery().ids(0, 1, 2).results().nearest();  // Not Available
        Inventory.newQuery().ids(0, 1, 2).results().random();  // Available
 
Top