if atc_arrow then
	if get_rc():match("DLG_shunt") then
		atc_send("BBWRSM")
		F.remove_rc({"DLG_shunt"},true)
	else
		atc_send("BB")
	end
end

if event.channel=="train_ctl" and event.msg=="send" then
	if not atc_id or not atc_arrow then
		digiline_send("error","Error "..os.time().."\nArrow:"..tostring(atc_arrow).."\nID:"..tostring(atc_id))
		return
	end
	atc_send("S3")
	set_rc((get_rc() or "").." DLG_shunt")
	split_at_index(2,"BB")
	set_autocouple()
	return
end