' FILE : Lego House Controller

'           ENG         ITA
' Slot 1  = Door        Porta
' Slot 2  = Fireplace   Camino
' Slot 3  = Attic       Mansarda
' Slot 4  = Shop        Negozio
' Slot 5  = Signboard   Insegna

' Slot 6  = StreetLamp  Lampione
' Slot 7  = Tree        Albero
' Slot 8  = GreenH.Lamp Serra luce
' Slot 9  = GreenH.Lamp Serra temperatura

' Slot 10 = Free1
' Slot 11 = Free2
' Slot 12 = Free3

' Slot 15 = Light cycle
' Slot 16 = Fireplace cycle

Option Speed 7

Label Loop 
	' -------------------------------------- lights cycle speed controller 
	v1 = v1 + Slot(15)     
	If v1 > 100000
		v1 = v1 - 100000
	EndIf
	If v1 < 50000
		Slot 3 = v1 / 50
	Else
		Slot 3 = 2000 - v1 / 50
	EndIf
	Slot 4 = Slot(3)
	Slot 5 = Slot(3)
	Slot 6 = Slot(3)
	Slot 7 = Slot(3)
	' -------------------------------------- fireplace random speed controller 
	v2 = v2 + Slot(16)     
	If v2 > 1000
		v2 = v2 - 1000
   		Slot 2 = 1000 * Rnd()
	EndIf
	' -------------------------------------- loop time
	Wait Seconds 0.001
GoTo Loop
