diff options
Diffstat (limited to 'far/init_code.lua')
-rw-r--r-- | far/init_code.lua | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/far/init_code.lua b/far/init_code.lua index 15dfbf8..0ad2749 100644 --- a/far/init_code.lua +++ b/far/init_code.lua @@ -366,7 +366,7 @@ S.ttt[train_id] = { - trains } ]] -local STOP_TIME = 10 +local STOP_TIME = 40 local STOPCMD="B0WO" local DEPCMD="A1OCD1SM" local RDEPCMD="RA1OCD1SM" @@ -402,6 +402,20 @@ F.ttp_begin({ only_lines = nil, --if given a table, only trains where only_lines[get_line()] is true are considered force_tt_reset = false, -- force reset of travel times for this timetable }) + + +F.ttp_begin({ + stn = "Salt Factory", -- station name + tt = "FAR_E", -- timetable ID + depint = "05;00", --departure slot interval + depoff = "03;15", --departure slot offset + doorside = "L", + reverse = true, + only_lines = {['FAR'] = true}, + force_tt_reset = false, + pos = POS(1755,8,1570), + direction = "west", +}) ]] -- Make train depart at the next time slot, and save its start time function F.ttp_begin(p) @@ -424,6 +438,9 @@ function F.ttp_begin(p) atc_set_text_inside("Next stop: "..p.stn.."\nTerminal Station.\nThis train continues as "..F.ttp[p.tt].inside_line_desc) end if event.train then + if p.pos and p.direction then + F.save_train(p.pos, p.direction) + end -- train arrived, planning departure atc_send(STOPCMD .. p.doorside) @@ -492,7 +509,17 @@ F.ttp_stop({ -- If present, override desired departure time. Defaults to travel time + STOP_TIME if not provided no_disable_ars = nil, -- if true, does not disable ARS on approach (used for example at INTERCAL) + pos = POS(1,1,1), + direction = "east", +}) + +F.ttp_stop({ + stn = "The Cube", + doorside = "R", + pos = POS(1,1,1), + direction = "east", }) + ]] function F.ttp_stop(p) -- set my approach callback mode @@ -526,6 +553,9 @@ function F.ttp_stop(p) if event.train then + if p.pos and p.direction then + F.save_train(p.pos, p.direction) + end -- train arrived, planning departure atc_send(STOPCMD..p.doorside) local time_now = rwt.now() |