ChestMap
Allows you to easily and efficiently (remember full/empty chests) find and open chests by criteria. Create with 'Context.Functions.CreateChestMap()'.
It is important that you call 'chestmap.UpdateChestList' at least once before calling 'chestmap.Open', otherwise the results and unpredictable. The chest map can be updated many times afterwards, where the main purpose of this is to find newly rendered/placed chests and could be used when the bot is teleported/moved far away.
'chestmap.Open' will attempt to move to the closest chest that meets the specified criteria (e.g.: non-full). If it's successful then IWindow is returned, where it represents the opened chest containers, otherwise null is returned.
Example usage
In the code below on the start of the plugin we initialize and populate the chest map. Every tick we attempt to open a non-full chest and attempt to store our items in it. You can imagine that Exec() returns true only if the bot's inventory is full and this could be used as a "storage on full" task.
Last updated