dontbuzz Posted August 16, 2016 Share Posted August 16, 2016 (edited) 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 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: http://www.filedropper.com/dontbuzzkaramjalobsters_2 Update Log: Added basic anti-ban (not shown in source) - 18/08/2016 Edited August 18, 2016 by dontbuzz 2 Quote Link to comment Share on other sites More sharing options...
Aiban Posted August 16, 2016 Share Posted August 16, 2016 Thanks for the open source bro this will help loads Quote Link to comment Share on other sites More sharing options...
wadbot1 Posted August 16, 2016 Share Posted August 16, 2016 how much monies would this make per hour ? dontbuzz Quote Link to comment Share on other sites More sharing options...
dontbuzz Posted August 16, 2016 Author Share Posted August 16, 2016 how much monies would this make per hour ? dontbuzz The 07 wiki says around 39k an hour. Quote Link to comment Share on other sites More sharing options...
squxx Posted August 17, 2016 Share Posted August 17, 2016 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. Quote Link to comment Share on other sites More sharing options...
dontbuzz Posted August 17, 2016 Author Share Posted August 17, 2016 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. Quote Link to comment Share on other sites More sharing options...
squxx Posted August 17, 2016 Share Posted August 17, 2016 (edited) Judging by the code, that's exactly what's happening. good debugging skills man (y) edit: Yeah, you're right the message is being printed well the deposit box is still open. Edited August 17, 2016 by squxx Quote Link to comment Share on other sites More sharing options...
squxx Posted August 18, 2016 Share Posted August 18, 2016 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? Quote Link to comment Share on other sites More sharing options...
dontbuzz Posted August 18, 2016 Author Share Posted August 18, 2016 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... Quote Link to comment Share on other sites More sharing options...
Vodkha Posted September 7, 2016 Share Posted September 7, 2016 Gonna test this out ina few days will post my results for a 4 hour progress report Quote Link to comment Share on other sites More sharing options...
lgx Posted April 17, 2017 Share Posted April 17, 2017 (edited) reupload please, I could compile the source but I would like the compiled version for this Added basic anti-ban (not shown in source) - 18/08/2016 Edited April 20, 2017 by lgx Quote Link to comment Share on other sites More sharing options...
YuhhMauls Posted April 30, 2017 Share Posted April 30, 2017 Hey Interested In This. Quote Link to comment Share on other sites More sharing options...
geoffrey456 Posted May 2, 2017 Share Posted May 2, 2017 Well written looking into to this. Quote Link to comment Share on other sites More sharing options...
Tasemu Posted May 12, 2017 Share Posted May 12, 2017 Looks great, after reading through i believe the verify conditions for some tasks could conflict couldn't they? For example the walk to karamja and walk to deposit box verify conditions can both be true at the same time. What is stopping this? Quote Link to comment Share on other sites More sharing options...
z10n Posted May 29, 2017 Share Posted May 29, 2017 Support open source =) Quote Link to comment Share on other sites More sharing options...