- Thread Author
- #1
Much of RuneMate's API is structured around the results API. The results API is a powerful and flexible strictly evaluated extension to both the traditional style API that many clients use and the lazily evaluated query API. Using the results API you can easily do the simple things such as getting the nearest npc from a results object
Traditional API
Query API
Note: Dividers (|) have been placed at the point in the method chain where the traditional/query API usage changes into the results API usage.
while also being able to do the more complex things that would otherwise be rather difficult such as using an npc randomly taken from a list of the closest 3 npcs that are both visible and named chicken or skeleton
Traditional API
Query API
These more complex actions are known to reduce ban-rates by adding a touch of personalization and by making it so that scripts aren't as predictable (and that's why I strongly encourage their usage)
Traditional API
Code:
Npcs.getLoaded("Chicken", "Skeleton")|nearest()
Code:
Npcs.newQuery().names("Chicken", "Skeleton").results()|nearest()
while also being able to do the more complex things that would otherwise be rather difficult such as using an npc randomly taken from a list of the closest 3 npcs that are both visible and named chicken or skeleton
Traditional API
Code:
Npcs.getLoaded(Npcs.getNameFilter("Chicken", "Skeleton").and(Npcs.getVisibleFilter()))|sortByDistance().limit(0, 3).random()
Code:
Npcs.newQuery().visible().names("Chicken", "Skeleton").results()|sortByDistance().limit(0, 3).random()
These more complex actions are known to reduce ban-rates by adding a touch of personalization and by making it so that scripts aren't as predictable (and that's why I strongly encourage their usage)
Last edited: