It's really complicated to code a bot that avoids ranged attacks that isn't avoidance-spells. There's too much information at once if you'd avoid everything, the bot wouldn't ever attack. I'd love to get a really good wizard bot going, but it just doesn't seem viable TBH. Rolling a tanky class is the way to bot sadly.