summaryrefslogtreecommitdiff
path: root/durt/nodes/(1906,7,9136).lua
blob: 2432086375b922a310eac0b1321987a58b6e466b (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--base RC:  FREIGHT WOA_IYARD IYARD IP_COLLECT_WOA_mine_empty IP_RTS WOA_mine_around
local around_rc_list = {
	"WOA_around_active",
	"WOA_rev_north",
	"WOA_around_station",
	"WOA_rev_south",
	"WOA_rejoin_overburden"
}

__approach_callback_mode = 1

if event.approach and not event.has_entered then
	atc_set_ars_disable(true)
	atc_set_lzb_tsr(1)
	return
end

if event.train and atc_arrow then
print("triggered")
	digiline_send("mine_counter_lcd",S.yards.WOA.mine_count)
	if F.has_rc("WOA_mine_around") then
print("has around")
		if F.has_rc("WOA_around_active") then
print("around active")
			F.remove_rc(around_rc_list)
			unset_autocouple()
print(S.yards.WOA.mine_count)
			if S.yards.WOA.mine_count < 7 then -- send train back to yard
				S.yards.WOA.mine_count = S.yards.WOA.mine_count + 1
				print("WOA Mine Count: "..S.yards.WOA.mine_count)
				atc_set_text_outside("Warmoneaye Mining Co.")
				atc_send("B0WRD3SMA1")
			else
				S.yards.WOA.mine_count = 0
				atc_send("B0")
				atc_set_text_outside("Warmoneaye Mining Co.\nAwaiting More Overburden")
			end
			return
		end
		atc_set_text_outside("Warmoneaye Mining Co.\nLocomotive Switching Ends")
		split_off_locomotive("B0A0")
print("split success")
		set_autocouple()
		F.remove_rc({"WOA_shed_left"})
		F.add_rc(around_rc_list)
		atc_send("S4A1")
print("completed")
		return
	end
end

if event.digiline and atc_id then
	if not F.has_rc("WOA_around_active") then
		atc_set_text_outside("Warmoneaye Mining Co.")
		atc_send("S0WRD3SMA1")
		return
	end
end