I was wondering if I botted on an account attached to my main Battle.net account, would my main account be effected if i already had 3 warnings on the account?
Only if there is a relation between both accounts like gold trading. If you only botted on the bot account and never traded gold or used any advantage of what the bot did you are safe.
This is not 100% true. I have seen examples of players accounts being tagged and banned due to associations of IP address, PayPal Account, and Credit Card. Even though the different accounts had nothing to do with each other in terms of trading items or gold. Also... to the OP: No one but Blizzard knows exactly how they catch and ban accounts. If we knew these answers, we wouldn't be getting banned.