Class Prayers

java.lang.Object
net.storm.sdk.widgets.Prayers

public class Prayers extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Checks whether any prayer is currently active.
    static boolean
    canUse(net.runelite.api.Prayer prayer)
    Checks whether the player has the required level to use the specified prayer.
    static void
    Disables all currently active prayers using the default interaction method.
    static void
    disableAll(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.Prayer
    Retrieves the best magic offensive prayer the player can currently use.
    static net.runelite.api.Prayer
    Retrieves the best melee offensive prayer the player can currently use.
    static net.runelite.api.Prayer
    Retrieves the best ranged offensive prayer the player can currently use.
    static int
    Retrieves the number of prayer points missing from the maximum.
    static int
    Retrieves 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 boolean
    isEnabled(net.runelite.api.Prayer prayer)
    Checks whether the specified prayer is currently enabled.
    static boolean
    isQuickPrayerActive(List<net.runelite.api.Prayer> prayers)
    Checks whether all specified prayers are currently active via quick prayers.
    static boolean
    isQuickPrayerActive(net.runelite.api.Prayer prayer)
    Checks whether the specified prayer is currently active via quick prayers.
    static boolean
    Checks whether quick prayers are currently enabled and active.
    static boolean
    Checks whether the quick prayer configuration interface is currently open.
    static boolean
    isQuickPrayerSelected(List<net.runelite.api.Prayer> prayers)
    Checks whether all specified prayers are selected in the quick prayer preset.
    static boolean
    isQuickPrayerSelected(net.runelite.api.Prayer prayer)
    Checks whether the specified prayer is selected in the quick prayer preset.
    static boolean
    Opens the quick prayer configuration interface.
    static boolean
    setQuickPrayers(List<net.runelite.api.Prayer> prayers)
    Sets the quick prayer preset to the specified prayers and closes the interface.
    static boolean
    setQuickPrayers(List<net.runelite.api.Prayer> prayers, boolean closeInterface)
    Sets the quick prayer preset to the specified prayers.
    static void
    toggle(net.runelite.api.Prayer prayer)
    Toggles the specified prayer using the default interaction method.
    static void
    toggle(InteractMethod interactMethod, net.runelite.api.Prayer prayer)
    Toggles the specified prayer using the given interaction method.
    static void
    Toggles quick prayers on or off using the default interaction method.
    static void
    toggleQuickPrayer(boolean enabled)
    Toggles quick prayers to the specified state using the default interaction method.
    static void
    Toggles quick prayers on or off using the specified interaction method.
    static void
    toggleQuickPrayer(InteractMethod interactMethod, boolean enabled)
    Toggles quick prayers to the specified state using the given interaction method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static void toggle(InteractMethod interactMethod, net.runelite.api.Prayer prayer)
      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

      public static void toggleQuickPrayer(InteractMethod interactMethod, boolean enabled)
      Toggles quick prayers to the specified state using the given interaction method.
      Parameters:
      interactMethod - the method to use for interacting
      enabled - 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

      public static void toggleQuickPrayer(InteractMethod interactMethod)
      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

      public static void disableAll(InteractMethod interactMethod)
      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

      public static List<net.runelite.api.Prayer> getSelectedQuickPrayers()
      Retrieves the list of prayers currently selected in the quick prayer preset.
      Returns:
      a list of selected quick prayers
    • getActiveQuickPrayers

      public static List<net.runelite.api.Prayer> 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 prayers
      closeInterface - whether to close the quick prayer interface after setting
      Returns:
      true if the quick prayers were successfully set, false otherwise
    • setQuickPrayers

      public static boolean setQuickPrayers(List<net.runelite.api.Prayer> prayers)
      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

      public static boolean isQuickPrayerSelected(List<net.runelite.api.Prayer> prayers)
      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

      public static boolean isQuickPrayerActive(List<net.runelite.api.Prayer> prayers)
      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