Thanks in advance.
There's probably a more elegant way to do this, but this works:
-----
Kitchen is a room. Parlor is a room. The player is in Kitchen.
Portal is east of kitchen and west of parlor. Portal is a locked door.
Before unlocking portal with keyb:
say "You unlock Portal.";
Now portal is unlocked;
rule succeeds.
Before locking portal with keyb:
say "You lock Portal.";
now portal is locked;
rule succeeds.
KeyA is in Kitchen. KeyA unlocks portal.
KeyB is in Kitchen.
KeyC is in Kitchen.
test me with "open portal/take keyc/unlock portal/take keyb/unlock
portal with keyb/lock portal with keyb/take keya/unlock portal with
keya."
---------
-duff