Searched through the manual but haven't been able to figure this one
out.
TIA!
Biagio
This should do the trick for you:
<code>
"Radio Test"
after printing the name of an open container:
omit contents in listing.
Living Room is a room.
a supporter called a table is scenery in Living Room.
an open container called a radio is in Living Room.
"Your battery-operated radio sits on a table in the corner.".
the description is "The radio is switched [if radio is on]on
[otherwise]off.[end if]"
the radio is either on or off.
the radio is off.
a battery is in the radio.
instead of switching on the radio:
if the battery is in the radio begin;
now the radio is on;
say "You switch on the radio and it begins playing music from a pop
station.";
otherwise;
say "The radio has no battery in it so it remains silent.";
end if.
instead of switching off the radio:
if the radio is on and the battery is in the radio begin;
say "The radio goes silent.";
now the radio is off;
otherwise;
say "The radio is already off.";
end if.
instead of taking the battery when the radio is on:
now the battery is carried by the player;
say "You remove the battery from the radio and it goes silent.";
instead of taking the battery when the radio is off:
now the battery is carried by the player;
say "You remove the battery from the radio.".
instead of inserting the battery into the radio:
now the battery is in the radio;
if the radio is on begin;
say "You replace the battery back in the radio and it resumes
playing.";
otherwise;
say " You replace the battery back in the radio.";
end if.
<code>
It is interesting, though: I'd wondered if I simply had to avoid the
built in "device" and create an object that acted like a device minus
the reporting. Funny that there doesn't seem to be a way to just not
report the switched state of a standard device.
In any case, I assume creating an object from scratch, as you've done
above, will always be the most flexible approach, correct?
Thanks again!
Biagio