'Amok' is a Malay word meaning to run out of control. In English, particularly in Hardy's day, it described people seizing weapons and attacking others indiscriminately while in the grip of a strong emotion. No one is quite sure why the word should have come into existence in Malaysia, but W. W. Skeat's entry in the 1911 Encyclopedia Britannica gives a hint:
A Malay will suddenly and apparently without reason rush into the street armed with a kris or other weapons, and slash and cut at everybody he meets till he is killed. These frenzies were formerly regarded as due to sudden insanity. It is now, however, certain that the typical amok is the result of circumstances, such as domestic jealousy or gambling losses, which render a Malay desperate and weary of his life. It is, in fact, the Malay equivalent of suicide. The act of running amuck is probably due to causes over which the culprit has some amount of control, as the custom has now died out in the British possessions in the peninsula, the offenders probably objecting to being caught and tried in cold blood.