View difference between Paste ID: m6DxzQ8S and E7hu7rNb
SHOW: | | - or go back to the newest paste.
1
void main(void)
2
{
3-
	var enabled = 0;
3+
4
5
	foreach (lights as light)
6
	{
7
		var enabled = false;
8
9
		// Save the original settings so we can reset to them later
10
		var color = light.getColor();
11
		var radius = light.getRadius();
12
13
		if (!enabled) // Starting from the Off state, we switch on Red Alert
14
		{
15
			// Set them all to red
16
			light.setColor(255, 0, 0);
17
			
18
			// Brighten and dim repeatedly
19
			while (true)
20
			{
21
				light.setRadius(4);
22
				light.setRadius(1);
23
			}
24
25
			// Save On state
26
			enabled = true;
27
		}
28
		else // If it was already on, set it back to defaults
29
		{
30
			light.setColor(color);
31
			light.setRadius(radius);
32
			enabled = false;
33
		}
34
	}
35
}