Tearing my hair out - Please help - Tables & Player input

I’m trying to take a players input, and depending on what it is, do something with it. But I can’t seem to get it to work.

Here is my code:

[code]understand “configure [text]” or “conf [text]” as configuring.

configuring is an action applying to one topic.

a PlayerText is some text that varies.

Table 1 - Configuration
topic reply location
“head” “head reply” “na”
“arm” “arm reply” “na”
“leg” “leg reply” “na”
“torso” “torso reply” “na”
“foot” “foot reply”

Check configuring:
if the player is in the body:
if the topic understood is a topic listed in the Table of Configuration:
now the PlayerText is “[topic understood]”;
if the PlayerText is “Head”:
say “[reply entry][paragraph break]”;
move the player to the Head;
otherwise:
say “not built yet[line break][topic understood][line break][PlayerText]”;
otherwise:
say “Unknown Command. Type SHOW HELP for help” instead. [/code]

I’m taking the topic understood and putting it into a variable because doing something like:

if topic understood is topic in row 1 of the Table of Configuration: didn’t work.

So, I put in some debug text, to tell me what PlayerText is being set to, and why it isn’t matching my check (“head”).

I’ll type “configure head” and it will output:

not built yet head head

My “otherwise” debug text shows me that the topic understood and playertext are the same, so I know that is getting set, but what isn’t working is:

if the PlayerText is "head": say "[reply entry][paragraph break]"; move the player to the Head;

Which makes no sense, because the PlayerText DOES equal “head”!

Please help, or tell me what I am doing wrong =(

EDIT: Ok, apparently I am a moron. I was doing it wrong…I guess? I had to use:

if PlayerText matches the text "head":

And that works great. But I guess I am confused, since I though the “is” keyword was doing exactly that. Can anyone explain the difference?

Thanks!

“text” in I7 is an output-only device. When you say
now the PlayerText is “[topic understood]”;
…you’re setting up a bit of code that can print the (current) “topic understood” variable. It’s not suitable for comparison.

In general, you can use “is” to compare identical literal texts, but not strings with bracketed substitutions. (It may work for identical bracketed substititions – that is, I think this works:
if “[topic understood]” is “[topic understood]”, say “Yes.”;
But this is rarely what you want.

For this case, forget having a text variable. Make direct comparisons between “topic understood” (a snippet) and your topic column, using “matches”.

Perfect! That makes sense. Thank you so much!