I am afraid you are showing signs of addiction to internet and computer based technology. You need to take professional help to get out of this situation and get back to your earlier scholastic performance.
Please do not be worried as there are many people in your age group who are having the same problem, but as you are unable to restrict yourself and want to prevent further dropping of grades at school, I would suggest you to consult a Psychiatrist
who could provide you treatment options to come out of this addiction.
Please share your problem with you parents and they can help you out by fixing an appointment.
Hope this helps.