Package rs.kreme.ksbot.api.game
Class Prayer
- java.lang.Object
-
- rs.kreme.ksbot.api.game.Prayer
-
public class Prayer extends java.lang.Object
This class handles the player's prayer functionality, allowing for enabling/disabling specific prayers, checking prayer status, and retrieving the current prayer points. Additionally, it now includes methods for retrieving enabled prayers and managing quick prayers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Prayer.Prayerbook
Enum representing the different prayer books.static class
Prayer.Prayers
-
Constructor Summary
Constructors Constructor Description Prayer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Prayer.Prayers
bestMagicPrayer()
Determines the best magic prayer available to the player based on their Prayer and Defence levels and unlock status of Augury.Prayer.Prayers
bestRangedPrayer()
Determines the best ranged prayer available to the player based on their Prayer and Defence levels and unlock status of Rigour.Prayer.Prayers
bestStrengthPrayer()
Determines the best strength prayer available to the player based on their Prayer and Defence levels and unlock status of Chivalry and Piety.void
disable(Prayer.Prayers... prayers)
Disables the provided prayers, ensuring that they are not already disabled.void
disableAll()
void
enable(Prayer.Prayers... prayers)
Enables the provided prayers, ensuring that they are not already enabled.java.util.List<Prayer.Prayers>
getEnabledPrayers()
Determines the currently enabled prayers.java.util.Set<Prayer.Prayers>
getEnabledQuickPrayers()
Determines the currently enabled quick prayers.int
getPercentLeft()
Gets the player's current prayer points percentage.int
getPoints()
Gets the player's current prayer points.boolean
isEnabled(Prayer.Prayers prayer)
Checks if a specific prayer is currently enabled.boolean
isPrayerSelected(Prayer.Prayers prayer)
void
quickPrayer(boolean enable)
Toggles the Quick Prayer functionality based on the specified state.void
removeQuickPrayers(boolean close, Prayer.Prayers... prayers)
Removes the specified prayers from quick prayer functionality only if they are currently set.void
selectQuickPrayers(boolean close, Prayer.Prayers... prayers)
Selects the specified prayers for quick prayer functionality only if they are not already set.
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled(Prayer.Prayers prayer)
Checks if a specific prayer is currently enabled.- Parameters:
prayer
- The prayer to check.- Returns:
- True if enabled, false otherwise.
-
enable
public void enable(Prayer.Prayers... prayers)
Enables the provided prayers, ensuring that they are not already enabled. If the prayer points are 0, no action is taken.- Parameters:
prayers
- The prayers to enable.
-
disable
public void disable(Prayer.Prayers... prayers)
Disables the provided prayers, ensuring that they are not already disabled.- Parameters:
prayers
- The prayers to disable.
-
disableAll
public void disableAll()
-
getPoints
public int getPoints()
Gets the player's current prayer points.- Returns:
- The current prayer points.
-
getPercentLeft
public int getPercentLeft()
Gets the player's current prayer points percentage.- Returns:
- The current prayer points percentage.
-
quickPrayer
public void quickPrayer(boolean enable)
Toggles the Quick Prayer functionality based on the specified state.- Parameters:
enable
- - If true, enables Quick Prayer; if false, disables it.
-
getEnabledPrayers
public java.util.List<Prayer.Prayers> getEnabledPrayers()
Determines the currently enabled prayers.- Returns:
- A list of enabled prayers.
-
getEnabledQuickPrayers
public java.util.Set<Prayer.Prayers> getEnabledQuickPrayers()
Determines the currently enabled quick prayers.- Returns:
- A set of quick prayers currently selected.
-
isPrayerSelected
public boolean isPrayerSelected(Prayer.Prayers prayer)
-
selectQuickPrayers
public void selectQuickPrayers(boolean close, Prayer.Prayers... prayers)
Selects the specified prayers for quick prayer functionality only if they are not already set.- Parameters:
close
- Whether to close the interface after selection.prayers
- The prayers to select as quick prayers.
-
removeQuickPrayers
public void removeQuickPrayers(boolean close, Prayer.Prayers... prayers)
Removes the specified prayers from quick prayer functionality only if they are currently set.- Parameters:
close
- Whether to close the interface after removal.prayers
- The prayers to remove from quick prayers.
-
bestRangedPrayer
public Prayer.Prayers bestRangedPrayer()
Determines the best ranged prayer available to the player based on their Prayer and Defence levels and unlock status of Rigour.- Returns:
- the best ranged prayer, or null if no suitable prayer is available.
-
bestStrengthPrayer
public Prayer.Prayers bestStrengthPrayer()
Determines the best strength prayer available to the player based on their Prayer and Defence levels and unlock status of Chivalry and Piety.- Returns:
- the best strength prayer, or null if no suitable prayer is available.
-
bestMagicPrayer
public Prayer.Prayers bestMagicPrayer()
Determines the best magic prayer available to the player based on their Prayer and Defence levels and unlock status of Augury.- Returns:
- the best magic prayer, or null if no suitable prayer is available.
-
-