inform7

How to make a "typing on" command?


I want to have a computer on which the player can type on, like this:

The Lab is a room.

A desk is in the lab. On the desk are a personal computer and a note.
Description of the note is "Password: wh23".

Typing it on is an action applying to a topic and a touchable thing.
Understand "Type [text] in/into/onto/on [something]" as typing it on.

Instead of typing something on the computer:
    say "wrong password".
Instead of typing "wh23" on the computer:
    say "welcome back, user!"

test me with "x note / type wh23 into computer"

This throws the Error: "but an action can only apply to things or to kinds of value"

I tried lots of variations of this, none worked.

Is it only possible to have the topic at the end of the line?

What am I doing wrong?


Solution

  • I'm not sure why, but you need to specify the amounts:

    Typing it on is an action applying to one topic and one touchable thing.
    

    The next issue will be that topics aren't considered to be "something" so the first instead rule must be changed to:

    Instead of typing some topic on the computer:
        say "wrong password".