Here’s an implementation:
[code]Include Default Messages by David Fisher.
A computer is a kind of device.
Include (- has talkable, -) when defining a computer.
Checking for mail is an action applying to nothing.
Understand “mail” as checking for mail.
Check an actor checking for mail:
unless the actor is a computer, stop the action.
Carry out a computer checking for mail:
say “‘You have no messages.’”
Displaying the calendar is an action applying to nothing.
Understand “calendar” as displaying the calendar.
Check an actor displaying the calendar:
unless the actor is a computer, stop the action.
Carry out a computer displaying the calendar:
say “‘No appointments today.’”;
Checking for mail is doing computer stuff. Displaying the calendar is doing computer stuff.
Persuasion rule for asking a computer to try doing computer stuff: persuasion succeeds.
Instead of doing computer stuff, say “That command is for computers only.”
Instead of a switched off computer (called comp) doing something:
say error message for the comp;
rule succeeds.
Asking a computer about something is computer conversation.
Telling a computer about something is computer conversation.
Asking a computer for something is computer conversation.
Instead of computer conversation, say “You can only do that to something animate.”
Instead of answering a computer that something, say error message for the noun.
To say error message for (comp - a computer):
if comp is switched on, say “‘Does not compute!’”;
otherwise say “[The comp] is currently switched off.”
Table of custom library messages (continued)
Message Id Message Text
LibMsg “[if the main object is a computer][error message for the main object][otherwise][The main object] has better things to do.[/p][end if]”
The Lab is a room. Omega is a computer in the Lab.
Test me with “take omega / omega, mail / turn on omega / omega, mail / omega, calendar / omega, sing / mail”.[/code]