Loose everything and feeling lost

i know i describe a little long but please read feel like i loose every thing and nothing can happen now.plz give suggestions if they can help.

i entered in my Engineering college a very prestigious college in India with a very good rank.i thought about performing extra ordinary in coding and software development .i read a lot .i didn’t have good guidelines and contacts.so i worked really hard for 2.5 year.i won a $2000 competition of android app development.My main target is to get more expoosure to various fields .perhaps there was any day when i didn’t work very hard.you can say i was concerned even for my one minute that let it not get wasted.i never study academics.in exam days ,i dont work hard for getting good marks so my marks were not good neither i cared much because i feel really very happy one of my life’s most joyfull time. when exams of 5th semester over i come to my home.i started irritating with even small disturbances.i was not able to acheive my targets which were very easily fullfilled before i started loosing focus and my mind was burnt and exhausted i cant see even computer screen after a time.i was went through drastic downfall in performance .but i never watch porn perhaps very rare around once in sixth months.whenever i started watching i can’t leave it continuously watching if i am opening facebook its giving me a little headache but still seeing the screen for long time.even when i start taking walk i walk fr many hours continuously walking even my feet tired extremely.it happed sometimes that for around 4 hours i was continuously walking in a gallery .there is weired pain in my brain,feeled like some pipeline in brain will burst and i went to a temple after returning first time such kind of pain happened in brain .i tell some people they said due to over work it happed .i leave coding for around 7-8 months i didn’t code think every thing will be all right.but same pain in various area of my head.then sixth semester over companies come for placement.i developed confidence if i hardwork as individual i can earned more than my salary but main problem was this pain.i have no knowledge of this kind of psychiatric problems.
one day i went to placement room of our college because i bored a lot in my home i replied some questions initially they asked if some one has good knowledge about tech and frameworks.i can listen but i have to concentrate a lot .some friends refer my name in room .i tell a little about previous projects and experience .i replied many answers of their question finally after 2 hours i get selected fortunately in a very good company.then i went to a psychiatrist in a goverment hospital with my friend .he asked several questions i replied he gave clofranil 25 mg i took and when i took i fell slept for around 22 hours once my mother gave me food in between.i took medicine for 3 days but due to such oversleeping i didn’t took later.i went to psychiatrist after 7 days then he told yes its obvious you have to adjust a little in starting.ok then and he increase the dose from clofranil from 25mg to 50mg.i slept all time after some time he sad took clofranil 75mg i took that also then i tell him i am feeling problem of constipation and oversleeping then he gave waklert 50mg two capsules in the morning .i never took that but when ever i wake i start learning code and tech. so ok i never did some thing great but learn a lot and work good.i worked on a website cloudspokes.com i always loose because of oversleeping but still i continue working on it.college come to an end but Psychiatrist treatment doesn’t complete he said it will take 8-10 months after he said two years when i was reading this forum i think its going to be for lifetime.work that i do in one day not able todo in even 4 days.i started taking wakalert.it removes oversleeeping problem. i can work but not efficiently and confidently that i did in start of 5th sem.i can’t read for even 2.5 hours even sometimes its less than 1.5 hours and previously it was around 8 hours normally .worked in the company for 2 months due to over sleeping once they warn me about sleeping in office and its also tough for me to work there(in this period i didn’t took waklert) after 2 months i resigned from my job.i started work again on cloudspokes.com again loose.even the level is nothing for submission for the project i can easily complete it.but i search a lot resources for giving it a winning project feel .so i search a lot then i fell asleep and not even submit my work and feeling discouraged and lost.what should .a shocking result of 7th sem came i get failed in 4 subjects .i am trying right now to study but not able to get that flow.thinking of quitting from every thing and all time love coding.i can even start now but if that efficiency possible.please some one guideline what to do.i have done a lot of partial projects and have good experience if come over these problems i can start my career again and earn a lot .according to psychiatrist i am suffering from OCP(http://en.wikipedia.org/wiki/Obsessive–compulsive_personality_disorder)

sorry the disorder name is OCD(http://en.wikipedia.org/wiki/Obsessive–compulsive_disorder)