--------------------------------------------------------------------------------------
-- Do nothing but sending message REQUEST_TO_PASS_DANGER to the signal ahead
-- under the condition that that signal is closed.
-- AndiS, 30 Dec 2014
-- Place this in approach to a signal with a some call-on indication showing when you press TAB
-- Warning: Of course, this depends on the code of the main signal.
-- All it does is simulating the TAB press.
--------------------------------------------------------------------------------------
function Initialise ()
end
function Update(time)
end
function OnConsistPass ( prevFrontDist, prevBackDist, frontDist, backDist, linkIndex )
if frontDist <= 0 and prevFrontDist > 0 then -- front passed link 0 proper
if 2 == Call( "GetNextSignalState", "", 1, 1, 0 ) then
Call( "SendSignalMessage", 4, "", 1, 1, 0)
end
end
end
function OnSignalMessage( message, parameter, direction, linkIndex )
-- Forward each message except for RESET_SIGNAL_STATE
if ( parameter ~= "DoNotForward" and message ~= 0) then
Call( "SendSignalMessage", message, parameter, -direction, 1, linkIndex )
end
end
function GetSignalState( )
return Call( "GetNextSignalState", "", 1, 1, 0 )
end
<Stopping d:type="cDeltaString">eFalse</Stopping>
Return to Tutorials, Guides, FAQ
Users browsing this forum: No registered users and 1 guest