I’m sorry to hear that you got banned.
Botting will always run a risk of a ban. Sometimes people bot longer than others before they’re banned. I have had some good success running this script without a ban.
There are many factors that come to play with bans.
IP (is it a data centre, or recycled proxy?)
P2P vs F2P. F2P bots get caught much more often than P2P.
Account life. Is it a new account?
There are many more variables that come into play.