- Código: Seleccionar todo
- function Initialise ()
 isPlayerLoco = false
 Call("BeginUpdate")
 end
 function OnConsistMessage ( msg, argument, direction )
 Call ( "SendConsistMessage", msg, argument, direction );
 
 end
 function OnControlValueChange ( name, index, value )
 if Call( "*:ControlExists", name, index ) then
 Call( "*:SetControlValue", name, index, value );
 end
 end
 function Update (time)
 
 
 
 if Call("GetIsEngineWithKey") > 0.5 then
 isPlayerLoco = true
 else
 isPlayerLoco = false
 end
 if isPlayerLoco== true then -- comprueba si es una locomotora de jugador o IA
 amp=Call( "*:GetControlValue", "Ammeter", 0 )
 if amp > 3500 then -- estos 3500 amperios representan una corriente maxima arbitraria e imaginario para una Class 47
 Call ( "*:SetControlValue", "EmergencyBrake", 0, 1)
 end
 end
 
 
 
 end
Se puede conseguir que el sistema indique una alarma sonora y/o visual antes de llegar al rango de protección. Solo es necesario ponerle un poco de imaginación.









 
 
 
 
