Jump to content

Weird fishing bug?


Recommended Posts

Posted

Hey guys, so I've been trying to make a fishing bot recently and I keep getting a weird bug.
Usually when you fish using a small fishing net, the player casts the fishing net and doesn't stop fishing until the inventory is full or until there is no more fish.

But my bot instead casts the fishing net, fishes for 10 seconds and then the animation stops.
Does anyone have any idea why my player animation stops after 10 seconds?

No, my bot doesn't click on the fishing spot after 10 seconds, the conditional sleep makes it so the bot waits for the animation to stop, or clicks on the fishing spot every 4 minutes.

here is my code:
image.png.373c0338abfeb68f711aee6808b2dbcc.png

Thanks in advance!

Posted

Animations reset after a couple seconds so the !isAnimating() will return true and stop the conditionalsleep. Do getInteracting() != null instead of isAnimating and fish exists, should work better. Will trigger sometimes on dialogue (level-up) so be sure to check getDialogues().inDialogue() too

  • Like 1
  • Heart 1
Posted (edited)
  • Didn't nullcheck fishing spot
  • You can check !myPlayer().isAnimating() before fishing
  • Don't need to have the condition on the else if statement because you already check it with the first condition.
  • conditional sleeps that last 250_000 is generally bad practice. I'd do 10-20 seconds max.
  • To clean up your sleep you can check out the ConditionalSleep2 class https://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep2.html
Edited by Malcolm
  • Like 1
  • Heart 1
Posted
4 hours ago, Malcolm said:
  • Didn't nullcheck fishing spot
  • You can check !myPlayer().isAnimating() before fishing
  • Don't need to have the condition on the else if statement because you already check it with the first condition.
  • conditional sleeps that last 250_000 is generally bad practice. I'd do 10-20 seconds max.
  • To clean up your sleep you can check out the ConditionalSleep2 class https://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep2.html

 

5 hours ago, Czar said:

Animations reset after a couple seconds so the !isAnimating() will return true and stop the conditionalsleep. Do getInteracting() != null instead of isAnimating and fish exists, should work better. Will trigger sometimes on dialogue (level-up) so be sure to check getDialogues().inDialogue() too

Thank you fellas

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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