Lol_marcus Posted June 27 Share Posted June 27 (edited) Hi, I've been meaning to write this for a while now and have always gotten carried away with other projects. To set up, just select your quick prayers, and the script will do the rest. It activates your quick prayers, then identifies the game's tick, and then double clicks in a loop every time the tick changes (I've left a random wait in the middle, feel free to remove or adjust if you'd like). Hope you enjoy! Spoiler package Osbot; import java.awt.Color; import java.awt.Graphics2D; import org.osbot.rs07.listener.GameTickListener; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.ui.PrayerButton; @ScriptManifest(author = "LolMarcus", name = "Prayer Flicker", info = "Flicks the quick prayers.", version = 1.0, logo = "") public class prayerFlick extends Script implements GameTickListener { private int tickCount = 0; private int previousTickCount = 0; @Override public void onStart() { if (!isOverheadPrayerActive()){ getPrayer().setQuickPrayer(true); log("Starting PrayerFlicking script..."); getBot().addGameTickListener(this); } } @Override public void onGameTick() { tickCount++; log("Game tick: " + tickCount); } @Override public int onLoop() throws InterruptedException { if (!isOverheadPrayerActive()){ getPrayer().setQuickPrayer(true); }else if (tickCount != previousTickCount) { getMouse().click(false); sleep(random(0, 5)); getMouse().click(false); previousTickCount = tickCount; } return random(100, 200); } @Override public void onPaint(Graphics2D g) { g.setColor(Color.WHITE); g.drawString("Game Ticks: " + tickCount, 10, 50); } @Override public void onExit() { log("Stopping PrayerFlicking script..."); getBot().removeGameTickListener(this); } private boolean isOverheadPrayerActive() { return getPrayer().isActivated(PrayerButton.PROTECT_FROM_MAGIC) || getPrayer().isActivated(PrayerButton.PROTECT_FROM_MISSILES) || getPrayer().isActivated(PrayerButton.PROTECT_FROM_MELEE) || getPrayer().isActivated(PrayerButton.RETRIBUTION) || getPrayer().isActivated(PrayerButton.REDEMPTION) || getPrayer().isActivated(PrayerButton.SMITE); } } Edited June 27 by Lol_marcus Refined code. 2 Quote Link to comment Share on other sites More sharing options...
Czar Posted June 27 Share Posted June 27 Nice! 1 Quote Link to comment Share on other sites More sharing options...