Can Inform trigger AppleScript events or otherwise communicate with an Arduino?

Hi there,
I have no experience with Inform but am excited by its potential. I have a project for which I’m considering Inform and I’m wondering if Inform can be used to trigger AppleScript events? Perhaps with an extension? Ultimately, I want the player’s actions to trigger events external to the computer, via an Arduino, but I figured AppleScript would be the likely intermediary in such an interaction.

Anyone know of a way to get Inform to trigger AppleScript events or otherwise communicate with an Arduino board?

Easiest way to do this is probably to use something like RemGLK and communicate with your story file through the terminal. Imagine an outside routine “playing” your Inform game and relaying its data. That’s how I’d do it, I think.

Inform games run on a virtual machine with very limited contact with the outside world. So if you want to make something happen on an Arduino, you’ll have to work through one of the VM’s existing communication channels.

If you use RemGlk or such, as Eleas suggests, that would involve putting something in between the VM and the user, looking at I/O as it goes past and responding appropriately. This is what Vorple does: it adds an extra output stream, then takes anything that’s sent to that stream and executes it as JavaScript.

Another option is to have the Inform game write messages out to a file, which an external program watches and reacts to. This is probably easier, on a technical level, since you can leave all the game/player interaction to the interpreter without having to care about it. However, you also have to deal with polling and such.


Just as a quick addition: if you go for the second option which Draconis mentioned, you can find some documentation and examples in the Inform Manual, sections 23.11 (“Files”) to 23.15 (“Exchanging files with other programs”).