The mechanism I designed works and I can add various types of behaviour but the slightest omission in my thinking and the Bot does something peculiar or just stands there.
I'm adding more and more detailed debug information to help work out what situations trigger what responses from the Bots.
I've spent a lot of time with paper, pencil and eraser sketching out charts similar to the following:
Then coding those and now trying to fill in the gaps that testing has highlighted as problems.
It is very frustrating at the moment but I am sure it will be worth it in the end.