GiveToAskFor
[Previous] [Main]

GiveToAskFor provides, in a somewhat limited way, the means to translate commands like:

>bob, give me the gold

into

>ask bob for the gold

It does this by defining a StringPreparser that simply looks for input of the form "X, GIVE ME Y" and transforms it into "ASK X FOR Y". This may have odd effects if Y is not simply the name of an object or topic that can occur in an ASK FOR command. For example, if the player typed:

>bob, give me the coin, then go north

The input would be translated into

>ask bob for the coin, then go north

Which would not mean the same thing. The moral is that the mechanism this module employs is somewhat fragile, and should be used only at your risk.

To use GiveToAskFor simply include GiveToAskFor.t in the list of source files in your project makefile.