Refuse examining things that aren't in inventory.

I’ve been trying with layered if’s but nothing’s going the way i want it.

I’m using AWFreyr’s Hybrid Choices.

While in CYOA mode, it should refuse examining things that aren’t in inventory, or the player itself…

Any advice?

—EDIT—

GOT IT

[code]Instead of examining something when in cyoa mode:
if the player carries the noun:
say description of the noun;
otherwise:
if the noun is the player:
say description of the noun;
otherwise:
say “Please focus on the story.”;

Rule for printing a parser error when in cyoa mode:
say “Please focus on the story.” instead;[/code]

You might want to change line 3 to “continue the action”. I’m thinking of the odd possibility that in some particular case, ‘x that thing’ could end up doing something other than just printing the description.

I don’t understand what you mean. Sorry.
[bracket]it’s been a very long, painful (in every sense of the word) day[close bracket]

Suppose you have this:

Carry out examining a thing: now the noun is examined.

or

After examining the keys for the first time: say "Oh, they were in your pocket all along!"

If you use what you have now, the “Instead” rule prevents this (and any other carry out/after/report rules you have) from running. If you put a “continue the action” where Jim said, then the “Instead” rule doesn’t cut off the rest, but goes straight to the Carry out examining rulebook, which will print the description and run any other rules for examining you might have.

I would even go farther as to use a Check rule here, which should be less likely to interfere with the rest of the action pipeline in the event that you want to permit it.

Check examining a thing which is not enclosed by the player when in cyoa mode: instead say "Please focus on the story." 
[or]
Check examining a thing when in cyoa mode begin;
if the noun is the player or the noun is carried by the player, continue the action;
otherwise, say "Please focus on the story." instead;
end.

I haven’t tested it but something similar to this should work.