diff options
Diffstat (limited to 'far')
-rw-r--r-- | far/init_code.lua | 11 | ||||
-rw-r--r-- | far/nodes/(2049,9,1480).lua | 2 | ||||
-rw-r--r-- | far/nodes/(30785,15,1711).lua | 21 | ||||
-rw-r--r-- | far/nodes/(30919,13,1814).lua | 4 | ||||
-rw-r--r-- | far/nodes/(30919,13,1815).lua | 5 |
5 files changed, 33 insertions, 10 deletions
diff --git a/far/init_code.lua b/far/init_code.lua index 582b42e..571e2c4 100644 --- a/far/init_code.lua +++ b/far/init_code.lua @@ -20,12 +20,10 @@ end if event.init then F.debug = true - F.max_displays = 52 + F.max_displays = 15 F.print("Initialized") end -F.clear_main_depot_displays = function() for i = 1, F.max_displays, 1 do digiline_send("train_display" .. i, " ") end end - --[[ EXAMPLE: F.has_rc("LILSHUNTER", F.get_rc_safe() ) Merged F.has_rc and F.does_train_have_rc @@ -62,7 +60,7 @@ F.save_train = function(pos) pos_string = pos["x"] .. "," .. pos["y"] .. "," .. pos["z"] end S.trains[atc_id] = { ["id"] = atc_id, ["rc"] = F.get_rc_safe(), ["ln"] = F.get_line_safe(), ["cars_count"] = F.get_train_length_safe(), ["pos"] = pos_string } - F.print("Train ID: " .. S.trains[atc_id]["id"] .. " at " .. S.trains[atc_id]["pos"]) + -- F.print("Train ID: " .. S.trains[atc_id]["id"] .. " at " .. S.trains[atc_id]["pos"]) end end @@ -88,6 +86,8 @@ F.delete_train_info = function(train_id) end end +F.clear_main_depot_displays = function() for i = 1, F.max_displays, 1 do digiline_send("train_display" .. i, " ") end end + F.list_trains = function(number_of_displays) if S.trains then if number_of_displays == nil then number_of_displays = F.max_displays end @@ -100,7 +100,8 @@ F.list_trains = function(number_of_displays) count_keys = count_keys + 1 end table.sort(trains_table) - x = number_of_displays - count_keys + -- x = number_of_displays - count_keys + x = 1 for _, k in ipairs(trains_table) do if S.trains[k] then v = S.trains[k] diff --git a/far/nodes/(2049,9,1480).lua b/far/nodes/(2049,9,1480).lua index 3c361d0..08e6c2a 100644 --- a/far/nodes/(2049,9,1480).lua +++ b/far/nodes/(2049,9,1480).lua @@ -5,4 +5,4 @@ if event.train then local posTable = POS(2049,9,1480) F.save_train(posTable) return -endv
\ No newline at end of file +end
\ No newline at end of file diff --git a/far/nodes/(30785,15,1711).lua b/far/nodes/(30785,15,1711).lua new file mode 100644 index 0000000..06bdb5c --- /dev/null +++ b/far/nodes/(30785,15,1711).lua @@ -0,0 +1,21 @@ +-- far_luaatctrack_findopenroute_01.lua +local signal_pos = "FareastEndEntrySignal" +local last_route = "3" +local proposed_route_name = "" + +if event.type == "train" then + if not atc_id then return end + 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 + diff --git a/far/nodes/(30919,13,1814).lua b/far/nodes/(30919,13,1814).lua index 0aa072d..0bf4df5 100644 --- a/far/nodes/(30919,13,1814).lua +++ b/far/nodes/(30919,13,1814).lua @@ -2,8 +2,8 @@ local show_print = false if event.type == "punch" then --- F.delete_train_info("450511") +-- F.delete_train_info("595542") - F.list_trains(6) + F.list_trains(15) return end
\ No newline at end of file diff --git a/far/nodes/(30919,13,1815).lua b/far/nodes/(30919,13,1815).lua index c8cd423..dee866e 100644 --- a/far/nodes/(30919,13,1815).lua +++ b/far/nodes/(30919,13,1815).lua @@ -1,8 +1,9 @@ local show_print = false if event.type == "punch" then --- trainID = 999999999 --- F.slow_train_down(trainID) + + F.slow_train_down("458503") + F.clear_main_depot_displays() return end
\ No newline at end of file |