Скрипт позволяет вам включать\выключать свет.
Глобальная переменная - Rz_light.
Begin Rz_lights
short MessageOn
short button
if( MenuMode == 1)
Return
endif
if( OnActivate == 1)
Set MessageOn to 2
endif
if( MessageOn == 2)
MessageBox "Which light would you like on?" "Normal" "Green" "Blue" "Red" "Off";спрашивает какой свет включать или выключить
Set MessageOn to 1
endif
if( MessageOn == 0)
Return
endif
if( MessageOn == 1)
set button to GetButtonPressed
if( button == 0)
Set MessageOn to 0
Set Rz_light to 1
Return
endif
if( button == 1)
Set MessageOn to 0
Set Rz_light to 2
Return
endif
if( button == 2)
Set MessageOn to 0
Set Rz_light to 3
Return
endif
if( button == 3)
Set MessageOn to 0
Set Rz_light to 4
Return
endif
if( button == 4)
Set MessageOn to 0
Set Rz_light to 5
Return
endif
endif
End Rz_lights
Этот скрипт поместите на лампы с уникальными id
Begin Rz_lights_norm
if( MenuMode == 1)
Return
endif
if( Rz_light == 0)
Disable
endif
if( Rz_light == 1)
Enable
endif
if( Rz_light == 2)
Disable
endif
if( Rz_light == 3)
Disable
endif
if( Rz_light == 4)
Disable
endif
if( Rz_light == 5)
Disable
endif
End Rz_lights_norm
Устанавливаемые скриптом параметры:
Norm, enable if( Rz_light == 1)
Green, enable if( Rz_light == 2)
Blue, enable if( Rz_light == 3)
Red, enable if( Rz_light == 4)
All lights, disable if ( Rz_light == 5)