Kushitious Posted May 17, 2020 Posted May 17, 2020 Bot will walk to fishing area and i manually start fishing and get full invent it will bank but wont start fishing itself Code to start Fishing private void StartFishing() throws InterruptedException { Entity FISH = objects.closest("Rod Fishing spot"); if(FISHAREA.contains(myPlayer())){ if (FISH != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) { FISH.interact("Bait"); new ConditionalSleep(Script.random(10000, 15000)) { public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); } } }
Camaro Posted May 17, 2020 Posted May 17, 2020 Fishing spots are actually NPCs, try that instead and see if its fixed 2
Lol_marcus Posted May 17, 2020 Posted May 17, 2020 I actually made on today too! ^^ Take a look at my code and compare it to yours, see how alike they are. I left out the onstart and onpaint, those won't matter too much. @Override public int onLoop() throws InterruptedException { if (canFish()) { Fish(); } else { drop(); } return 700; } public boolean canFish() { return (getInventory().contains("Fly fishing rod", "Feather") && (!getInventory().isFull())); } private void drop() throws InterruptedException { if (getInventory().isFull()) { getInventory().dropAllExcept("Fly fishing rod", "Feather"); sleep(random(50, 105)); new ConditionalSleep(5000, 600) { @Override public boolean condition() { return (getInventory().isEmptyExcept("Fly fishing rod", "Feather")); } }.sleep(); } else { stop(false); } } public void Fish() throws InterruptedException { NPC spot = getNpcs().closest("Rod fishing spot"); if ((!myPlayer().isAnimating()) && spot != null) { spot.interact("Lure"); sleep(random(100, 200)); getMouse().moveOutsideScreen(); sleep(random(4000, 5000)); } new ConditionalSleep(10000, 200) { @Override public boolean condition() { return ((!myPlayer().isAnimating()) && (spot != null)); } }.sleep(); } 1
Kushitious Posted May 17, 2020 Author Posted May 17, 2020 5 minutes ago, Camaro said: Fishing spots are actually NPCs, try that instead and see if its fixed Lmao that worked. Thank you! it does spam the action until the animation starts. would i fix this with a sleep?
Camaro Posted May 17, 2020 Posted May 17, 2020 5 minutes ago, Kushitious said: Lmao that worked. Thank you! it does spam the action until the animation starts. would i fix this with a sleep? new ConditionalSleep(Script.random(10000, 15000)) { public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); <-- take the exclamation point away } }.sleep(); And you should be good! 1
Kushitious Posted May 17, 2020 Author Posted May 17, 2020 2 minutes ago, Camaro said: new ConditionalSleep(Script.random(10000, 15000)) { public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); <-- take the exclamation point away } }.sleep(); And you should be good! AH i had the ! there still. Thanks loads for the help! 1
Camaro Posted May 17, 2020 Posted May 17, 2020 15 minutes ago, Kushitious said: AH i had the ! there still. Thanks loads for the help! Last thing, you should only sleep if the interact was successful if (FISH.interact("Bait")) { new ConditionalSleep(Script.random(10000, 15000)) { public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); } 1