alarm[0] = (60 + random(120)) if (active == 1 && state == 1) { state = 4 image_index = 0 }