summaryrefslogtreecommitdiff
path: root/far/nodes/(30785,15,1711).lua
blob: 668b0c71f23dab307f1c2f00ed3b93deca2b3f50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- far_luaatctrack_findopenroute_01.lua
local signal_pos = "FareastEndEntrySignal"
local last_route = "3"
local proposed_route_name = ""
local posTable = POS( 30785,15,1711 )

if event.type == "train" then
  if not atc_id then return end

  F.save_train(posTable)

  if atc_arrow then
    atc_send("B0")
  end
  for i = 1, last_route, 1 do
    l = tostring(i)
    proposed_route_name = "Far East End (Platform " .. l .. ")"
    if can_set_route(signal_pos, proposed_route_name) then
      set_route(signal_pos, proposed_route_name)
      -- F.print("Train ID " .. atc_id .. " going on " .. proposed_route_name)
      atc_send("SM")
    end
  end
end