Programmed Illusion:
You create an illusion of an object, a creature, or some other visible phenomenon within range that activates when a specific condition occurs. The illusion is imperceptible until then. It must be no larger than a 30-foot cube, and you decide when you cast the spell how the illusion behaves and what sounds it makes. This scripted performance can last up to 5 minutes. When the condition you specify occurs, the illusion springs into existence and performs in the manner you described. Once the illusion finishes performing, it disappears and remains dormant for 10 minutes. After this time, the illusion can be activated again. The triggering condition can be as general or as detailed as you like, though it must be based on visual or audible conditions that occur within 30 feet of the area. For example, you could create an illusion of yourself to appear and warn off others who attempt to open a trapped door, or you could set the illusion to trigger only when a creature says the correct word or phrase. Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against your spell save DC. If a creature discerns the illusion for what it is, the creature can see through the image, and any noise it makes sounds hollow to the creature.
I suppose this really revolves around what the spell description means by "scripted performance". Is this a script as in like a play, where it is acted out verbatim from start to finish, no matter how it is triggered? Or is it "scripted" in the sense of a bash script, where parameters can be specified such that it can respond to the environment? Can you have a conversation with this illusion? Can you have it refer to the weather or the time of day?
The thespian interpretation is supported by the fact that it calls it a "performance".
The computational interpretation is supported by the fact that the spell is called "programmed illusion". Also, the major image spell is able to carry on conversations, so it would seem silly to not allow programmed illusion to do that as well.
My instinct is that the spell would be worded differently if it was intended to be able to respond to the environment, but I am not sure.
Which is it?