Package net.storm.sdk.widgets
Class Prayers
java.lang.Object
net.storm.sdk.widgets.Prayers
Provides utility methods for managing prayers and quick prayers.
This class allows toggling individual prayers, managing quick prayer presets, checking prayer status, and querying prayer points. It supports both regular prayer activation and quick prayer functionality.
Prayers provide temporary stat boosts and protection effects but drain prayer points over time. The class also provides methods to find the best offensive prayers for different combat styles based on the player's current level.
Example Usage:
// Toggle a specific prayer
if (!Prayers.isEnabled(Prayer.PROTECT_FROM_MELEE)) {
Prayers.toggle(Prayer.PROTECT_FROM_MELEE);
}
// Check prayer points
if (Prayers.getPoints() < 10) {
// Drink a prayer potion
}
// Use quick prayers
if (!Prayers.isQuickPrayerEnabled()) {
Prayers.toggleQuickPrayer(true);
}
// Set up quick prayers
List<Prayer> quickPrayers = List.of(Prayer.PROTECT_FROM_MELEE, Prayer.PIETY);
Prayers.setQuickPrayers(quickPrayers);
// Get the best offensive prayer for your level
Prayer bestMelee = Prayers.getBestMeleeOffensive();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks whether any prayer is currently active.static booleancanUse(net.runelite.api.Prayer prayer) Checks whether the player has the required level to use the specified prayer.static voidDisables all currently active prayers using the default interaction method.static voiddisableAll(InteractMethod interactMethod) Disables all currently active prayers using the specified interaction method.static List<net.runelite.api.Prayer> Retrieves the list of prayers that are currently active via quick prayers.static net.runelite.api.PrayerRetrieves the best magic offensive prayer the player can currently use.static net.runelite.api.PrayerRetrieves the best melee offensive prayer the player can currently use.static net.runelite.api.PrayerRetrieves the best ranged offensive prayer the player can currently use.static intRetrieves the number of prayer points missing from the maximum.static intRetrieves the player's current prayer points.static List<net.runelite.api.Prayer> Retrieves the list of prayers currently selected in the quick prayer preset.static booleanisEnabled(net.runelite.api.Prayer prayer) Checks whether the specified prayer is currently enabled.static booleanisQuickPrayerActive(List<net.runelite.api.Prayer> prayers) Checks whether all specified prayers are currently active via quick prayers.static booleanisQuickPrayerActive(net.runelite.api.Prayer prayer) Checks whether the specified prayer is currently active via quick prayers.static booleanChecks whether quick prayers are currently enabled and active.static booleanChecks whether the quick prayer configuration interface is currently open.static booleanisQuickPrayerSelected(List<net.runelite.api.Prayer> prayers) Checks whether all specified prayers are selected in the quick prayer preset.static booleanisQuickPrayerSelected(net.runelite.api.Prayer prayer) Checks whether the specified prayer is selected in the quick prayer preset.static booleanOpens the quick prayer configuration interface.static booleansetQuickPrayers(List<net.runelite.api.Prayer> prayers) Sets the quick prayer preset to the specified prayers and closes the interface.static booleansetQuickPrayers(List<net.runelite.api.Prayer> prayers, boolean closeInterface) Sets the quick prayer preset to the specified prayers.static voidtoggle(net.runelite.api.Prayer prayer) Toggles the specified prayer using the default interaction method.static voidtoggle(InteractMethod interactMethod, net.runelite.api.Prayer prayer) Toggles the specified prayer using the given interaction method.static voidToggles quick prayers on or off using the default interaction method.static voidtoggleQuickPrayer(boolean enabled) Toggles quick prayers to the specified state using the default interaction method.static voidtoggleQuickPrayer(InteractMethod interactMethod) Toggles quick prayers on or off using the specified interaction method.static voidtoggleQuickPrayer(InteractMethod interactMethod, boolean enabled) Toggles quick prayers to the specified state using the given interaction method.
-
Constructor Details
-
Prayers
public Prayers()
-
-
Method Details
-
isEnabled
public static boolean isEnabled(net.runelite.api.Prayer prayer) Checks whether the specified prayer is currently enabled.- Parameters:
prayer- the prayer to check- Returns:
- true if the prayer is currently active, false otherwise
-
toggle
Toggles the specified prayer using the given interaction method.- Parameters:
interactMethod- the method to use for interacting (e.g., mouse click or invoke)prayer- the prayer to toggle
-
toggle
public static void toggle(net.runelite.api.Prayer prayer) Toggles the specified prayer using the default interaction method.- Parameters:
prayer- the prayer to toggle
-
getPoints
public static int getPoints()Retrieves the player's current prayer points.- Returns:
- the current prayer points
-
getMissingPoints
public static int getMissingPoints()Retrieves the number of prayer points missing from the maximum.- Returns:
- the difference between max and current prayer points
-
toggleQuickPrayer
Toggles quick prayers to the specified state using the given interaction method.- Parameters:
interactMethod- the method to use for interactingenabled- true to enable quick prayers, false to disable
-
toggleQuickPrayer
public static void toggleQuickPrayer(boolean enabled) Toggles quick prayers to the specified state using the default interaction method.- Parameters:
enabled- true to enable quick prayers, false to disable
-
toggleQuickPrayer
public static void toggleQuickPrayer()Toggles quick prayers on or off using the default interaction method.If quick prayers are currently enabled, they will be disabled, and vice versa.
-
toggleQuickPrayer
Toggles quick prayers on or off using the specified interaction method.- Parameters:
interactMethod- the method to use for interacting
-
isQuickPrayerEnabled
public static boolean isQuickPrayerEnabled()Checks whether quick prayers are currently enabled and active.- Returns:
- true if quick prayers are enabled, false otherwise
-
anyActive
public static boolean anyActive()Checks whether any prayer is currently active.- Returns:
- true if at least one prayer is active, false otherwise
-
disableAll
Disables all currently active prayers using the specified interaction method.- Parameters:
interactMethod- the method to use for interacting
-
disableAll
public static void disableAll()Disables all currently active prayers using the default interaction method. -
canUse
public static boolean canUse(net.runelite.api.Prayer prayer) Checks whether the player has the required level to use the specified prayer.- Parameters:
prayer- the prayer to check- Returns:
- true if the player can use the prayer, false otherwise
-
getBestRangeOffensive
public static net.runelite.api.Prayer getBestRangeOffensive()Retrieves the best ranged offensive prayer the player can currently use.- Returns:
- the highest-tier ranged offensive prayer available, or null if none available
-
getBestMageOffensive
public static net.runelite.api.Prayer getBestMageOffensive()Retrieves the best magic offensive prayer the player can currently use.- Returns:
- the highest-tier magic offensive prayer available, or null if none available
-
getBestMeleeOffensive
public static net.runelite.api.Prayer getBestMeleeOffensive()Retrieves the best melee offensive prayer the player can currently use.- Returns:
- the highest-tier melee offensive prayer available, or null if none available
-
isQuickPrayerOpen
public static boolean isQuickPrayerOpen()Checks whether the quick prayer configuration interface is currently open.- Returns:
- true if the quick prayer setup interface is open, false otherwise
-
openQuickPrayer
public static boolean openQuickPrayer()Opens the quick prayer configuration interface.- Returns:
- true if the interface was successfully opened, false otherwise
-
getSelectedQuickPrayers
Retrieves the list of prayers currently selected in the quick prayer preset.- Returns:
- a list of selected quick prayers
-
getActiveQuickPrayers
Retrieves the list of prayers that are currently active via quick prayers.- Returns:
- a list of currently active quick prayers
-
setQuickPrayers
public static boolean setQuickPrayers(List<net.runelite.api.Prayer> prayers, boolean closeInterface) Sets the quick prayer preset to the specified prayers.- Parameters:
prayers- the list of prayers to set as quick prayerscloseInterface- whether to close the quick prayer interface after setting- Returns:
- true if the quick prayers were successfully set, false otherwise
-
setQuickPrayers
Sets the quick prayer preset to the specified prayers and closes the interface.- Parameters:
prayers- the list of prayers to set as quick prayers- Returns:
- true if the quick prayers were successfully set, false otherwise
-
isQuickPrayerSelected
public static boolean isQuickPrayerSelected(net.runelite.api.Prayer prayer) Checks whether the specified prayer is selected in the quick prayer preset.- Parameters:
prayer- the prayer to check- Returns:
- true if the prayer is selected as a quick prayer, false otherwise
-
isQuickPrayerSelected
Checks whether all specified prayers are selected in the quick prayer preset.- Parameters:
prayers- the list of prayers to check- Returns:
- true if all prayers are selected as quick prayers, false otherwise
-
isQuickPrayerActive
public static boolean isQuickPrayerActive(net.runelite.api.Prayer prayer) Checks whether the specified prayer is currently active via quick prayers.- Parameters:
prayer- the prayer to check- Returns:
- true if the prayer is active via quick prayers, false otherwise
-
isQuickPrayerActive
Checks whether all specified prayers are currently active via quick prayers.- Parameters:
prayers- the list of prayers to check- Returns:
- true if all prayers are active via quick prayers, false otherwise
-