Class Prayer
java.lang.Object
privbot.hooks.Prayer
Prayer activation, deactivation, and state checks. When the prayer interaction helper and
ClientThread are provided (via PrivContext), toggles use the same
prayer-tab and Orion mouse-handler paths as the manual click; otherwise falls back to
a raw menu dispatch.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich prayer book the prayer tab has mounted, asmountedBook()reads it. -
Method Summary
Modifier and TypeMethodDescriptionbooleanActivates the prayer with this in-game name ("Protect from Melee") if it is not already active.booleandeactivate(String name) Deactivates the prayer with this in-game name if it is currently active.booleanFlicks the prayer with this in-game name: activates it, then deactivates it on the same tick, with no sleep between the two.booleanWhether the prayer with this in-game name is active; false also for an unknown name and when unreadable (useobservedActive(String)for decisions).booleanWhether quick prayers are on: the client's quick-prayer flag where it can be read (Impact, Elorin, SpawnPK), varbitQUICK_PRAYER_VARBITon Orion.The prayer book the client has mounted:Prayer.Book.CURSESorPrayer.Book.NORMALwhere the client says which book its prayer tab shows (Elorin),Prayer.Book.UNKNOWNwhen it cannot be read and on every other server.observedActive(String name) Whether the prayer with this in-game name ("Protect from Melee") is on, with "cannot tell" kept apart:isActive(String)answers false for that, and a guard that re-toggles a prayer it cannot read turns it OFF.Whether quick prayers are on, or UNREADABLE whereisQuickPrayersActive()would log UNSUPPORTED and answer false (this client's quick-prayer flag cannot be read, or Orion's varbit could not be read).booleansetQuickPrayers(boolean on) Turn quick prayers on or off, clicking the orb only when the current state disagrees.booleanSends a toggle for the prayer with this in-game name, whatever its current state.booleanClick the quick-prayer orb once, the way this server's own orb click is sent.
-
Method Details
-
isQuickPrayersActive
public boolean isQuickPrayersActive()Whether quick prayers are on: the client's quick-prayer flag where it can be read (Impact, Elorin, SpawnPK), varbitQUICK_PRAYER_VARBITon Orion. -
toggleQuickPrayers
public boolean toggleQuickPrayers()Click the quick-prayer orb once, the way this server's own orb click is sent. -
setQuickPrayers
public boolean setQuickPrayers(boolean on) Turn quick prayers on or off, clicking the orb only when the current state disagrees. -
activate
Activates the prayer with this in-game name ("Protect from Melee") if it is not already active.- Parameters:
name- the prayer's in-game name- Returns:
- false for an unknown name (logged); true once the activation was handed on
-
deactivate
Deactivates the prayer with this in-game name if it is currently active.- Parameters:
name- the prayer's in-game name- Returns:
- false for an unknown name (logged); true once the deactivation was handed on
-
toggle
Sends a toggle for the prayer with this in-game name, whatever its current state. Preferactivate(String)/deactivate(String)for state-aware control.- Parameters:
name- the prayer's in-game name- Returns:
- false for an unknown name (logged)
-
flick
Flicks the prayer with this in-game name: activates it, then deactivates it on the same tick, with no sleep between the two.- Parameters:
name- the prayer's in-game name- Returns:
- false for an unknown name (logged)
-
mountedBook
The prayer book the client has mounted:Prayer.Book.CURSESorPrayer.Book.NORMALwhere the client says which book its prayer tab shows (Elorin),Prayer.Book.UNKNOWNwhen it cannot be read and on every other server. Pick the prayer name by the book ("Deflect Magic" on curses, "Protect from Magic" otherwise) and hold the switch on UNKNOWN: a guessed book clicks buttons that are not drawn.- Returns:
- the mounted book, never null
-
isActive
Whether the prayer with this in-game name is active; false also for an unknown name and when unreadable (useobservedActive(String)for decisions).- Parameters:
name- the prayer's in-game name- Returns:
- whether it reads active
-
observedActive
Whether the prayer with this in-game name ("Protect from Melee") is on, with "cannot tell" kept apart:isActive(String)answers false for that, and a guard that re-toggles a prayer it cannot read turns it OFF.- Parameters:
name- the prayer's in-game name- Returns:
- TRUE / FALSE, or UNREADABLE (also for an unknown name)
-
observedQuickPrayersActive
Whether quick prayers are on, or UNREADABLE whereisQuickPrayersActive()would log UNSUPPORTED and answer false (this client's quick-prayer flag cannot be read, or Orion's varbit could not be read).- Returns:
- TRUE / FALSE, or UNREADABLE
-