automatism

/ɔˈtɑməˌtɪzəm/
/əˈtɑməˌtɪzəm/

noun

The performance of actions without conscious thought or intention.

diabetic patients who commit crimes while hypoglycemic may be able to plead automatism