Distinguish Between User "LOOK" and Automatic Looking

Greetings all. I’m updating one of my extensions and I realized a gap in my logic. The gap is predicated on me doing this:

Carry out looking (this is the fully decayed description with no summary rule):
	if the visited-count of the location is 2 and the summary description of the location is "":
		say "[the description of the location][paragraph break]".

However I realized I only want that to take place in cases where the player has actually typed “LOOK” when they go to a room. I don’t want that to take place if the player just goes to a room. However, just going to a room automatically triggers a “looking” action.

Is there a way to distinguish between the two? Meaning, can I craft a rule about “carry out looking - but only when the player actually gives the command”?

1 Like

During the looking action, there’s a variable you can check called ‘the room-describing action’. So you can test for whether movement (going) caused the look or not.

The test for the going case is
if the room-describing action is the going action:
(do yada yada)

You can test for the opposite by saying
if the room-describing action is not the going action:
or
unless the room-describing action is the going action:

Combining the above with your example rule, you could write it as:

Carry out looking when the room-describing action is not the going action (this is the fully decayed description with no summary rule):
	if the visited-count of the location is 2 and the summary description of the location is "":
		say "[the description of the location][paragraph break]".

-Wade

4 Likes

Ah! You got it exactly; this works perfectly. My profound thanks.