Package rs.kreme.ksbot.api.game
Class Lootable
- java.lang.Object
-
- rs.kreme.ksbot.api.game.Lootable
-
public class Lootable extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Lootable.Priority
-
Field Summary
Fields Modifier and Type Field Description static boolean
LOOT_FOOD
static boolean
LOOT_PRAYER_POTIONS
-
Constructor Summary
Constructors Constructor Description Lootable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDrop(KSGroundItem item)
Adds the quantity of a dropped item to the tracker.void
addDrop(KSItem item)
Adds the quantity of a dropped item to the tracker.void
addItem(Lootable.Priority priority, int... items)
Adds items by ID with a specified priority to the lootations map.void
addItem(Lootable.Priority priority, java.lang.String... items)
Adds items by name with a specified priority to the lootations map.boolean
contains(int id)
Checks if the lootations map contains the specified item by ID.boolean
contains(java.lang.String name)
Checks if the lootations map contains the specified item by name.java.lang.String[]
getItems()
Retrieves all item names/IDs marked for looting.Lootable.Priority
getPriority(KSGroundItem item)
Retrieves the priority of a specific ground item.boolean
pickup()
Attempts to pick up the highest-priority item on the ground.boolean
pickup(java.lang.String[] list)
void
reset()
Clears all items from the lootations map and resets flags.
-
-
-
Method Detail
-
getItems
public java.lang.String[] getItems()
Retrieves all item names/IDs marked for looting.- Returns:
- Array of item names/IDs to loot.
-
addDrop
public void addDrop(KSGroundItem item)
Adds the quantity of a dropped item to the tracker.- Parameters:
item
- The ground item to track.
-
addDrop
public void addDrop(KSItem item)
Adds the quantity of a dropped item to the tracker.- Parameters:
item
- The ground item to track.
-
getPriority
public Lootable.Priority getPriority(KSGroundItem item)
Retrieves the priority of a specific ground item.- Parameters:
item
- The ground item to evaluate.- Returns:
- The priority of the item, or
DEFAULT
if not specified.
-
contains
public boolean contains(int id)
Checks if the lootations map contains the specified item by ID.- Parameters:
id
- The item ID to check.- Returns:
true
if the item is in the lootations map.
-
contains
public boolean contains(java.lang.String name)
Checks if the lootations map contains the specified item by name.- Parameters:
name
- The item name to check.- Returns:
true
if the item is in the lootations map.
-
pickup
public boolean pickup()
Attempts to pick up the highest-priority item on the ground.- Returns:
true
if an item was picked up,false
otherwise.
-
pickup
public boolean pickup(java.lang.String[] list)
-
addItem
public void addItem(Lootable.Priority priority, int... items)
Adds items by ID with a specified priority to the lootations map.- Parameters:
priority
- The priority level.items
- Array of item IDs.
-
addItem
public void addItem(Lootable.Priority priority, java.lang.String... items)
Adds items by name with a specified priority to the lootations map.- Parameters:
priority
- The priority level.items
- Array of item names.
-
reset
public void reset()
Clears all items from the lootations map and resets flags.
-
-