Jump to content
×
×
  • Create New...

New Stream API


const_
 Share

Recommended Posts

  • Administrators

With the release of PowBot 8.8.0 the new Stream API has been introduced which is aimed at replacing the Query API.

 

The new Stream API adds extra methods to the Java 8 Streams API (learn more about them here) which make it easy to filter entities. Every API method class (Players, Npcs, Widgets, Bank etc) now has a toStream() method which will return you a stream containing all loaded entities for that class which you can filter/sort/iterate on.

 

Most of the naming of methods in the Stream API has been copied over from the Query API.

 

Example, Find nearest npc named Goblin where the distance between you and the goblin is <= 4:

ctx.npcs.toStream().within(4).name("Goblin").nearest().findFirst()

 

  • Like 1
Link to post
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
 Share