summaryrefslogtreecommitdiff
path: root/durt/nodes/(-4129,9,-5588).lua
blob: fdce6e6a48a6c01478464ee224ca5620344b62ac (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
27
28
29
30
31
32
33
34
35
local lights = {
	POS(-4131,5,-5623),
	POS(-4127,5,-5623),
	POS(-4127,5,-5617),
	POS(-4131,5,-5617)
}
local pt = POS(-4129,5,-5628)
local bt = POS(-4132,4,-5626)

if event.train then
	if atc_arrow then
		for _,v in pairs(lights) do
			setstate(v,"on")
		end
		if getstate(bt)=="on" then
			atc_send("BB")
			schedule_in(";05",true)
		else
			setstate(pt,"r")
			atc_send("S3")
		end
	else
		if tostring(get_rc() or ""):match("DLG_shunt") then atc_send("S3D5S0WRD1S3") end
	end
end

if event.schedule then
	if getstate(bt)=="on" then
		atc_send("BB")
		schedule_in(";05",true)
	else
		setstate(pt,"r")
		atc_send("S3")
	end
end