This was a small experiment in delivering fiction through a simulated chat interface. There are two characters, both with pre-scripted dialog. The user takes on one of the roles, with the other being automated.
The automated character “types” messages by waiting a set amount of time between adding lines of text, with the specific amount of time being a function of the number of characters in that line. Once the automated character has typed a line, control switches back to the user. Each keypress on the keyboard adds a letter to a simulated text entry field, with the letters coming from the script. Once the user has “typed” all of the letters for a given line, it is added to the ongoing dialog (as if they had pressed the enter key), and control switches back to the simulated character.
Check it out here.