Jump to content
snoots

Weird fishing bug?

Recommended Posts

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!

Link to post
Share on other sites

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
Link to post
Share on other sites
  • 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
Link to post
Share on other sites
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
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...