Making an NPC follow a script of actions

I want to give an NPC a short list of actions for them to carry out, one per turn, until they exhaust the list. Any tips on how to do it? There are some examples in the recipe book, (for example “Odyssey”) but it only deals with going. I want to be able to assign a script to an NPC that involves going places and manipulating objects (taking, dropping, switching on, whatever). I thought maybe I could create a table of actions and have inform execute them, but I can’t make that work.

Any ideas?

See the recipe book. In particular, see Robo 1 and 2.

And if you just want a script that you program in yourself, instead of one that the player creates dynamically, you should be able to do it with a table of stored actions:

[code]Lab is a room. George is a man in Lab. A thingy is in Lab.

Table 1 - George action
action (stored action)
george trying waiting
george trying singing
george trying taking thingy
george trying dropping thingy

Every turn:
if the Table of George action is not empty:
repeat through the table of george action:
try the action entry;
blank out the whole row;
break.

Instead of someone singing:
say “[The actor] hums a few bars.”

Test me with “z/z/z/z”.[/code]

(“Break” stops the while loop without interrupting the “every turn” rulebook – as discussed here, the example “Odyssey” should have “break” or “make no decision” instead of “rule succeeds.”)

Thanks matt w, I think that is exactly what I was looking for.