The script always tries to get the darkbook if you don't have the skill yet. As lostcalpolydude pointed out, if you perm it once, you'll never need to find it again. As such, it's worth it to save turns and effort the next 5 times. No trading, so if you're going to get it, it's going to be from farming for it...
If you decide you don't care, and you've already got 7 clues learned, you can solve those by running:
ash import <TheSea.ash> solveHatred(true);
This will try to guess what the 8th clue is, regardless of which is the missing one. It will burn the extra 2 adventures on a wrong guess in the knob treasury for quick and lazy slight-meat-and-super-rare-chance.
If you don't want it to guess for you, just change that to solveHatred(false) and it won't guess.
If you want it to auto-buy the extra-strength red potion, red potion, red pixel potion, filthy poultice, gauze garter, scented massage oil, mer-kin mouthsoap, sea lasso, and 3 mer-kin prayerbeads, auto-equip the vestments, 3 prayerbeads, and maximize for -1000 hp, mainstat, and 100 elemental damage, and get you far enough in the fight so that you should just be able to attack for victory...
ash import <TheSea.ash> prepHatred();