Custom scripts are javascript functions that take in the world state as an argument, and return an updated world state. I haven't really documented custom scripts thoroughly because I think the best way to understand how they work is to take a look at the script.js source code and see how I've implemented the built-in scripts.