Revert "Revert "Changed autoscriptotherplayers() lookup prepension to -foreach instead of -per""

This reverts commit e5d4c44488a81255a5e11f116f153dcdb12e0886.
2.2.3.x