Bringing any kind of drug (legal of not) into school will get you into trouble unless you have written permission from a doctor to have it on you.

I used to buy caffine pill's when I was younger but not from drug store's (I used to get them from supermarket's ect) and I live in the UK so maybe it differant elsewhere.

I wouldn't advise overdoing the caffiene though it's addictive and really bad for your heart lol.