The script works by waiting for tweets directed at the bot, then checking the Twitter user’s unique ID (not their username, which can change) for an existing match in the database and creating a new user entry if not already available. For existing users, the game analyses the tweet for specific phrases based on the “room” that the player is in and the objects available in that room. If a key phrase is matched, it may set/remove flags on the user account (or shift them to a new “room”) and return with a description; precluding/required flags can alter how a transaction is processed.
The current iteration of the game is still in development, both the engine itself and the story which it weaves. A demonstration version is currently running on @140charADV, so feel free to tweet at the bot and try out a test level. If you have any problems, tweet me @adamjogrady and I can look into it for you.