Hello Allegra 50 and welcome.
Let's tackle each problem separately as I don't think they are related to each other.
When it comes to a laptop restarting and seemingly random times, it's for a reason. In most cases, Windows created a BSOD error and restarted. To find out if this is TRUELY the case, when your HP logo appears when the computer is booting, press F8 repeatedly until you receive a menu of options. One of those options should relate to disabling "automatic restart" or something to that effect. If the machine "blue-screen's", read some helpful hints here: http://www.sevenforums.com/crashes-d...tructions.html
in order to better help us by getting all the information about the problem as possible.
In regards to this script message, in what program are you getting this error in? What are you doing when this error appears?
Also, please share with the class your HP's model number so we get a better idea of what we're looking that.