FYI. I'm still playing with this. I've learned a few things that don't work as well as I'd like but nothing to submit for review, other testing or just commit because I'm awesome and never make judgements that turn out to be suboptimal.
There are ways to speed that up, but the false positives vs false negatives tradeoff is what bothers me enough to give up.Update. Not likely to happen. On my machine the processing time to record visited URLs and then look for x repetitions of a sequence of length y effectively doubled the wall clock time KoLmafia used while auto-adventuring. My motivation to profile or look for alternatives has evaporated
Also good luck setting an appropriate threshold that won't hit legitmate adventuring a few ms from the server, but will hit looping on the other side of the planet.