The client is offline due to RuneScape update. You may see instance errors but this is due to the update and not actual instance errors. This should be resolved soon. Join our Discord for more information.

Dismiss random events

  • Script Writer

    This snippet dismisses all random events. It wait's a few seconds before dismissing the NPC so it doesn't dismiss them suspiciously fast.

    Usage: Add this snippet to the onStart() method of your script in the main class.

    ScriptBlockingEvent RANDOMS = new ScriptBlockingEvent(this) {
        public boolean validate() {
            return Npcs.getNearest(npc -> npc.containsAction("Dismiss")
                    && npc.getTarget() != null
                    && npc.getTarget().equals(Players.getLocal())) != null;
        public void process() {
            Npc random = Npcs.getNearest(npc -> npc.containsAction("Dismiss")
                            && npc.getTarget() != null
                            && npc.getTarget().equals(Players.getLocal()));
            if(random != null){
                Time.sleep(1250, 3000);

  • Very nice, thank you!

  • Director

    A better way to do this would be to assign the npc to a class level field and re-use it in the execute, just so you aren't called Npcs.getNearest twice.

    Or you could always have it return true, and just return early in the execute if the npc does not exist.

  • Script Writer

    @MadDev True, I didn't like that I was calling getNearest twice either but I didn't bother changing it, i'll make some edits, test it then change the snippet

    If the blocking event always returned true, even if it returned early when null would it affect the overall efficiency of the script since a blocking event will be constantly triggered? Or is it negligible?