Jump to content

[FREE] dontbuzz Karamja Lobsters (Deposit Box Banking) [OPEN SOURCE]


dontbuzz

Recommended Posts

dontbuzz Karamja Lobsters

 

Instructions:

(40 Fishing Needed)

 

Start anywhere with enough Coins(recommended 5k+) and Lobster Cage in inventory.

 

BOT AT YOUR OWN RISK OF BAN

 

65e4276adcedc0a0a10795ab2baef3f0.png

 

Features

- Fishes Lobster on Karamja Island

- Banks at Port Sarrim Deposit Box

- Stops when out of coins  (Will fix this later on, please bring more than enough coins for your desired amount of lobster)

 

Thanks to @Explv for the Dank Paint Tutorial and @Eliot for the Task Class.

 

Am still learning to script, constructive criticism is appreciated.

 

Source:

 

Task Class

import org.osbot.rs07.script.Script;

public abstract class Task {
    // The script instance
    protected Script script;

    public Task(Script script) {
        this.script = script;
    }

    /**
     * @return if this Task should execute.
     */
    public abstract boolean verify();

    /**
     * Executes this Task.
     *
     * @return sleep time after this task ends.
     */
    public abstract int execute();

    /**
     * @return a description of the current Task.
     */
    public abstract String describe();
} 

DontbuzzF2PLobster

import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

@ScriptManifest(author = "Dontbuzz", name = "Dontbuzz Karamja Lobster", version = 1.0, logo = "", info = "Fishes for Lobster on Karamja, banking at Port Sarrim deposit box")
public class DontbuzzF2PLobster extends Script {

    
    private int lobsterCaught;
    private int fishExpGained;
    private long startTime;


    private ArrayList<Task> tasks = new ArrayList<>();


    @[member='Override']
    public void onStart() {

        log("Script Started");

        getExperienceTracker().start(Skill.FISHING);
        startTime = System.currentTimeMillis();

        tasks.add(new BankTask(this));
        tasks.add(new WalkToKaramjaTask(this));
        tasks.add(new FishTask(this));
        tasks.add(new ImFishingTask(this));


    }

    @[member='Override']
    public int onLoop() throws InterruptedException {
        for (Task task : tasks) {
            if (task.verify())
                return task.execute();
        }
        return random(600, 1800);
    }


    public void onPaint(Graphics2D g) {
        g.setColor(Color.MAGENTA);
        g.drawString("dontbuzz Karamja Lobster", 10, 40);

        fishExpGained = getExperienceTracker().getGainedXP(Skill.FISHING);
        g.setColor(Color.black);
        g.drawString("Fishing Exp Gained: " + fishExpGained, 10, 55);

        lobsterCaught = fishExpGained / 90;
        g.drawString("Lobster Caught: " + lobsterCaught, 10, 70);

        final long runTime = System.currentTimeMillis() - startTime;
        g.drawString("Time Running " + formatTime(runTime), 10, 85);


    }

    public final String formatTime(final long ms){
        long s = ms / 1000, m = s / 60, h = m / 60;
        s %= 60; m %= 60; h %= 24;
        return String.format("%02d:%02d:%02d", h, m, s);
    }
}

 

BankTask

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.utility.ConditionalSleep;

import static org.osbot.rs07.script.MethodProvider.random;

/**
 * Created by tek on 8/14/2016.
 */
public class BankTask extends Task {

    private Area depositBoxArea = new Area(3043, 3237, 3052, 3234);



    public BankTask(Script script) {
        super(script);
    }

    @[member='Override']
    public boolean verify() {
        return script.inventory.isFull();
    }

    @[member='Override']
    public int execute() {
        script.log("Depositing Lobster");

        if (!depositBoxArea.contains(script.myPlayer())) {

            script.getWalking().webWalk(depositBoxArea);
        }
        if (script.getDepositBox().isOpen()) {
            if (script.getInventory().contains("Raw lobster")) {
                script.depositBox.depositAllExcept("Lobster pot", "Coins");
                new ConditionalSleep(3000,5000) {
                    @[member='Override']
                    public boolean condition() throws InterruptedException {
                        return !script.inventory.contains("Raw lobster");

                    }
                }.sleep();

            }
        } else {
            Entity depositBooth = script.getObjects().closest("Bank deposit box");
            if (depositBooth != null) {
                script.depositBox.open();
                return random(300,800);
            }
        }

        return random(300,400);
    }

    @[member='Override']
    public String describe() {
        return "Depositing Lobster";
    }
}


 

WalkToKaramjaTask

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.Script;

import static org.osbot.rs07.script.MethodProvider.random;

/**import org.osbot.rs07.api.map.Area;
 import org.osbot.rs07.api.map.constants.Banks;
 import org.osbot.rs07.api.model.Entity;
 import org.osbot.rs07.api.model.NPC;
 import org.osbot.rs07.script.Script;
 import org.osbot.rs07.utility.ConditionalSleep;

 import static org.osbot.rs07.script.MethodProvider.random;

 /**
 * Created by tek on 8/14/2016.
 */
