It is a simple finite-state machine written in lua.