You might take a look at:
https://steemit.com/steem-engine/@inertia/the-stingy-oracle-goes-open-source
That will only help you work out distribution. It doesn't follow commands. To figure out commands, you can look at:
https://steemit.com/radiator/@inertia/freakazoid-cleverbot-integration-for-steem
Thanks for the direction. This is noted. I'm also looking at holger80's implementation. It's in Python.