summaryrefslogtreecommitdiff
path: root/durt/nodes/(-4129,16,-5802).lua
blob: 2e1142d94b3d228180b6c4e092612dd1711c1cd3 (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
25
26
local split_indicator = POS(-4128,17,-5768)
__approach_callback_mode = 1

if event.approach and not event.has_entered then
	if get_line() ~= "DLG_OFB" then return end
	
	atc_set_ars_disable(true)
	atc_set_lzb_tsr(1)
end

if event.train then
	if get_line() ~= "DLG_OFB" then return end
	if not atc_arrow then return end
	local state = getstate(split_indicator)
	if state == "red" then
		split_off_locomotive("A0B0OL",1)
		atc_send("S3")
		atc_set_ars_disable(false)
		setstate(split_indicator,"green")
		set_rc((get_rc() or "").." DLG_south_reverse DLG_around_short DLG_north_reverse DLG_shunt_platforms DLG_shunt_Platform2")
	elseif state == "green" then
		atc_send("B0WROCA1D2S4D10SM")
		setstate(split_indicator,"red")
		F.remove_rc({"DLG_south_reverse","DLG_around_long","DLG_north_reverse","DLG_shunt_platforms","DLG_shunt_Platform2"})
	end
end