Prayer Flick Helper
AdvancedUtilityHelps with prayer flicking by showing optimal timing. Demonstrates prayer point monitoring and timing calculations.
18 min read
What It Does
Helps with prayer flicking by showing optimal timing. Demonstrates prayer point monitoring and timing calculations.
Source Code
java
1package com.example;
2
3import net.runelite.api.Client;
4import net.runelite.api.Skill;
5import net.runelite.api.events.GameTick;
6import net.runelite.client.eventbus.Subscribe;
7import net.runelite.client.plugins.Plugin;
8import net.runelite.client.plugins.PluginDescriptor;
9import net.runelite.client.ui.overlay.Overlay;
10import net.runelite.client.ui.overlay.OverlayManager;
11import javax.inject.Inject;
12import java.awt.*;
13
14@PluginDescriptor(
15 name = "Prayer Flick Helper",
16 description = "Helps with prayer flicking"
17)
18public class PrayerFlickPlugin extends Plugin {
19 @Inject
20 private Client client;
21
22 @Inject
23 private OverlayManager overlayManager;
24
25 private int lastPrayerLevel = 0;
26 private boolean prayerOn = false;
27
28 @Subscribe
29 public void onGameTick(GameTick event) {
30 int currentPrayer = client.getBoostedSkillLevel(Skill.PRAYER);
31
32 if (currentPrayer < lastPrayerLevel) {
33 prayerOn = true; // Prayer is draining
34 } else if (currentPrayer == lastPrayerLevel && prayerOn) {
35 prayerOn = false; // Prayer stopped draining
36 }
37
38 lastPrayerLevel = currentPrayer;
39 }
40
41 private final Overlay overlay = new Overlay() {
42 @Override
43 public Dimension render(Graphics2D graphics) {
44 graphics.setColor(prayerOn ? Color.GREEN : Color.RED);
45 graphics.drawString("Prayer: " + (prayerOn ? "ON" : "OFF"), 10, 10);
46 return new Dimension(120, 20);
47 }
48 };
49
50 @Override
51 protected void startUp() {
52 overlayManager.add(overlay);
53 }
54
55 @Override
56 protected void shutDown() {
57 overlayManager.remove(overlay);
58 }
59}Code Annotations
Line 25
Track prayer level changes
Line 28
Detect prayer drain
Line 31
Detect when prayer stops