Just click.
The script for the AI was all done by me. The AI looks 4 moves ahead and chooses moves which connect the most of its pieces while blocking the most of its opponents pieces. The AI is not perfect, but still plays well.