Script calculation