James I's rules for behavior with ghosts

Here are James I's precepts for proper behavior when confronted with spirits. How do Hamlet's actions before the ghost measure up to these rules?

Hovv Christian men ought to behaue themselues vvhen they see spirites, and first that they ought to haue a good courage, and to be stedfast in fayth.

First we ought to be of good courage without feare, being assured & constante in true faith. --James I, iii,v, p.191.

We ought, not without greate cause, to suspecte all Spirites, and other apparitions. For albeit God dothe vse the helpe and seruice of good Angels, for the perseruation of his electe, yet notwithstanding in these our dayes they appeare vnto vs very seldome. --iii, vii, p.196.

Enter into no communication with suche spirites, neither aske them what thou must giue, or what thou must doo, or what shal happen hereafter. Aske them not who they are, or why they haue presented them selues to bee seene or hearde. For if they be good, they will lyke it well that thou wilte heare nothing but the woorde of God: but yf they be wicked, they wyll endeuour to deceyue thee with lying.  - iii,vii, p.196.

Wee must not giue eare vnto them, muche lesse ought we to coniure them to tell vs the truth. God commaunded in his lawe, (as we haue oftentymes sayde before) that no man should enquire any thing of the dead. - iii,vii, p.197.