OSRSB / OsrsBot

A RuneLite bot automation extension API for Old School RuneScape
https://discord.gg/CGBXNrHREP
GNU General Public License v3.0
135 stars 69 forks source link

minor improvements and additions #279

Closed Stonebank closed 1 year ago

Stonebank commented 1 year ago

While developing bot scripts I figured the following methods were missing. These are ones that I have personally used a lot

Inventory:

  1. getItemsContainingName returns all items containing the input string
  2. getFirstItemContainingName returns the first item containing the input string

NPCChat:

  1. selectOption selects the option corresponding to the option index. So for example, 1 would be option 1 in the dialogue and so on. I thought this was easier than entering the whole string

RSPlayer:

  1. Implemented a better "isMoving" boolean, returns true if the last tile is not the same as current or if the local player is moving

Walking:

  1. GetRealRunEnergy just divides the getEnergy by 100 to return an easier accessible value.

All of this has been tested throughout, javadoc has also been added.

Stonebank commented 1 year ago

Correction:

getRealRunEnergy is called getEnergyPercentage

Also added:

getWeight returns the player in-game weight hasDepletionActive returns whether depletion is active by using the varbit