[TADS 3] How to tell where an action was initiated

Is there any way to identify whether an NPC action was initiated by the player from the cursor (i.e. the player typing George, unlock the door) or from code in an Actor agenda (newActorAction(George, unlock, door):wink:

I would just like to be able to modify the resulting text to reflect whether the action was directed by the player or initiated independently by the NPC?

I know almost nothing about adv3 (the default TADS 3 library), but since nobody has replied to you yet, Iโ€™ll give it a try.

It depends on where do you want to identify the difference. There are macros like gAction, gActionIs(), and gActionIn(), so you can test it before newActorAction() is called (see Learning TADS 3, p. 89). There is also StringPreParser class (see Learning TADS 3, p. 307) that let you manipulate the command line directly.

But neither seems the perfect solution to me. In adv3Lite (an alternative library for TADS 3), there is a convenient macro gCommand, but I canโ€™t find the equivalent in adv3.