Great , I'm Zek I know only Java , Html , JavaScript , I know python but not properly , you can make a AI system through variables , Like
onclick move-right
var move = 1
if move == 1
then
Code For moving your Object
onclick move-left
var move =2
if move == 2
Code for moving your Object
Sorry for coding Roughly