Here's an easy snippet to add to your AutoIT script so it will stop your bot if you get kicked to the docks.
This assumes 1900x1200 resolution. I can add coordinates for other resolutions if needed.
As an example I'll use @
nunya 's bot which stops itself with the END key, though this could be easily modified to work with whatever you are using.
Add this code somewhere in the loop. I put it after the level skip section because that seems to be where I get kicked most.
This looks to see if the Avatar icon is lit (bottom right corner) which only happens in town.
A variation of this can be used to bot quests with multiple boss levels. I've made a couple for Formorian Base locations, but Sewers is problematic because of ladder sticking.