It would be better to add a new engine_getscript function that gets the number of the function as argument. I've put that on my list.