public class WalkToKaramjaTask extends Task {

    private Area karamjaLobsterSpot = new Area(2919, 3183, 2930, 3174);


    public WalkToKaramjaTask(Script script) {
        super(script);
    }

    @[member='Override']
    public boolean verify() {
        return  !karamjaLobsterSpot.contains(script.myPlayer());
    }

    @[member='Override']
    public int execute() {

        script.log("Walking to Karamja fishing Spot");

        script.getWalking().webWalk(karamjaLobsterSpot);





        return random(300,1200);
    }

    @[member='Override']
    public String describe() {
        return "Walking to Karamja fishing Spot";
    }
}


 

FishTask

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.utility.ConditionalSleep;

import static org.osbot.rs07.script.MethodProvider.random;

/**import org.osbot.rs07.api.map.Area;
 import org.osbot.rs07.api.map.constants.Banks;
 import org.osbot.rs07.api.model.Entity;
 import org.osbot.rs07.api.model.NPC;
 import org.osbot.rs07.script.Script;
 import org.osbot.rs07.utility.ConditionalSleep;

 import static org.osbot.rs07.script.MethodProvider.random;

 /**
 * Created by tek on 8/14/2016.
 */
public class FishTask extends Task {





    public FishTask(Script script) {
        super(script);
    }

    @[member='Override']
    public boolean verify() {
        return  !script.myPlayer().isAnimating() && !script.inventory.isFull();
    }

    @[member='Override']
    public int execute() {
        script.log("Finding New Lobster Spot");

        NPC fishSpot = script.getNpcs().closest(1522);


        if (fishSpot != null && !script.myPlayer().isAnimating()){
            fishSpot.interact("Cage");
            new ConditionalSleep(5000) {
                @[member='Override']
                public boolean condition() throws InterruptedException {
                    return script.myPlayer().isAnimating();

                }
            }.sleep();

        }


        return random(300,1200);
    }

    @[member='Override']
    public String describe() {
        return "Fishing Lobster Bro";
    }
}


 

ImFishingTask

import org.osbot.rs07.script.Script;

import static org.osbot.rs07.script.MethodProvider.random;

/**import org.osbot.rs07.api.map.Area;
 import org.osbot.rs07.api.map.constants.Banks;
 import org.osbot.rs07.api.model.Entity;
 import org.osbot.rs07.api.model.NPC;
 import org.osbot.rs07.script.Script;
 import org.osbot.rs07.utility.ConditionalSleep;

 import static org.osbot.rs07.script.MethodProvider.random;

 /**
 * Created by tek on 8/14/2016.
 */
public class ImFishingTask extends Task {





    public ImFishingTask(Script script) {
        super(script);
    }

    @[member='Override']
    public boolean verify() {
        return  script.myPlayer().isAnimating() && !script.inventory.isFull();
    }

    @[member='Override']
    public int execute() {
        script.log("Fishing.............");

        return random(2000,4200);
    }

    @[member='Override']
    public String describe() {
        return "Im Fishing.....";
    }
}


 

 

 

Download JAR: 

 

 

Update Log:

 

Added basic anti-ban (not shown in source) - 18/08/2016

 

 

 

 

 

Edited by dontbuzz
  • Like 2
Link to comment
Share on other sites

Good release! clean code aswell, very good! I've tested the script, it fishes and walks fine, however once i bank my raw lobsters it says low coins and ends. which is very bizzare as i have 5k and i can see in the code up there that it should only do that if i have less than 60 gp. very odd. i just commented those lines out re-jarred it, and it's working fine. i don't know why it was happening.

Link to comment
Share on other sites

Good release! clean code aswell, very good! I've tested the script, it fishes and walks fine, however once i bank my raw lobsters it says low coins and ends. which is very bizzare as i have 5k and i can see in the code up there that it should only do that if i have less than 60 gp. very odd. i just commented those lines out re-jarred it, and it's working fine. i don't know why it was happening.

 

Thank you for the feedback! I've removed the stopping when out of coins option for now and have re-uploaded the jar.

 

I think the check for more than 60gp in inventory was being done whilst the deposit box is still up or something along those lines. Probably causing the weird behavior (it cannot properly check the inventory for the item i guess).

 

I'll fix it up after my basketball game tonight.

 

Cheers.

Link to comment
Share on other sites

Ended up getting banned well i was testing script with some adjustments, rofl gg. what's the ban rate using mirror? is it much better?

 

Haven't tested OSBOT mirror mode tbh.

 

The account I made the script on also got banned but i thought that could of been from the 10hrs of shrimp fishing I done the night before haha.

 

I added in some basic anti-ban and re-uploaded the Jar to hopefully reduce ban rates...

Link to comment
Share on other sites

  • 3 weeks later...
  • 7 months later...
  • 2 weeks later...
  • 2 weeks later...
  • 3 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...