TileObjectAPI
Find objects such as trees, rocks, doors and bank booths, and click them.
ClassRLPlugins API
public class TileObjectAPIExample
TileObjectEx tree = TileObjectAPI.get("Tree");
if (tree != null && !MovementAPI.isMoving()) {
TileObjectAPI.interact(tree, "Chop down");
}Members
Static methods
- TileObjectExget(Predicate<TileObjectEx>)
Get a tile object by filter.
- TileObjectExget(String...)
Finds the nearest object with one of these names.
- TileObjectExget(int...)
Finds the nearest object with one of these IDs.
- String[]getActions(TileObject)
Get the actions of a tile object.
- TileObjectExgetContains(String...)
Get a tile object by name contains.
- voidinteract(TileObject, String...)
Clicks an object's action, by action number.
- voidinteract(TileObject, int)
Interact with a tile object.
- voidinteract(TileObjectEx, String...)
Clicks the first of these actions the object offers.
- voidinteract(TileObjectEx, int)
Interact with a tile object.
- TileObjectQuerysearch()
Creates an instance of TileObjectQuery.
get(Predicate<TileObjectEx>)static
public static TileObjectEx get(Predicate<TileObjectEx> filter)Get a tile object by filter.
Parameters
filter- Filter.
Returns
Tile object.
get(String...)static
public static TileObjectEx get(String... names)Finds the nearest object with one of these names.
Parameters
names- One or more exact object names, including capital letters.
Returns
The nearest match, or null.
get(int...)static
public static TileObjectEx get(int... ids)Finds the nearest object with one of these IDs.
Parameters
ids- One or more object IDs.
Returns
The nearest match, or null.
getActions(TileObject)static
public static String[] getActions(TileObject tileObject)Get the actions of a tile object.
Parameters
tileObject- Tile object.
Returns
Actions.
getContains(String...)static
public static TileObjectEx getContains(String... names)Get a tile object by name contains.
Parameters
names- Names.
Returns
Tile object.
interact(TileObject, String...)static
public static void interact(TileObject object, String... actions)Clicks an object's action, by action number.
Parameters
object- Object.
actions- Actions.
interact(TileObject, int)static
public static void interact(TileObject object, int action)Interact with a tile object.
Parameters
object- Object.
action- Action.
interact(TileObjectEx, String...)static
public static void interact(TileObjectEx object, String... actions)Clicks the first of these actions the object offers.
Parameters
object- The object. Nothing happens when it is
nullor you are not logged in. actions- Menu actions to try in order, such as
"Open"or"Chop down". Capital letters are ignored.
- If the client moves a real mouse for your plugin, only the first action is used.
interact(TileObjectEx, int)static
public static void interact(TileObjectEx object, int action)Interact with a tile object.
Parameters
object- Object.
action- Action.
search()static
public static TileObjectQuery search()Creates an instance of TileObjectQuery.
Returns
TileObjectQuery.
Also allowed
Every class has these, as in plain Java.
equals, toString