Jump to content

Open AFK Splasher | Free & Open Source


Eliot

Recommended Posts

Open AFK Splasher by Eliot

What:

  • It splashes autocast spells
  • Moves mouse to prevent your character from not retaliating
  • Logs back in and attacks NPC after being logged out by 6 hour timer

How:

  1. Have at least -65 magic bonus & have an autocast spell selected
  2. Attack the NPC you wish to splash on (suggestion: spiders, chickens)
  3. Start script

Why:

  • Splashing requires very few interactions with the client, drastically decreasing the chance of being banned.

Source:

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

@ScriptManifest(name = "Open AFK Splasher", author = "Eliot", version = 1.0, info = "", logo = "")

public class Splasher extends Script {
  private long startTime;
  private String npcName = null;
  private String state = "Initializing";
  private Font font = new Font("Arial", Font.BOLD, 14);

  /**
   * Formats time ran into a human readable String
   * @param time the time in ms to be converted
   * @return (Human readable) how long the script has been running
   */
  public final String formatTime(final long time) {
    long s = time / 1000, m = s / 60, h = m / 60;
    s %= 60; m %= 60; h %= 24;
    return String.format("%02d:%02d:%02d", h, m, s);
  }

  @Override
  public void onStart() {
    startTime = System.currentTimeMillis();
    getExperienceTracker().start(Skill.MAGIC);
  }

  @Override
  public int onLoop() throws InterruptedException {
    if (npcName == null && myPlayer().getInteracting() != null) {
      npcName = myPlayer().getInteracting().getName();
    } else if (npcName != null && myPlayer().getInteracting() == null) {
      state = "Attacking " + npcName;
      NPC attack = getNpcs().closest(npc -> npc.getName().equals(npcName) && npc.getInteracting() == null);
      if (attack != null && attack.interact("Attack")) {
        new ConditionalSleep(5000) {
          @Override
          public boolean condition() throws InterruptedException {
            return myPlayer().isUnderAttack();
          }
        }.sleep();
      }
    } else if (npcName != null) {
      state = "Preventing AFK timer";
      if (mouse.click(random(556, 730), random(220, 450), false)) {
        int randomTime = random(180000, 1080000);
        state = "Sleeping (for " + formatTime(randomTime) + ")";
        new ConditionalSleep(randomTime) {
          @Override
          public boolean condition() throws InterruptedException {
            return myPlayer().getInteracting() == null;
          }
        }.sleep();
      }
    } else {
      state = "YOU MUST ATTACK SOMETHING MANUALLY";
    }
    return 100;
  }

  @Override
  public void onPaint(Graphics2D g) {
    Point mP = getMouse().getPosition();
    long runTime = System.currentTimeMillis() - startTime;
    g.setColor(Color.white);
    g.setFont(font);
    g.drawLine(mP.x, 501, mP.x, 0);
    g.drawLine(0, mP.y, 764, mP.y);
    g.drawString("State: " + state, 10, 210);
    g.drawString("Target: " + (npcName == null ? "????" : npcName), 10, 230);
    g.drawString("XP Gained: "+ getExperienceTracker().getGainedXP(Skill.MAGIC), 10, 250);
    g.drawString("XP / HR: "+ getExperienceTracker().getGainedXPPerHour(Skill.MAGIC), 10, 270);
    g.drawString("Time to LVL: "+ formatTime(getExperienceTracker().getTimeToLevel(Skill.MAGIC)), 10, 290);
    g.drawString("Time Ran: "+ formatTime(runTime), 10, 310);
  }
}

I suggest compiling on your own, but if you'd rather download a jar click here.

 

Credits:
Some aspects of this script were taken from @Mumble's script: https://osbot.org/forum/topic/116394-mumbles-ez-afk-splasher/

 

 

Find a bug? Report it in this thread.

Edited by Eliot
  • Like 10
Link to comment
Share on other sites

1 hour ago, Turkoize said:

:gnome:TFW I finally thought you released your alcher. 

But I'm probably gonna use this :P Thanks hombre. 

Hah, maybe someday.

1 hour ago, Botre said:

 50 * new font / second

:boge:

:troll: fixed

1 hour ago, Mumble said:

Great work, and thanks for giving me credit! (some people wouldn't)

Np.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 4 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...