This version should be compatible with almost every server using OTClient.
auto(100)
connect("g_game", "onTextMessage", onTextMessage)
function onTextMessage(mode, message)
print("mode: " .. mode .. ", message: " .. message)
end