Jump to content

Check if GroundItem is noted/stackable


Recommended Posts

Posted (edited)
38 minutes ago, Polymorphism said:

Didn't see anything in the API. I'd like to check if an item is noted or stackable so that my script can loot it while having a full inventory.

 

Have you tried this to check if it is noted:

groundItem.getDefinition().isNoted()

 

Edited by Explv
  • Like 1
Posted
33 minutes ago, Polymorphism said:

Didn't see anything in the API. I'd like to check if an item is noted or stackable so that my script can loot it while having a full inventory.

 

If an item is stackable, it's noted id will be -1.

Here is a test example:

// Fire rune (stackable)
log("Fire rune noted id: " + ItemDefinition.forId(554).getNotedId());

// Cannonball (stackable)
log("Cannonball noted id: " + ItemDefinition.forId(2).getNotedId());

// Yew logs (not stackable)
log("Yew logs noted id: " + ItemDefinition.forId(1515).getNotedId());

 

Output:

[INFO][Bot #1][05/03 10:17:00 PM]: Fire rune noted id: -1
[INFO][Bot #1][05/03 10:17:00 PM]: Cannonball noted id: -1
[INFO][Bot #1][05/03 10:17:00 PM]: Yew logs noted id: 1516

 

So to check if a ground item is stackable:

groundItem.getDefinition().getNotedId() == -1

 

  • Like 2
Posted
1 hour ago, Explv said:

If an item is stackable, it's noted id will be -1.

Here is a test example:


// Fire rune (stackable)
log("Fire rune noted id: " + ItemDefinition.forId(554).getNotedId());

// Cannonball (stackable)
log("Cannonball noted id: " + ItemDefinition.forId(2).getNotedId());

// Yew logs (not stackable)
log("Yew logs noted id: " + ItemDefinition.forId(1515).getNotedId());

 

Output:


[INFO][Bot #1][05/03 10:17:00 PM]: Fire rune noted id: -1
[INFO][Bot #1][05/03 10:17:00 PM]: Cannonball noted id: -1
[INFO][Bot #1][05/03 10:17:00 PM]: Yew logs noted id: 1516

 

So to check if a ground item is stackable:


groundItem.getDefinition().getNotedId() == -1

 

Wow, good info! You are seriously an awesome guy :D

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...