Code:

var sceeny_count=0;

function sceeny()
{
file_for_screen("shot.png",sceeny_count); // saves a screenshot to "shot123.png"
sceeny_count+=1;
}

on_s = sceeny;



Edit: @Fog lol...