Well, I made something that might help you. If you change your scripts to compose a string[int] map while it's running, you can use this function:
boolean send_error(string who, string[int] log, string scriptname)
boolean send_error(string who, string[int] log)
If you use the second one the...