summaryrefslogtreecommitdiff
path: root/durt/nodes/(-3544,8,-2277).lua
blob: c946f556355be44939e93dfdfb6bd70d9a935282 (plain)
1
2
do return end
----------------------------------------------
--East End of Loading Road
local siding_id = "TreeFarm"
local control_interface = POS(-3553,18,-2261)
local loading_sig = POS(-3539,9,-2279)
local exit_route = "Exit to Mainline"
local accelerator_loop_diverge_sig = POS(-3602,9,-2282)

if event.type=="ext_int" then
	if not atc_id then
		interrupt_pos(control_interface,"No Train at Signal")
		return
	elseif atc_speed ~= 0 then
		interrupt_pos(control_interface,"Train Still Moving")
		return
	end
	
	if event.message == "shuffle" then
		if can_set_route(loading_sig,"Loop Around") then
			set_route(loading_sig,"Loop Around")
			set_route(accelerator_loop_diverge_sig,"Loading Road (Left)")
			atc_send("S8")
		else
			interrupt_pos(control_interface,"Unable to set route")
		end
	elseif event.message == "depart" then
		atc_set_text_outside("Preparing to Depart")
		interrupt_pos(control_interface,"Preparing to Depart")
		interrupt_safe(5,"depart")
	else
		interrupt_pos(control_interface,"Unknown Command:||"..tostring(event.msg))
	end
end

if event.type=="int" then
	if event.message == "depart" then
		set_route(loading_sig,"Exit to Mainline")
		atc_send("SM")
		atc_set_text_inside("-- Manifest --\nCargo: Logs and Leaves\nOrigin: Auto Logging Plantation")
		atc_set_text_outside("Maverick2797 Organic Diamonds\nFrom Tree to Shiny!")
		unset_autocouple()
	end
end