Some time ago, I asked the developers if TPT could have a remote interface like Telnet or D-Bus (->), and they said
TheWiseEyes:
Not a chance. That's sort of plain stupid.
and
TheWiseEyes:
It's stupid because TPT is designed to be a game, not a server app where you telnet in, attach to it and hope it works fine
Disappointed with these responses, I decided to make it on my own, since I think I won't be the only one that will like it.
After a long time, here is the first BETA of Remote Toy! It's a Lua script that allows other programs to execute commands in TPT, by simply writing to a .txt file, and polling another one for response. Please note that Remote means other programs but on the local machine, not on a remote one; actually it could be used via remote console protocols (like Telnet or SSH) or file transfer protocols (like FTP, SMB or Dropbox) if you already have a server for them and you can access/share the TPT folder with them. It includes a Python 2.x program that acts both as an example and a fully working CLI (remember to edit it with a text editor and change the path to your TPT install folder).
Here's how it works: you put a command in remotetoy.input.txt, Remote Toy reads it and clears it, executes it, and puts its result in remotetoy.output.txt. The remotetoy.status.txt file contains a status string of these:
ready: Remote Toy is ready to receive commands
busy: the last command sent is being evaluated
disabled: Remote Toy is disabled
WARNING: sending a wrong Lua command makes Remote Toy hang without warning, to make it work again disable then re-enable it.
To load it, you can:
start it manually, with dofile("remotetoy.lua") in console
start it from the autorun.lua file (with the same command above)