43 so... I think I have the most important stuff for now done.
There are now delta's to insert characters. I'm not going let you update characters as of yet as there is very little you can edit (except for name, appearance and stuff like that which I'm not going to expose)
You can also not delete characters. The idea is that each character that gets created by an action get marked as a "minion" and will be cleaned up after a battle.
There is also function inside the script itself (unless already registered before the script runs) that just prints out each change as json. Though, I should probably do a check first if its a number, boolean or string as right now that is all the same (oops).
If the action fails for whatever reason the changes get cleaned up and a new one gets inserted telling what the error was. The line numbers of said error even line up with the code given by the user, thus I don't even need to show the whole script if something breaks.
Only thing that is left to do is make a new print function that just puts output in the changes table instead of really printing it. After that, its time to chop it up so php can use it and create code to update the database according to the given changes. Shouldn't be too hard (famous last words)
Also, after that is done it should be pretty much ready to be able to run inside WASM.