Jump to content
Polymorphism

Check if GroundItem is noted/stackable

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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