Hi, I have a script, which generally works. Except when this happens:
This is the code I use:
case FISHING:
NPC fishingSpot = npcs.closest(true, 1511);
camera.toTop();
camera.moveYaw(0);
if (!myPlayer().isInteracting(fishingSpot)) {
if (fishingArea.contains(fishingSpot) && fishingArea.contains(myPlayer())) {
log("Fishing at area 1");
fishingSpot.interact("Harpoon");
sleep(random(3000));
}
else if (fishingArea.contains(fishingSpot) && !fishingArea.contains(myPlayer())) {
log("Area 1 is suitable, but not in reach. Walking there now");
getWalking().walk(fishingArea);
}
}
if (myPlayer().isInteracting(fishingSpot)) {
// Do things while waiting
}
break;
The problem is, it finds one of the spots, starts fishing, waits, then searches again, finding the other spot, and then interacting with that instead. So it is just looping, clicking at each spot every 3 seconds (the sleep timer).
How can I improve it? Any help/advice is highly appreciated!