snoots Posted March 27, 2021 Share Posted March 27, 2021 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: Thanks in advance! Quote Link to comment Share on other sites More sharing options...
Czar Posted March 28, 2021 Share Posted March 28, 2021 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 1 1 Quote Link to comment Share on other sites More sharing options...
Malcolm Posted March 28, 2021 Share Posted March 28, 2021 (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 March 28, 2021 by Malcolm 1 1 Quote Link to comment Share on other sites More sharing options...
snoots Posted March 28, 2021 Author Share Posted March 28, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
Gunman Posted March 28, 2021 Share Posted March 28, 2021 59 minutes ago, snoots said: Thank you fellas Don't take shit from them script kiddos smh 2 Quote Link to comment Share on other sites More sharing options...