In-game spells as one-time passwords

Okay, I am a noob using Inform 7, and have approached this problem from several different angles. I am designing a puzzle for a 1-room game where the player is given a wand (with a switch to say whether it is on or off and can cast spells–this part compiles) with which they can then enter a “magic word” which is 1-time use and changes every time entered correctly so points cannot be awarded twice for the same entry.

Currently, I am trying a variant of “Speak ‘this word’ when the wand is switched on, and enter.”

The problem is, how do I do this? I decided the easiest way would be having a series of in-game ‘passwords’. Thus, the player cannot solve or even get descriptions for problem 2 until problem 1 is taken care of, and similarly problem 3 will not show up until until problem 2 is completely dead and off-stage. First, I thought of something like nested containers, but this will not work, since the whole description of the room changes in response.

Sorry for making this a long, rambling plea for help, but is really has been driving me batty for the last week and a half.

And it does currently compile, I can walk around the room and get to some of what I need to – it just ignores my attempts to solve the puzzle

This is a fairly unsophisticated way of doing it, but easily customised. (If you wanted to use a great many magic words, for instance, it might be tidier to compile this information into a table; but to do that you’d need a more specific idea of the sorts of effects you wanted the words to have.)

MY HERO! I will try this as soon as I can!