I managed to actually see how the bug happens. It's when the script logs in and a crab is already attacking you. I guess that is the same problem with the rock crab scrip and there is yet no solution for this.
Been using this for a few days now. I have died a few times because sometimes two crabs are attacking me and the bot will not bug out and switch between the two crabs but not attacking either of them.