'##############
'EVENDPC2
'##############

'INIT EVEND PC 2 Drucker/Boardcomputer

'(c) 18.09.2017 Christian Rolle

'Script Version: 1.0

'Revision History:

'- Christian Rolle		18.09.2017		created from scratch

{trigger:cp_microphone}
	1 (S.L.cp_microphone_sw)
	(L.L.debounce) !
	{if}
		(T.L.ev_VDV_on)
		1 (S.L.debounce)
		(L.L.RBL_Busstop) 1 + (L.L.RBL_Busstopcount) <
		{if}
			(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
			(M.L.RBL_PlayAnnouncement)
		
		{else}
			(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
			1 (S.L.RBL_Routeswitch)
			(T.L.ev_IBIS_entwerter)
		{endif}
	{endif}
{end}

{trigger:cp_microphone_off}
	0 (S.L.cp_microphone_sw) (S.L.debounce)
{end}

{trigger:EVEND_Fahrerkarte}
	(L.L.EVEND_Mode) 1 =
	{if}
		1 (S.L.EVEND_Fahrerkarte)
		0 (S.L.GotHeaderInfo)
	{else}
		0 (S.L.Pause)
		1 (S.L.EVEND_Fahrerkarte)
		0 (S.L.EVENDPC2_Loggedin)
		2 (S.L.Evend_Mode)
	{endif}
{end}

{trigger:EVENDPC2_Ticket_1}
0 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_2}
1 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_3}
2 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_4}
3 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_5}
4 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_6}
5 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_7}
6 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_8}
7 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_9}
8 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_10}
9 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_11}
10 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_12}
11 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_13}
12 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_14}
13 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_15}
14 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_16}
15 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_17}
16 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_18}
17 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_19}
18 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_20}
19 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_21}
20 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_22}
21 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_23}
22 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_24}
23 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_25}
24 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_26}
25 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_27}
26 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_28}
27 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_29}
28 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}

{trigger:EVENDPC2_Ticket_30}
29 (S.L.EVENDPC2_Ticket)
5 (S.L.EVEND_Mode)
{end}




{trigger:EVENDPC2_Login_0}
0 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_1}
1 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_2}
2 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_3}
3 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_4}
4 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_5}
5 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_6}
6 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_7}
7 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_8}
8 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_9}
9 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_C}
-90 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Login_CC}
-99 (S.L.EVENDPC2_Login)
{end}

{trigger:EVENDPC2_Button_U1}
1 (S.L.Button_U1)
{end}

{trigger:EVENDPC2_Button_U2}
1 (S.L.Button_U2)
{end}

{trigger:EVENDPC2_Button_U3}
1 (S.L.Button_U3)
{end}

{trigger:EVENDPC2_Button_U4}
1 (S.L.Button_U4)
{end}

{trigger:EVENDPC2_Button_U5}
1 (S.L.Button_U5)
{end}

{trigger:EVENDPC2_Verkauf_Abbruch}
1 (S.L.EVENDPC_TicketVerkauf_Abbruch)
{end}

{trigger:EVENDPC2_Verkauf_OK}
1 (S.L.EVENDPC_TicketVerkauf_OK)
{end}

{trigger:ticketprinter_getticket}
	0 (S.L.EVENDPC2_ticket_pos)
	4 (S.L.EVEND_Mode)
	-1 (S.L.EVENDPC2_Ticket) (S.L.GivenTicket)
	-1 (S.L.Ticket_ID)
	0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
	(T.L.ev_ticketsale_giveticket)
{end}

{trigger:EVENDPC2_Menu_1}
73 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_Menu_2}
	4 (S.L.Evend_Mode)
	0 (S.L.TicketPackLength)
	0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
	0 (S.L.Delay_Timer) 
	-1 (S.L.EVENDPC2_Ticket) (S.L.Ticket_ID)
	"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
	"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
	"" (S.$.String_Login) (S.$.String_Einstellungen) (S.$.String_Abmeldung)
	"" (S.$.Ticket_PrintString)
{end}

{trigger:EVENDPC2_Menu_3}
(L.L.Evend_Mode) 4 >=
{if}
	42 (S.L.Evend_Mode)
{endif}
{end}

{trigger:EVENDPC2_Menu_4}
(L.L.Evend_Mode) 4 >=
{if}
	999 (S.L.EVEND_Mode)
	"" (S.$.String_Login)
	"" (S.$.String_Einstellungen)
	"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
	"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
	"" (S.$.String_Login) (S.$.String_Abmeldung)
	"" (S.$.Ticket_PrintString)
{endif}
{end}

{trigger:EVENDPC2_Menu_5}
(L.L.Evend_Mode) 4 >=
{if}
	0 (S.L.Delay_Timer)
	1001 (S.L.Evend_Mode)
	"" (S.$.String_Login)
	"" (S.$.String_Einstellungen)
	"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
	"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
	"" (S.$.String_Login) (S.$.String_Abmeldung)
	"" (S.$.Ticket_PrintString)
{endif}
{end}

{trigger:EVENDPC2_Menu_6}
(L.L.Evend_Mode) 4 >=
{if}
	0 (S.L.Delay_Timer)
	1000 (S.L.Evend_Mode)
	"" (S.$.String_Login)
	"" (S.$.String_Einstellungen)
	"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
	"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
	"" (S.$.String_Login) (S.$.String_Abmeldung)
	"" (S.$.Ticket_PrintString)
{endif}
{end}

{trigger:EVENDPC2_RBL_Menu_1}
70 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_RBL_Menu_2}
(L.L.RBL_Ansage) ! (S.L.RBL_Ansage)
78 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_RBL_Menu_10}
(L.L.RBL_Fortschaltung) ! (S.L.RBL_Fortschaltung)
79 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_RBL_Menu_12}
(L.L.RBL_Entwerter) ! (S.L.RBL_Entwerter)
80 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_RBL_Menu_11}
75 (S.L.Evend_Mode)
{end}

{trigger:EVENDPC2_RBL_Menu_UP}
(L.L.RBL_Busstop) 1 + (L.L.RBL_Busstopcount) <
{if}
	(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
	(M.L.RBL_PlayAnnouncement)
{else}
	(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
	1 (S.L.RBL_Routeswitch)
	(T.L.ev_IBIS_entwerter)
{endif}
{end}

{trigger:EVENDPC2_RBL_Menu_DN}
	(L.L.RBL_Busstop) 1 - 0 max (S.L.RBL_Busstop)
	(M.L.RBL_PlayAnnouncement)
{end}

{trigger:EVENDPC2_Verkauf_1}
1 (S.L.Button_Verkauf)
{end}

{trigger:EVENDPC2_Verkauf_2}
2 (S.L.Button_Verkauf)
{end}

{trigger:EVENDPC2_Verkauf_3}
3 (S.L.Button_Verkauf)
{end}

{trigger:EVENDPC2_Einstellungen_1}
1 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_2}
2 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_3}
3 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_4}
4 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_5}
5 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_6}
6 (S.L.Einstellungen_Mode)
{end}

{trigger:EVENDPC2_Einstellungen_7}
7 (S.L.Einstellungen_Mode)
{end}


{macro:EVENDPC2_init}
	-1 (S.L.EVENDPC2_Login) (S.L.RBL_RouteIndex)
	3 (S.L.Einstellungen_Mode)
	"" (S.$.LoginString)
	0 (S.L.Anzeige_Prio)
	"     " (S.$.IBIS_Complex_Line)
	-1 (S.L.IBIS_RouteIndex) (S.L.current_stopindex)
	0 (S.L.ibis_startuptime) (S.L.IBIS_State)
	0 (S.L.IBIS_press)
	(C.L.EVEND_Fahrerpin) !
	{if}
		"PIN: 0000" (S.$.String_PIN)
	{else}
		"PIN: " (C.L.EVEND_Fahrerpin) $IntToStr $+ (S.$.String_PIN)
	{endif}
	0 (S.L.EVENDPC2_overlay_alphascale)
	5 (S.L.Einstellungen_Mode)
{end}

{macro:EVENDPC2_frame}

	(L.L.elec_busbar_main)
	{if}
		(L.L.RBL_Fortschaltung) !
		{if}
'Haltestellenfortschaltung:
'erstmal Unterscheidung zwischen Fahrplanfahrt und Freier Fahrt:
			(L.L.schedule_active)
			{if}
'Fahrplan:		
				(L.L.RBL_Busstop) 1 + (L.L.RBL_Busstopcount) =
				{if}
					(M.V.GetTTBusstopIndex) (L.L.TTPuffer) = !
					{if}
						(L.L.TT_Timer) (L.S.Timegap) + (S.L.TT_Timer) 3 >
						{if}
							(M.V.GetTTBusstopIndex) (S.L.TTPuffer)
							(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
							1 (S.L.RBL_Routeswitch)
							(M.L.RBL_PlayAnnouncement)
							(T.L.ev_IBIS_entwerter)
							0 (S.L.TT_Timer)
						{endif}
					{endif}
				{else}
					(M.V.GetTTBusstopIndex) (M.V.GetTTBusstopName) (L.$.TTBusstopIndex_prev) $= !
					{if}
						(M.V.GetTTBusstopIndex) (M.V.GetTTBusstopName) (S.$.TTBusstopIndex_prev)
						(L.L.RBL_Busstop) 1 + (L.L.RBL_Busstopcount) <
						{if}
							(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
							(M.L.RBL_PlayAnnouncement)
						{endif}
					{endif}
				{endif}
			{else}
'Freifahrt:
'Linie/Route muss allerdings aktiviert sein:
				(L.L.RBL_Linie) 0 = !
				(L.L.RBL_Route) 0 = ! &&
				{if}
'erstmal setzen des KM-Counters, wenn Fahrzeug in Bewegung gesetzt wird:
					(L.L.Velocity) 0.1 >
					(L.L.RBL_kmcounter_lock) ! &&
					{if}
						(L.L.kmcounter_m) (S.L.RBL_kmcounter_start)
						1 (S.L.RBL_kmcounter_lock)
						0 (S.L.RBL_Ansage_lock)
					{endif}
'Startcounter vom Istcounter abziehen, um gefahrene Strecke zu ermitteln:
					(L.L.kmcounter_m) (L.L.RBL_kmcounter_start) - 50 >
					(L.L.RBL_Ansage_lock) ! &&
					{if}
'Wenn Fahrzeug 50m bewegt, Fortschaltung Triggern und Locken:
						(L.L.RBL_Busstop) 1 + (L.L.RBL_Busstopcount) <
						{if}
							(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
							(M.L.RBL_PlayAnnouncement)
							1 (S.L.RBL_Ansage_lock)
							0 (S.L.RBL_lock_lock)
						{else}
							(L.L.RBL_Busstop) 1 + (S.L.RBL_Busstop)
							1 (S.L.RBL_Routeswitch)
							(T.L.ev_IBIS_entwerter)
							1 (S.L.RBL_Ansage_lock)
							0 (S.L.RBL_lock_lock)
						{endif}
					{endif}
'Wenn Fahrzeug steht und Türen auf, dann Rücksetzen des Counters und Freigabe des Ansagentriggers:
					(L.L.door_0) 0.01 >
					(L.L.door_2) 0.01 > ||
					(L.L.door_4) 0.01 > ||
					(L.L.Velocity) 0.1 < &&
					(L.L.RBL_lock_lock) ! &&
					{if}
						1 (S.L.RBL_lock_lock)
						0 (S.L.RBL_kmcounter_lock)
					{endif}
				{endif}
			{endif}
		{endif}
'Entwerter-Weiterschaltung:
		(L.L.RBL_Busstop) (L.L.RBL_Busstop_entw) = ! (L.L.bremse_halte) &&
		{if}
			(L.L.RBL_Busstop) (S.L.RBL_Busstop_entw)
			(T.L.ev_IBIS_entwerter_weiter)
		{endif}

		(L.L.RBL_Busstop) (L.L.RBL_Busstop_prev) = !
		{if}
			(L.L.RBL_Busstop) 0 =
			{if}
				0 (S.L.DelayLockStart)
			{endif}
			(L.L.RBL_Busstop) (S.L.RBL_Busstop_prev)
		{endif}	
	
		(L.L.EVEND_Mode) 2 >
		(L.L.var_EVENDPC2_Modeswitching) &&
		{if}
			(L.L.Velocity) 1 >
			{if}
				(L.L.Drivemode_Lock) !
				{if}
					(L.L.Drivemode_Timer) (L.S.Timegap) + (S.L.Drivemode_Timer) s0
					l0 1.3 >
					{if}
						73 (S.L.Evend_Mode)
						1 (S.L.Drivemode_Lock)
						0 (S.L.Drivemode_Timer)
					{endif}
				{endif}
			{endif}
			(L.L.Velocity) 0.1 <
			{if}
				(L.L.Drivemode_Lock)
				(L.L.door_0) 0.1 > (L.L.door_2) 0.1 > (L.L.door_4) 0.1 > || || &&
				{if}
					(L.L.Drivemode_Timer) (L.S.Timegap) + (S.L.Drivemode_Timer) s0
					l0 1.3 >
					{if}
						0 (S.L.Drivemode_Lock)
						4 (S.L.Evend_Mode)
						0 (S.L.TicketPackLength)
						0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
						0 (S.L.Delay_Timer) 
						-1 (S.L.EVENDPC2_Ticket) (S.L.Ticket_ID)
						"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
						"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
						"" (S.$.String_Login) (S.$.String_Einstellungen)
						0 (S.L.Drivemode_Timer)
					{endif}
				{endif}
			{endif}
		{endif}
		
		
		(L.L.Evend_Mode) 4 <
		{if}
		""	" @" "ODBAVOVACI ZARIZENI OCC" $+ " @ @" $+ 
		(S.$.String_Kundenbildschirm)
		{endif}
		(L.L.Evend_Mode) 4 =
		{if}
		""	" @" "DOBRY DEN" $+ " @ @" $+ 
		(S.$.String_Kundenbildschirm)
		{endif}
		(L.L.Evend_Mode) 5 =
		{if}
		"" "@1x " (L.$.TicketString_Name) $+
		"@Cena:    " $+ " " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
		(S.$.String_Kundenbildschirm)
		{endif}
	{endif}
	
	(L.L.elec_busbar_main)
	{if}
		(L.L.Evend_Mode) 70 =
		(L.L.Evend_Mode) 71 = ||
		(L.L.Evend_Mode) 72 = ||
		(L.L.Evend_Mode) 73 = ||
		(L.L.Evend_Mode) 74 = ||
		(L.L.Evend_Mode) 75 = ||
		(L.L.Evend_Mode) 76 = ||
		(L.L.Evend_Mode) 77 = ||
		{if}
			1 (S.L.Clickspot_RBL_Enabled)
			0 (S.L.Button_U1) (S.L.Button_U2)
			0 (S.L.Button_U3) (S.L.Button_U4) (S.L.Clickspot_Unten_Enabled) (S.L.Clickspot_Ticketblock_Enabled)
			0 (S.L.EVENDPC_Ticketmode_oben) (S.L.EVENDPC_Ticketmode_unten)
			0 (S.L.Clickspot_TicketVerkauf_Enabled) (S.L.EVENDPC_TicketVerkauf_Abbruch) (S.L.EVENDPC_TicketVerkauf_OK)
			0 (S.L.EVENDPC2_ticket_pos) (S.L.Strings_Generate) 
			0 (S.L.Clickspot_Ticketblock_Updn_Enabled)
		{else}
			0 (S.L.Clickspot_RBL_Enabled)
			"" (S.$.RBL_String_Display) (S.$.RBL_Display)
		{endif}
		
		(L.L.RBL_RouteIndex) 0 >=
		{if}
		
'	Automatischer Wechsel der Route, wenn Fortschaltung Ziel berspringt und schonmal geschildert war:
			(L.L.RBL_Routeswitch)
			{if}
				(L.L.RBL_Busstop) (L.L.RBL_RouteIndex) (M.V.GetBusstopCount) >=
				{if}
					(L.L.RBL_Route) s0
					1.5 <
					{if}
						2 s1 (S.L.RBL_Route)
					{else}
						l0 2.5 <
						{if}
							1 s1 (S.L.RBL_Route)
						{endif}
					{endif}
					(L.L.RBL_Linie) 100 * l1 + (M.V.GetRouteIndex) s2 0 >=
					{if}
'Wenn gltig, dann wechsele:
						(L.L.RBL_Linie) 100 * l1 + (M.V.GetRouteIndex) (S.L.RBL_RouteIndex) (M.V.GetRouteTerminusIndex) (S.L.RBL_TerminusIndex) (M.V.GetTerminusCode) (S.L.RBL_TerminusCode)
'Abspielen der Ansage
						0 (S.L.RBL_Busstop)
						(M.L.RBL_PlayAnnouncement)
					{endif}
				{endif}
				0 (S.L.RBL_Routeswitch)
			{endif}
'Berechnen der anzuzeigenden Haltestellen:
			(L.L.RBL_RouteIndex) s0 (M.V.GetBusstopCount) s1 (S.L.RBL_Busstopcount)
'			l0 -> Routenindex
'			l1 -> Haltestellencount der aktuellen Route
			
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 6 + >
			{if}
				l0 (L.L.RBL_Busstop) 6 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_1)
			{else}
				"" (S.$.RBL_HST_1)
			{endif}
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 5 + >
			{if}
				l0 (L.L.RBL_Busstop) 5 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_2)
			{else}
				"" (S.$.RBL_HST_2)
			{endif}
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 4 + >
			{if}
				l0 (L.L.RBL_Busstop) 4 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_3)
			{else}
				"" (S.$.RBL_HST_3)
			{endif}
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 3 + >
			{if}
				l0 (L.L.RBL_Busstop) 3 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_4)
			{else}
				"" (S.$.RBL_HST_4)
			{endif}
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 2 + >
			{if}
				l0 (L.L.RBL_Busstop) 2 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_5)
			{else}
				"" (S.$.RBL_HST_5)
			{endif}
			(L.L.RBL_Busstopcount) (L.L.RBL_Busstop) 1 + >
			{if}			
				l0 (L.L.RBL_Busstop) 1 + l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_6)
			{else}
				"" (S.$.RBL_HST_6)
			{endif}
			l0 (L.L.RBL_Busstop) l1 1 - min (M.V.GetRouteBusstopIdent) (M.V.GetBusstopIndex) 3 (M.V.GetBusstopString) (S.$.RBL_HST_7)
		{endif}
'EVEND Mode 0 - Boot
		(L.L.EVEND_Mode) !
		{if}
			(L.$.EVENDPC2_Timemode) "_N.dds" $=
			{if}
				1 (S.L.Anzeige_Mode)
			{else}
				0 (S.L.Anzeige_Mode)
			{endif}
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_Menu_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			"" (S.$.Ticket_String_A) (S.$.Ticket_PrintString)  (S.$.String_Login)
'			0 $IntToStr (S.$.LoginString)
			(L.L.EVEND_Init_Timer) (L.S.Timegap) + (S.L.EVEND_init_timer) s0
			l0 1 <
			{if}
				"EVENDPC2\Boot.dds" (S.$.EVENDPC2_Basetexture)
			{else}
				1 (S.L.EVEND_Mode)
				"" (S.$.LoginString)
			{endif}
		{endif}
'EVEND Mode 1 - Fahrerkarte stecken
		(L.L.EVEND_Mode) 1 =
		{if}
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			"" (S.$.Ticket_String_A) (S.$.Ticket_PrintString) (S.$.String_Abmeldung)  (S.$.String_Login)
			(L.L.EVEND_Fahrerkarte) !
			{if}
				"EVENDPC2\Karte_rein" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{else}
				(C.L.EVEND_Fahrernummer) !
				{if}
					(L.L.EVEND_Fahrernummer_Autoassign) !
					{if}
						500 random 2003500 + (S.L.EVEND_Fahrernummer)
						1 (S.L.EVEND_Fahrernummer_Autoassign)
					{endif}
				{else}
					(C.L.EVEND_Fahrernummer) (S.L.EVEND_Fahrernummer)
				{endif}
				(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 2 >
				{if}
					0 (S.L.Delay_Timer)
					2 (S.L.EVEND_Mode)
					"" (S.$.LoginString)
				{endif}
			{endif}
		{endif}
'EVEND Mode 2 - Login
		(L.L.EVEND_Mode) 2 =
		{if}
			0 (S.L.Clickspot_Ticketblock_Enabled)
			1 (S.L.Clickspot_Enabled)
			1 (S.L.Clickspot_Unten_Enabled)
			"" (S.$.Ticket_String_A) (S.$.Ticket_PrintString) (S.$.String_Abmeldung)
			(L.$.LoginString) $length s0
			(L.L.EVENDPC2_Loggedin) !
			{if}
				0 (S.L.Clickspot_Menu_Enabled)
				0 (S.L.Clickspot_TicketVerkauf_Enabled)
				0 (S.L.Clickspot_Verkauf_Enabled)
				l0 4 <=
				{if}
					"EVENDPC2\Pin_rein" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				{else}
					"EVENDPC2\Pin_OK" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				{endif}
				(L.L.EVENDPC2_Login) 0 >=
				{if}
					"" (L.$.LoginString) $length 7 <=
					{if}
						(L.$.LoginString) (L.L.EVENDPC2_Login) $IntToStr $+ (S.$.LoginString)
						-1 (S.L.EVENDPC2_Login)
					{endif}
				{endif}
				(L.L.EVENDPC2_Login) -90 =
				{if}
					(L.$.LoginString) 1 $cutEnd $StrToFloat trunc 0 max $IntToStr (S.$.LoginString)
					-1 (S.L.EVENDPC2_Login)
				{endif}
				(L.L.EVENDPC2_Login) -99 =
				{if}
					0 $IntToStr (S.$.LoginString)
					-1 (S.L.EVENDPC2_Login)
				{endif}
				"" (L.L.EVEND_Fahrernummer) $IntToStr $+ (S.$.Fahrerstring)
				"" "*" l0 1 - $* (S.$.Sternstring)

				"" (L.$.Fahrerstring) $+ "@" $+ "" $+ (L.$.Sternstring) $+ (S.$.String_Login)

				(L.$.LoginString) $StrToFloat s1
				(C.L.EVEND_Fahrerpin) l1 = 
				l1 0000 = ||
				{if}
					(L.L.Button_U4) 1 =
					(L.L.Button_U5) 1 = ||
					{if}
						(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 1 >
						{if}
							-1 (S.L.Button_U4)
							-1 (S.L.Button_U5)
							0 (S.L.Delay_Timer)
							1 (S.L.EVENDPC2_Loggedin)
							3 (S.L.EVEND_Mode)
							0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference) (S.L.TicketPackLength)
						{endif}
					{endif}
				{else}
					(L.L.Button_U5) 1 = ||
					{if}
						(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 1 >
						{if}
							-1 (S.L.Button_U5)
							0 (S.L.Delay_Timer)
							90 (S.L.EVEND_Mode)
						{endif}
					{endif}
				{endif}
			{else}
				0 (S.L.Clickspot_Enabled)
				0 (S.L.Clickspot_Ticketblock_Enabled)
				1 (S.L.Clickspot_Unten_Enabled)
				0 (S.L.Clickspot_TicketVerkauf_Enabled)
				1 (S.L.Clickspot_Menu_Enabled)
				1 (S.L.Clickspot_Verkauf_Enabled)
				(L.L.Pause) !
				{if}
					"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB) (S.$.Ticket_PrintString)
					"" (L.L.EVEND_Fahrernummer) $IntToStr $+ "@" $+ (S.$.String_Login)
					"Verkäufer " (L.L.EVEND_Fahrernummer) $IntToStr $+ " angemeldet." $+ (S.$.String_Abmeldung)
						"EVENDPC2\Abmeldung" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					(L.L.Button_U5) 1 =
					{if}
						0 $IntToStr (S.$.LoginString)
						0 (S.L.EVEND_Fahrerkarte)
						-1 (S.L.Button_U5)
						1 (S.L.Pause)

					{endif}
					(L.L.Button_Verkauf) 1 =
					{if}
						0 (S.L.EVEND_init_timer) (S.L.GotHeaderInfo)
						0 (S.L.EVEND_Fahrerkarte) (S.L.EVEND_Fahrernummer) (S.L.EVEND_Fahrernummer_Autoassign)
						0 (S.L.EVENDPC2_Login) (S.L.Delay_Timer) (S.L.Clickspot_Enabled) (S.L.Button_U1) (S.L.Button_U2)
						0 (S.L.Button_U3) (S.L.Button_U4) (S.L.Clickspot_Unten_Enabled) (S.L.Clickspot_Ticketblock_Enabled)
						0 (S.L.TicketPackLength) (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference) (S.L.GotHeaderInfo)
						0 (S.L.EVENDPC_Ticketmode_oben) (S.L.EVENDPC_Ticketmode_unten) 
						0 (S.L.Clickspot_TicketVerkauf_Enabled) (S.L.EVENDPC_TicketVerkauf_Abbruch) (S.L.EVENDPC_TicketVerkauf_OK)
						0 (S.L.EVENDPC2_ticket_pos) (S.L.Strings_Generate) 0 (S.L.Clickspot_Ticketblock_Updn_Enabled)
						0 (S.L.EVENDPC2_Loggedin)
						"" (S.$.String_Kopfzeile) (S.$.String_Login) (S.$.Ticket_String_AA) (S.$.String_Abmeldung)
						"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
						"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
						"" (S.$.Ticket_PrintString) (S.$.TicketString_Convert) (S.$.TicketString_Preis)
						"" (S.$.TicketString_Preis_Cent) (S.$.TicketString_Preis_Euro) (S.$.TicketString_Name)
						-1 (S.L.Button_Verkauf)
						1 (S.L.Evend_Mode)
					{endif}
					
				{else}
					"Verkäufer " (L.L.EVEND_Fahrernummer) $IntToStr $+ " in Pause. Bitte Karte Stecken!" $+ (S.$.String_Abmeldung)
					0 $IntToStr (S.$.LoginString)
					"" (S.$.Ticket_String_AA)
					"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
					"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
					"" (S.$.Ticket_PrintString) (S.$.TicketString_Convert) (S.$.TicketString_Preis)
					"" (S.$.TicketString_Preis_Cent) (S.$.TicketString_Preis_Euro) (S.$.TicketString_Name)
				{endif}
			{endif}
		{endif}
		
		(L.L.EVEND_Mode) 3 =
		{if}		
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			1 (S.L.Clickspot_Menu_Enabled)
			"" (S.$.String_Login) (S.$.Ticket_String_A) (S.$.Ticket_PrintString) (S.$.String_Abmeldung)
				"EVENDPC2\Pin_Korrekt" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 2 >
			{if}
				4 (S.L.EVEND_Mode)
				0 (S.L.Delay_Timer)
			{endif}
		{endif}
		(L.L.EVEND_Mode) 4 =
		{if}
			(L.L.Button_U5) 1 =
			{if}
				2 (S.L.Evend_Mode)
				-1 (S.L.Button_U5)
			{endif}
			(L.L.Button_U4) 1 =
			{if}
				9999 (S.L.Evend_Mode)
				-1 (S.L.Button_U4)
			{endif}
			0 (S.L.Clickspot_Enabled)
			1 (S.L.Clickspot_Menu_Enabled)
			1 (S.L.Clickspot_Unten_Enabled)
			1 (S.L.Clickspot_Ticketblock_Enabled)
			0 (S.L.Clickspot_Verkauf_Enabled)
			"" (S.$.Ticket_PrintString) (S.$.String_Abmeldung)
			(L.$.Yard) "Ruhrgebiet" $=
			{if}
				(M.L.GenerateRuhrgebietTicketStrings)
			{else}
				(L.L.GotTicketPackLength) !
				{if}
					(M.L.GetTicketPackLength)
				{else}
					(L.L.GotTicketPackDifference) !
					{if}
						(M.L.AddLineBreaksForTicketString)
					{endif}
				{endif}
			{endif}
			0 (S.L.Clickspot_Ticketblock_Updn_Enabled)	
			"EVENDPC2\Verkauf_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
		{endif}
		
		
		(L.L.EVEND_Mode) 5 =
		{if}
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			0 (S.L.Clickspot_Ticketblock_Enabled)
			1 (S.L.Clickspot_TicketVerkauf_Enabled)
			1 (S.L.Clickspot_Menu_Enabled)
			0 (S.L.Clickspot_Verkauf_Enabled)
				"EVENDPC2\Verkauf_Druck" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB) (S.$.String_Abmeldung)
			(L.$.Yard) "Ruhrgebiet" $=
			{if}
				(L.L.EVENDPC2_Ticket) 0 =
				{if}
					"" 0 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
					"" (L.$.TicketString_Preis) $length 3 =
					{if}
						"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
						"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
					{endif}
					"" (L.$.TicketString_Preis) $length 4 =
					{if}
						"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
						"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
					{endif}	
					"" 0 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
					"" (L.$.TicketString_Name) $+ "@" $+ 
					"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
					"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
				{else}
					(L.L.EVENDPC2_Ticket) 3 =
					{if}
						"" 1 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
						"" (L.$.TicketString_Preis) $length 3 =
						{if}
							"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
							"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
						{endif}
						"" (L.$.TicketString_Preis) $length 4 =
						{if}
							"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
							"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
						{endif}	
						"" 1 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
						"" (L.$.TicketString_Name) $+ "@" $+ 
						"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
						"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
					{else}
						(L.L.EVENDPC2_Ticket) 6 =
						{if}
							"" 2 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
							"" (L.$.TicketString_Preis) $length 3 =
							{if}
								"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
								"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
							{endif}
							"" (L.$.TicketString_Preis) $length 4 =
							{if}
								"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
								"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
							{endif}
							"" 2 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
							"" (L.$.TicketString_Name) $+ "@" $+ 
							"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
							"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
						{else}
							(L.L.EVENDPC2_Ticket) 9 =
							{if}
								"" 3 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
								"" (L.$.TicketString_Preis) $length 3 =
								{if}
									"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
									"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
								{endif}
								"" (L.$.TicketString_Preis) $length 4 =
									{if}
									"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
									"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
								{endif}
								"" 3 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
								"" (L.$.TicketString_Name) $+ "@" $+ 
								"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
								"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
							{else}
								(L.L.EVENDPC2_Ticket) 12 =
								{if}
									"" 4 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
									"" (L.$.TicketString_Preis) $length 3 =
									{if}
										"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
										"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
									{endif}
									"" (L.$.TicketString_Preis) $length 4 =
									{if}
										"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
										"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
									{endif}
									"" 4 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
									"" (L.$.TicketString_Name) $+ "@" $+ 
									"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
									"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
								{else}
									(L.L.EVENDPC2_Ticket) 15 =
									{if}
										"" 5 (S.L.Ticket_ID) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
										"" (L.$.TicketString_Preis) $length 3 =
										{if}
											"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
											"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
										{endif}
										"" (L.$.TicketString_Preis) $length 4 =
										{if}
											"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
											"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
										{endif}
										"" 5 (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
										"" (L.$.TicketString_Name) $+ "@" $+ 
										"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
										"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
									{else}
										6 (S.L.Ticket_ID) 
										(L.L.EVENDPC2_Ticket) s0
										l0 1 =
										{if}
											"5" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene Kurzstrecke" (S.$.TicketString_Name)
										{endif}
										l0 2 =
										{if}
											"1" (S.$.TicketString_Preis_Euro) "60" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene (Kurzstrecke)" (S.$.TicketString_Name)
										{endif}	
										l0 4 =
										{if}
											"10" (S.$.TicketString_Preis_Euro) "00" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene Preisstufe A1" (S.$.TicketString_Name)
										{endif}	
										l0 5 =
										{if}
											"5" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"4er Karte Kind (Kurzstrecke)" (S.$.TicketString_Name)
										{endif}
										l0 7 =
										{if}
											"20" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene Preisstufe B" (S.$.TicketString_Name)
										{endif}	
										l0 8 =
										{if}
											"3" (S.$.TicketString_Preis_Euro) "40" (S.$.TicketString_Preis_Cent)
											"Zusatzticket" (S.$.TicketString_Name)
										{endif}	
										l0 10 =
										{if}
											"42" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene Preisstufe C" (S.$.TicketString_Name)
										{endif}	
										l0 11 =
										{if}
											"12" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
											"4er Karte Zusatz" (S.$.TicketString_Name)
										{endif}	
										l0 13 =
										{if}
											"52" (S.$.TicketString_Preis_Euro) "50" (S.$.TicketString_Preis_Cent)
											"4er Karte Erwachsene Preisstufe D" (S.$.TicketString_Name)
										{endif}	
										l0 14 =
										{if}
											"4" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"Einfach Weiter ERW" (S.$.TicketString_Name)
										{endif}	
										l0 15 =
										{if}
											"6" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
											"TagesTicket 1 Person" (S.$.TicketString_Name)
										{endif}	
										l0 16 =
										{if}
											"12" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
											"Schönes WE 1 Person" (S.$.TicketString_Name)
										{endif}	
										l0 17 =
										{if}
											"5" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
											"SchönerTag 1 Person" (S.$.TicketString_Name)
										{endif}	
										l0 18 =
										{if}
											"13" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
											"TagesTicket 2 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 19 =
										{if}
											"24" (S.$.TicketString_Preis_Euro) "00" (S.$.TicketString_Preis_Cent)
											"Schönes WE 2 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 20 =
										{if}
											"27" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"SchönerTag 5 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 21 =
										{if}
											"19" (S.$.TicketString_Preis_Euro) "10" (S.$.TicketString_Preis_Cent)
											"TagesTicket 3 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 22 =
										{if}
											"35" (S.$.TicketString_Preis_Euro) "00" (S.$.TicketString_Preis_Cent)
											"Schönes WE 3 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 23 =
										{if}
											"4" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"SchöneFahrt Erwachsene" (S.$.TicketString_Name)
										{endif}	
										l0 24 =
										{if}
											"25" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"TagesTicket 4 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 25 =
										{if}
											"45" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"Schönes WE 4 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 26 =
										{if}
											"2" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"Schöne Fahrt Kind" (S.$.TicketString_Name)
										{endif}	
										l0 27 =
										{if}
											"34" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
											"TagesTicket 5 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 28 =
										{if}
											"52" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"Schönes WE 5 Personen" (S.$.TicketString_Name)
										{endif}	
										l0 29 =
										{if}
											"2" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
											"Fahrrad Tageskarte NRW" (S.$.TicketString_Name)
										{endif}	
										"" (L.$.TicketString_Name) $+ "@" $+ 
										"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
										"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
									{endif}
								{endif}
							{endif}
						{endif}
					{endif}
				{endif}
			{else}
				(L.L.EVENDPC2_Ticket) 5 <=
				{if}
					(L.L.EVENDPC2_Ticket) (S.L.Ticket_ID)
					"" (L.L.EVENDPC2_Ticket) (M.V.GetTicketValue) 100 * 0.005 + trunc $IntToStr $+ (S.$.TicketString_Preis)	
					"" (L.$.TicketString_Preis) $length 3 =
					{if}
						"" (L.$.TicketString_Preis) 1 $SetLengthL (S.$.TicketString_Preis_Euro)
						"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
					{endif}
					"" (L.$.TicketString_Preis) $length 4 =
					{if}
						"" (L.$.TicketString_Preis) 2 $SetLengthL (S.$.TicketString_Preis_Euro)
						"" (L.$.TicketString_Preis) 2 $SetLengthR (S.$.TicketString_Preis_Cent)
					{endif}	
					"" (L.L.EVENDPC2_Ticket) (M.V.GetTicketName) (M.L.TicketStringRemoveLineBreak) $+ (S.$.TicketString_Name)
					"" (L.$.TicketString_Name) $+ "@" $+ 
					"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
					"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)
				{else}
					(L.L.EVENDPC2_Ticket) (S.L.Ticket_ID) s0
					l0 5 =
					{if}
						"5" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"4er Karte Kind K-D" (S.$.TicketString_Name)
					{endif}	
					l0 6 =
					{if}
						"6" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
						"Tageskarte Erwachsene Preisstufe A" (S.$.TicketString_Name)
					{endif}	
					l0 7 =
					{if}
						"20" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"4er Karte Erwachsene Preisstufe B" (S.$.TicketString_Name)
					{endif}	
					l0 8 =
					{if}
						"3" (S.$.TicketString_Preis_Euro) "40" (S.$.TicketString_Preis_Cent)
						"ZusatzTicket" (S.$.TicketString_Name)
					{endif}	
					l0 9 =
					{if}
						"1" (S.$.TicketString_Preis_Euro) "60" (S.$.TicketString_Preis_Cent)
						"EinzelTicket Kind K-D" (S.$.TicketString_Name)
					{endif}	
					l0 10 =
					{if}
						"42" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
						"4er Karte Erwachsene Preisstufe C" (S.$.TicketString_Name)
					{endif}	
					l0 11 =
					{if}
						"12" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
						"4er Karte Zusatz" (S.$.TicketString_Name)
					{endif}	
					l0 12 =
					{if}
						"0" (S.$.TicketString_Preis_Euro) "60" (S.$.TicketString_Preis_Cent)
						"Kurzstrecke Kind K-D" (S.$.TicketString_Name)
					{endif}	
					l0 13 =
					{if}
						"52" (S.$.TicketString_Preis_Euro) "50" (S.$.TicketString_Preis_Cent)
						"4er Karte Erwachsene Preisstufe D" (S.$.TicketString_Name)
					{endif}	
					l0 14 =
					{if}
						"4" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"Einfach Weiter ERW" (S.$.TicketString_Name)
					{endif}	
					l0 15 =
					{if}
						"6" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
						"TagesTicket 1 Person" (S.$.TicketString_Name)
					{endif}	
					l0 16 =
					{if}
						"12" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
						"Schönes WE 1 Person" (S.$.TicketString_Name)
					{endif}	
					l0 17 =
					{if}
						"5" (S.$.TicketString_Preis_Euro) "80" (S.$.TicketString_Preis_Cent)
						"SchönerTag 1 Person" (S.$.TicketString_Name)
					{endif}	
					l0 18 =
					{if}
						"13" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
						"TagesTicket 2 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 19 =
					{if}
						"24" (S.$.TicketString_Preis_Euro) "00" (S.$.TicketString_Preis_Cent)
						"Schönes WE 2 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 20 =
					{if}
						"27" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"SchönerTag 5 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 21 =
					{if}
						"19" (S.$.TicketString_Preis_Euro) "10" (S.$.TicketString_Preis_Cent)
						"TagesTicket 3 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 22 =
					{if}
						"35" (S.$.TicketString_Preis_Euro) "00" (S.$.TicketString_Preis_Cent)
						"Schönes WE 3 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 23 =
					{if}
						"4" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"SchöneFahrt Erwachsene" (S.$.TicketString_Name)
					{endif}	
					l0 24 =
					{if}
						"25" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"TagesTicket 4 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 25 =
					{if}
						"45" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"Schönes WE 4 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 26 =
					{if}
						"2" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"Schöne Fahrt Kind" (S.$.TicketString_Name)
					{endif}	
					l0 27 =
					{if}
						"34" (S.$.TicketString_Preis_Euro) "20" (S.$.TicketString_Preis_Cent)
						"TagesTicket 5 Personen" (S.$.TicketString_Name)
					{endif}	
					l0 28 =
					{if}
						"52" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"Schönes WE 5 Personen" (S.$.Ticketstring_Name)
					{endif}	
					l0 29 =
					{if}
						"2" (S.$.TicketString_Preis_Euro) "90" (S.$.TicketString_Preis_Cent)
						"Fahrrad Tageskarte NRW" (S.$.TicketString_Name)
					{endif}	
					"" (L.$.TicketString_Name) $+ "@" $+ 
					"€ " $+ (L.$.TicketString_Preis_Euro) $+ "," $+ (L.$.TicketString_Preis_Cent) $+ "@" $+
					"1x " $+ (L.$.TicketString_Name) $+ (S.$.Ticket_PrintString)				
				{endif}
			{endif}
			(L.L.EVENDPC_TicketVerkauf_Abbruch)
			{if}
				0 (S.L.EVENDPC_Ticketmode_unten) (S.L.EVENDPC_Ticketmode_oben)
				-1 (S.L.EVENDPC2_Ticket)
				0 (S.L.EVENDPC_TicketVerkauf_Abbruch) (S.L.Delay_Timer)
				0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
				4 (S.L.EVEND_Mode)

			{endif}
			(L.L.EVENDPC_TicketVerkauf_OK)
			{if}
				6 (S.L.EVEND_Mode)
				-1 (S.L.EVENDPC2_Ticket)
				0 (S.L.EVENDPC_TicketVerkauf_OK) (S.L.Delay_Timer)
				0 (S.L.EVENDPC_Ticketmode_unten) (S.L.EVENDPC_Ticketmode_oben)
				(T.L.ev_printer_printing)
			{endif}
		{endif}
		(L.L.EVEND_Mode) 6 =
		{if}
			1 (S.L.Clickspot_Menu_Enabled)
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			0 (S.L.Clickspot_Ticketblock_Enabled)
			0 (S.L.Clickspot_TicketVerkauf_Enabled)
			"" (S.$.Ticket_PrintString) 
				"EVENDPC2\Verkauf_Drucken" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 1.5 >
			{if}
				(L.L.Ticket_ID) (S.L.GivenTicket)
				0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
				4 (S.L.EVEND_Mode)
				0 (S.L.Delay_Timer) 
				0 (S.L.EVENDPC_Ticketmode_oben) (S.L.EVENDPC_Ticketmode_unten)
			{endif}
			(L.L.Delay_Timer) 1 min (S.L.EVENDPC2_ticket_pos)
		{endif}
		
		(L.L.EVEND_Mode) 42 =
		{if}
			0 (S.L.Clickspot_Enabled)
			0 (S.L.Clickspot_RBL_Enabled)
			0 (S.L.Clickspot_TicketVerkauf_Enabled)
			0 (S.L.Clickspot_Unten_Enabled)
			1 (S.L.Clickspot_Menu_Enabled)
			0 (S.L.Clickspot_Ticketblock_Enabled)
			0 (S.L.Clickspot_Verkauf_Enabled)
			1 (S.L.Clickspot_Einstellungen_Enabled)
			"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
			
			(L.L.Einstellungen_Mode) 0 =
			{if}
				 (L.$.EVENDPC2_Basetexture_Settings) (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{endif}

			(L.L.Einstellungen_Mode) 1 =
			{if}
				".dds" (S.$.EVENDPC2_Timemode)
				0 (S.L.Anzeige_Mode)
				0 (S.L.Einstellungen_Mode)
			{endif}			
			(L.L.Einstellungen_Mode) 2 =
			{if}
				"_N.dds" (S.$.EVENDPC2_Timemode)
				1 (S.L.Anzeige_Mode)
				0 (S.L.Einstellungen_Mode)
			{endif}
			
			(L.L.Einstellungen_Mode) 3 =
			{if}
				0.8 (S.L.EVENDPC2_overlay_alphascale)
				""	"EVENDPC2\Einstellungen_T_MD" (S.$.EVENDPC2_Basetexture_Settings)
				0 (S.L.Einstellungen_Mode)
			{endif}
			(L.L.Einstellungen_Mode) 4 =
			{if}
				0.4 (S.L.EVENDPC2_overlay_alphascale)
				""	"EVENDPC2\Einstellungen_T_MH" (S.$.EVENDPC2_Basetexture_Settings)
				0 (S.L.Einstellungen_Mode)
			{endif}
			(L.L.Einstellungen_Mode) 5 =
			{if}
				0 (S.L.EVENDPC2_overlay_alphascale)
				""	"EVENDPC2\Einstellungen_T_MV" (S.$.EVENDPC2_Basetexture_Settings)
				0 (S.L.Einstellungen_Mode)
			{endif}
			(L.L.Einstellungen_Mode) 6 =
			{if}
			(L.L.Envir_Brightness) (F.L.invert) (S.L.EVENDPC2_overlay_alphascale)
				""	"EVENDPC2\Einstellungen_T_AH" (S.$.EVENDPC2_Basetexture_Settings)
				0 (S.L.Einstellungen_Mode)
			{endif}	
			(L.L.Einstellungen_Mode) 7 =
			{if}
			(L.L.Envir_Brightness) (F.L.invert2) (S.L.EVENDPC2_overlay_alphascale)
				""	"EVENDPC2\Einstellungen_T_AV" (S.$.EVENDPC2_Basetexture_Settings)
				0 (S.L.Einstellungen_Mode)
			{endif}			
		{else}	
			0 (S.L.Clickspot_Einstellungen_Enabled)		
		{endif}
'	#############################
'	R   B   L
'	#############################		
		(L.L.EVEND_Mode) 70 =
		{if}
			0 (S.L.Clickspot_Unten_Enabled) (S.L.Clickspot_Einstellungen_Enabled) (S.L.Clickspot_TicketVerkauf_Enabled)
			0 (S.L.Clickspot_Ticketblock_Enabled) (S.L.Clickspot_Verkauf_Enabled)
			"" (S.$.Ticket_String_AA)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString) (S.$.RBL_Display)
			"EVENDPC2\RBL_LK" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
'			Blinktimer fr Input:
			(L.L.RBL_Blinktimer) (L.S.Timegap) + (S.L.RBL_Blinktimer) s0
			l0 0.5 <
			{if}
				" " (L.$.RBL_String) $+ "_" $+ (S.$.RBL_String_Display)
			{else}
				l0 1 <
				{if}
						" " (L.$.RBL_String) $+ (S.$.RBL_String_Display)
				{else}
					0 (S.L.RBL_Blinktimer)
				{endif}
			{endif}
		{endif}
		(L.L.EVEND_Mode) 71 =
		{if}
			"" (S.$.Ticket_String_AA) (S.$.RBL_String_Display) (S.$.RBL_Display)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
			"EVENDPC2\RBL_Route" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
'			Blinktimer fr Input:
			(L.L.RBL_Blinktimer) (L.S.Timegap) + (S.L.RBL_Blinktimer) s0
			l0 0.5 <
			{if}
				" " (L.$.RBL_String) $+ "_" $+ (S.$.RBL_String_Display)
			{else}
				l0 1 <
				{if}
						" " (L.$.RBL_String) $+ (S.$.RBL_String_Display)
				{else}
					0 (S.L.RBL_Blinktimer)
				{endif}
			{endif}	
		{endif}
		(L.L.EVEND_Mode) 72 =
		{if}
			"" (S.$.Ticket_String_AA) (S.$.RBL_String_Display) (S.$.RBL_Display)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
'	Erstmal Trennen von Linie/Kurs und Suffix (sofern vorhanden):
			(L.L.RBL_LinieSuffix) 100 / trunc (S.L.RBL_Linie)
			(L.L.RBL_LinieSuffix) 100 % (S.L.RBL_Suffix)
'	berprfen, ob Linie/Route korrekt:			
			(L.L.RBL_Linie) 100 * (L.L.RBL_Route) + (M.V.GetRouteIndex) (S.L.RBL_RouteIndex)
			
'	Sofern Routeindex kleiner als 0, dann Fehlermeldung auswerfen:
			(L.L.RBL_RouteIndex) 0 <
			{if}
				0 (S.L.RBL_Linie) (S.L.RBL_Suffix)
				"EVENDPC2\RBL_Routefalsch" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
				(L.L.RBL_Reset_Timer) 2 >
				{if}
					"" (S.$.RBL_String)
					70 (S.L.EVEND_Mode)
					0 (S.L.RBL_Reset_Timer)
					0 (S.L.RBL_RouteIndex) (S.L.RBL_TerminusIndex) (S.L.RBL_TerminusCode)
				{endif}
'	Sonst Schildern vorbereiten:
			{else}
				"EVENDPC2\RBL_OK" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
'	Setzen des Routeindex, holen des Zielindex und holen des Zieltextes:
				(L.L.RBL_RouteIndex) (M.V.GetRouteTerminusIndex) (S.L.RBL_TerminusIndex) (M.V.GetTerminusCode) (S.L.RBL_TerminusCode)
'	Schreiben der Daten in die Matrix:
				(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
				(L.L.RBL_Reset_Timer) 2 >
				{if}
					"" (S.$.RBL_String)
					73 (S.L.EVEND_Mode)
					0 (S.L.RBL_Reset_Timer)
					0 (S.L.RBL_Busstop)
				{endif}			
			{endif}
		{endif}
		(L.L.EVEND_Mode) 73 =
		{if}
			"" (S.$.Ticket_String_AA)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
			"" (S.$.RBL_String_Display)
			
			(L.L.schedule_active)
			(L.L.RBL_LinieSuffix) 0 = ! &&
			(L.L.RBL_Route) 0 = ! &&
			{if}
				(M.V.GetTTDelay) s0
				l0 -90 <
'				(L.L.DelayLockTT1) ! &&
				{if}
					(L.L.DelayLockneg) !
					(L.L.RBL_Busstop) 0 = ! &&
					{if}
						(L.L.RBL_Soundlock) !
						{if}
							(T.L.ev_RBL_Sound)
							1 (S.L.RBL_Soundlock)
						{endif}
						1 (S.L.Delay_active)
						"EVENDPC2\RBL_neg" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					{else}
						0 (S.L.Delay_active)
						"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					{endif}
				{endif}
				l0 90 >
'				(L.L.DelayLockTT2) ! &&
				{if}
					(L.L.DelayLockpos) !
					{if}
						(L.L.RBL_Soundlock) !
						{if}
							(T.L.ev_RBL_Sound)
							1 (S.L.RBL_Soundlock)
						{endif}
						1 (S.L.Delay_active)
						"EVENDPC2\RBL_pos" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					{else}
						0 (S.L.Delay_active)
						"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					{endif}
				{endif}
				l0 90 <
				l0 -90 > &&
				{if}
					(L.L.RBL_Busstop) 0 =
					l0 10 >
					{if}
						(L.L.DelayLockStart) !
						(L.L.Velocity) 0.1 < &&
						{if}
							(L.L.RBL_Soundlock) !
							{if}
								(T.L.ev_RBL_Sound)
								1 (S.L.RBL_Soundlock)
							{endif}
							1 (S.L.Delay_active)
							"EVENDPC2\RBL_Abfahrt" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
						{else}							
							0 (S.L.Delay_active)
							"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
						{endif}
					{else}
						0 (S.L.Delay_active)
						"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
					{endif}						
				{endif}
				l0 0 >
				{if}
					0 (S.L.DelayLockneg)
				{else}
					0 (S.L.DelayLockpos)
				{endif}
			{else}
				0 (S.L.Delay_active)
				"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)				
			{endif}
'Anzeigen des Haltestellenverlaufes:
			(L.L.Delay_active) !
			{if}
				(L.L.RBL_RouteIndex) 0 >=
				{if}
					"  " (L.$.RBL_HST_1) $+ "@" $+
					"  " $+ (L.$.RBL_HST_2) $+ "@" $+
					"  " $+ (L.$.RBL_HST_3) $+ "@" $+
					"  " $+ (L.$.RBL_HST_4) $+ "@" $+
					"  " $+ (L.$.RBL_HST_5) $+ "@" $+
					"  " $+ (L.$.RBL_HST_6) $+ "@" $+
					" >" $+ (L.$.RBL_HST_7) $+
				{else}
					"  " "@" $+
					"  " $+ "@" $+
					"  " $+ "@" $+
					" Zadejte prosim linkospoj " $+ "@" $+
					"  " $+ "@" $+
					"  " $+ "@" $+
					"  " $+
				{endif}
			{else}
				"  " "@" $+
				"  " $+ "@" $+
				"  " $+ "@" $+
				"  " $+ "@" $+
				"  " $+ "@" $+
				"  " $+ "@" $+
				"  " $+
			{endif}			
			(S.$.RBL_Display)
		{endif}
		
		(L.L.Evend_Mode) 74 =
		{if}
			"EVENDPC2\RBL_Quit" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			"" (S.$.RBL_Display)
		{endif}
		(L.L.EVEND_Mode) 75 =
		{if}
			"" (S.$.Ticket_String_AA) (S.$.RBL_String_Display)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
			"EVENDPC2\RBL_Ziel" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			"   @@@@aktuelles Ziel: " (L.L.RBL_TerminusIndex) (M.V.GetTerminusCode) $IntToStr $+ (S.$.RBL_Display)
			(L.L.RBL_Blinktimer) (L.S.Timegap) + (S.L.RBL_Blinktimer) s0
			l0 0.5 <
			{if}
				" " (L.$.RBL_String) $+ "_" $+ (S.$.RBL_String_Display)
			{else}
				l0 1 <
				{if}
						" " (L.$.RBL_String) $+ (S.$.RBL_String_Display)
				{else}
					0 (S.L.RBL_Blinktimer)
				{endif}
			{endif}	
		{endif}
		(L.L.EVEND_Mode) 76 =
		{if}
			"" (S.$.Ticket_String_AA) (S.$.RBL_String_Display) (S.$.RBL_Display)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
'	Erstmal Checken ob Terminnuscode Valide:
			(L.L.RBL_Ziel) (M.V.GetTerminusIndex) s0
			0 <
			{if}
				"EVENDPC2\RBL_Zielfalsch" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
				(L.L.RBL_Reset_Timer) 2 >
				{if}
					"" (S.$.RBL_String)
					75 (S.L.EVEND_Mode)
					0 (S.L.RBL_Reset_Timer)
					0 (S.L.RBL_RouteIndex) (S.L.RBL_TerminusIndex) (S.L.RBL_TerminusCode)
				{endif}
			{else}
				"EVENDPC2\RBL_OK" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
				l0 (S.L.RBL_TerminusIndex)
				(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
				(L.L.RBL_Reset_Timer) 2 >
				{if}
					"" (S.$.RBL_String)
					73 (S.L.EVEND_Mode)
					0 (S.L.RBL_Reset_Timer)
					0 (S.L.RBL_Busstop)
				{endif}			
			{endif}
		{endif}

		(L.L.Evend_Mode) 77 =
		{if}
			"EVENDPC2\RBL_ZielQuit" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			"" (S.$.RBL_Display)
		{endif}
		
		(L.L.Evend_Mode) 78 =
		{if}
			(L.L.RBL_Soundlock) !
			{if}
				(T.L.ev_RBL_Sound)
				1 (S.L.RBL_Soundlock)
			{endif}
			(L.L.RBL_Ansage) !
			{if}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Ansage_aktiv" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{else}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Ansage_off" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{endif}	
			(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
			(L.L.RBL_Reset_Timer) 2 >
			{if}
				"" (S.$.RBL_String)
				73 (S.L.EVEND_Mode)
				0 (S.L.RBL_Reset_Timer)
				0 (S.L.RBL_Soundlock)
			{endif}						
		{endif}
		
		(L.L.Evend_Mode) 79 =
		{if}
			(L.L.RBL_Soundlock) !
			{if}
				(T.L.ev_RBL_Sound)
				1 (S.L.RBL_Soundlock)
			{endif}
			(L.L.RBL_Fortschaltung) !
			{if}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Fort_aktiv" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{else}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Fort_off" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{endif}
			(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
			(L.L.RBL_Reset_Timer) 2 >
			{if}
				"" (S.$.RBL_String)
				73 (S.L.EVEND_Mode)
				0 (S.L.RBL_Reset_Timer)
				0 (S.L.RBL_Soundlock)
			{endif}
		{endif}
		
		(L.L.Evend_Mode) 80 =
		{if}
			(L.L.RBL_Soundlock) !
			{if}
				(T.L.ev_RBL_Sound)
				1 (S.L.RBL_Soundlock)
			{endif}
			(L.L.RBL_Entwerter) !
			{if}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Entw_aktiv" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{else}
				"" (S.$.RBL_Display)
				"EVENDPC2\RBL_Entw_off" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			{endif}
			(L.L.RBL_Reset_Timer) (L.S.Timegap) + (S.L.RBL_Reset_Timer)
			(L.L.RBL_Reset_Timer) 2 >
			{if}
				"" (S.$.RBL_String)
				73 (S.L.EVEND_Mode)
				0 (S.L.RBL_Reset_Timer)
				0 (S.L.RBL_Soundlock)
			{endif}
		{endif}
					
		(L.L.EVEND_Mode) 90 =
		{if}
			"EVENDPC2\Pin_falsch" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			(L.L.Button_U1) 1 =
			{if}
				(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 1 >
				{if}
					2 (S.L.EVEND_Mode)
					-1 (S.L.Button_U1)
					0 (S.L.Delay_Timer)
				{endif}
			{endif}
		{endif}
		(L.L.EVEND_Mode) 9999 =
		{if}
			"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB)
			"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
			"" (S.$.String_Login) (S.$.String_Einstellungen) (S.$.String_Abmeldung)
			"EVENDPC2\Storno" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 2 >
			{if}
				4 (S.L.EVEND_Mode)
				0 (S.L.TicketPackLength)
				0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
				0 (S.L.Delay_Timer) 
			{endif}
		{endif}
'String Kopfzeile erstellen: Datum, Verbund/Betrieb, Fahrernummer:
'Nur wenn Mode >= 1
		(L.L.EVEND_Mode) 2 >=
		{if}
'Uhrzeit:
			(L.S.Time) 3600 / s0 trunc s1 "02" $IntToStrEnh (S.$.Uhrzeit_stunde) 
			(L.S.Time) 3600 / s0 trunc s1 l0 l1 - 60 * "02" $IntToStrEnh (S.$.Uhrzeit_Minute)
			(L.$.Uhrzeit_stunde) $StrToFloat 60 * 60 * s2
			(L.$.Uhrzeit_Minute) $StrToFloat 60 * s3
			""
			(L.S.Time) l2 l3 + - 10 <
			{if}
				0 $IntToStr (L.S.Time) l2 l3 + - $IntToStr $+ (S.$.Uhrzeit_sekunde)
			{else}
				(L.S.Time) l2 l3 + - $IntToStr $+ (S.$.Uhrzeit_sekunde)
			{endif}
'Fahrplanlage:
			""
			(M.V.GetTTDelay) s1 60 / s0
'		Minuten:
			l0 abs trunc " 2" $IntToStrEnh $+  
			(S.$.IBIS_Delay_min)
'		Zehntelminuten:
			l0 abs l0 abs trunc - 10 * " 1"  $IntToStrEnh 
			(S.$.IBIS_Delay_sec)
				l1 abs 6 >=
			{if}
				l0 0 >
				{if}
					"+"
				{else}
					"-"
				{endif}
			{else}
				" "
			{endif}
			(S.$.IBIS_Delay_state)
			(L.L.RBL_Linie) $IntToStr $length s0
'	Spalte 1
			"A" "@" $+
'	Spalte 2
			(L.L.RBL_Linie) !
			{if}
				"L: 000" $+ "@" $+
			{else}
				l0 1 =
				{if}
					"L: 00" $+ (L.L.RBL_Linie) $IntToStr $+ "@" $+
				{endif}
				l0 2 =
				{if}
					"L: 0" $+ (L.L.RBL_Linie) $IntToStr $+ "@" $+
				{endif}
				l0 3 =
				{if}
					"L: " $+ (L.L.RBL_Linie) $IntToStr $+ "@" $+
				{endif}
			{endif}
'	Spalte 3
			(L.L.RBL_Suffix) !
			{if}
				"K: 00" $+ "@" $+
			{else}
				"K: 0" $+ (L.L.RBL_Suffix) $IntToStr $+ "@" $+
			{endif}
'	Spalte 4
			(L.L.RBL_Route) !
			{if}
				"S: 00" $+ "@" $+
			{else}
				"R: 0" $+ (L.L.RBL_Route) $IntToStr $+ "@" $+
			{endif}
'	Spalte 5
			(L.L.RBL_TerminusIndex) (M.V.GetTerminusCode) s0 0 =
			{if}
				"Z: 000" $+ "@" $+
			{else}
				"Z: " $+ (L.L.RBL_TerminusIndex) (M.V.GetTerminusCode) $IntToStr $+ "@" $+
			{endif}
'	Spalte 6
			"W:000" $+ "@" $+
'	Spalte 7
			"ZG: 0" $+ "@" $+
'	Spalte 8
			"Ri: 0" $+ "@" $+
'	Spalte 9
			(L.L.door_0) 0.01 >
			(L.L.door_2) 0.01 > ||
			(L.L.door_4) 0.01 > ||
			{if}
				"[auf]" $+ "@" $+
			{else}
				"[zu]" $+ "@" $+
			{endif}
'	Spalte 10
			"[]" $+ "@" $+
'	Spalte 11
			"F " $+ (L.L.EVEND_Fahrernummer) $IntToStr $+ "@" $+
'	Spalte 12 - Versptung:
			(L.L.schedule_active)
			{if} 
				(M.V.GetTTDelay) -90 <
				{if}
					"*" $+
				{endif}
				(M.V.GetTTDelay) -90 >
				(M.V.GetTTDelay) 0 < &&
				{if}
					"-" $+
				{endif}
				(M.V.GetTTDelay) 0 >
				{if}
					"+" $+
				{endif}
				(L.$.IBIS_Delay_min) $RemoveSpaces $+ "." $+ (L.$.IBIS_Delay_sec) $+ "@" $+
			{else}
				" @" $+
			{endif}
'	Spalte 13 - Uhrzeit:
'aus Performancegründen ohne Sekunden - die Beiden zeilen einfach ein/auskommentieren, wenn Sekunden gezeigt werden sollen:
			(L.L.var_EVENDPC2_showseconds) !
			{if}
'ohne:
				(L.$.Uhrzeit_stunde) $+ ":" $+ (L.$.Uhrzeit_Minute) $+ "@" $+
			{else}			
'Mit Sekunden:

				(L.$.Uhrzeit_stunde) $+ ":" $+ (L.$.Uhrzeit_Minute) $+ ":" $+ (L.$.Uhrzeit_sekunde) $+ "@" $+
			{endif}

'	Spalte 14 - Datum:
			(L.S.Day) 9 <=
			{if}
				"0" $+ (L.S.Day) $IntToStr $+ "." $+
			{else}
				(L.S.Day) $IntToStr $+ "." $+
			{endif}
			(L.S.Month) 9 <=
			{if}
				"0" $+ (L.S.Month) $IntToStr $+ "." $+
			{else}
				(L.S.Month) $IntToStr $+ "." $+
			{endif}
			(L.S.Year) $IntToStr $+
'Schreiben der Kopfzeile:
			(S.$.String_Kopfzeile)
		{else}
			" " (S.$.IBIS_Delay_min) (S.$.IBIS_Delay_sec) (S.$.IBIS_Delay_state)
		{endif}
		(L.L.EVEND_Mode) 999 =
		{if}
			"" (S.$.Ticket_String_AA)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
			"EVENDPC2\Info.jpg" (S.$.EVENDPC2_Basetexture)
		{endif}
		
		(L.L.EVEND_Mode) 1000 =
		{if}
			"" (S.$.Ticket_String_AA)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"" (S.$.Ticket_PrintString)
			"EVENDPC2\Unfallruf" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
			(L.L.Delay_Timer) (L.S.Timegap) + (S.L.Delay_Timer) 3 >
			{if}
				4 (S.L.EVEND_Mode)
				0 (S.L.TicketPackLength)
				0 (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference)
				0 (S.L.Delay_Timer)
			{endif}
		{endif}
		(L.L.EVEND_Mode) 1001 =
		{if}
			"" (S.$.Ticket_String_AA)
			"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring)
			"EVENDPC2\EKS" (L.$.EVENDPC2_Timemode) $+  (S.$.EVENDPC2_Basetexture)
			"@@"
			0 (M.V.GetHumanCountOnSeat) 1 (M.V.GetHumanCountOnSeat) + 2 (M.V.GetHumanCountOnSeat) + 3 (M.V.GetHumanCountOnSeat) + 4 (M.V.GetHumanCountOnSeat) +
			5 (M.V.GetHumanCountOnSeat) + 6 (M.V.GetHumanCountOnSeat) + 7 (M.V.GetHumanCountOnSeat) + 8 (M.V.GetHumanCountOnSeat) + 9 (M.V.GetHumanCountOnSeat) +
			10 (M.V.GetHumanCountOnSeat) + 11 (M.V.GetHumanCountOnSeat) + 12 (M.V.GetHumanCountOnSeat) + 13 (M.V.GetHumanCountOnSeat) + 14 (M.V.GetHumanCountOnSeat) +
			15 (M.V.GetHumanCountOnSeat) + 16 (M.V.GetHumanCountOnSeat) + 17 (M.V.GetHumanCountOnSeat) + 18 (M.V.GetHumanCountOnSeat) + 19 (M.V.GetHumanCountOnSeat) +
			20 (M.V.GetHumanCountOnSeat) + 21 (M.V.GetHumanCountOnSeat) + 22 (M.V.GetHumanCountOnSeat) + 23 (M.V.GetHumanCountOnSeat) + 24 (M.V.GetHumanCountOnSeat) +
			25 (M.V.GetHumanCountOnSeat) + 26 (M.V.GetHumanCountOnSeat) + 27 (M.V.GetHumanCountOnSeat) + 28 (M.V.GetHumanCountOnSeat) + 29 (M.V.GetHumanCountOnSeat) +
			30 (M.V.GetHumanCountOnSeat) + 31 (M.V.GetHumanCountOnSeat) + 32 (M.V.GetHumanCountOnSeat) + 33 (M.V.GetHumanCountOnSeat) + 34 (M.V.GetHumanCountOnSeat) +
			35 (M.V.GetHumanCountOnSeat) + 36 (M.V.GetHumanCountOnSeat) + 37 (M.V.GetHumanCountOnSeat) + 38 (M.V.GetHumanCountOnSeat) + 39 (M.V.GetHumanCountOnSeat) +
			40 (M.V.GetHumanCountOnSeat) + 41 (M.V.GetHumanCountOnSeat) + 42 (M.V.GetHumanCountOnSeat) + 43 (M.V.GetHumanCountOnSeat) + 44 (M.V.GetHumanCountOnSeat) +
			45 (M.V.GetHumanCountOnSeat) + 46 (M.V.GetHumanCountOnSeat) + 47 (M.V.GetHumanCountOnSeat) + 48 (M.V.GetHumanCountOnSeat) + 49 (M.V.GetHumanCountOnSeat) +
			50 (M.V.GetHumanCountOnSeat) + 51 (M.V.GetHumanCountOnSeat) + 52 (M.V.GetHumanCountOnSeat) + 53 (M.V.GetHumanCountOnSeat) + 54 (M.V.GetHumanCountOnSeat) +
			55 (M.V.GetHumanCountOnSeat) + 56 (M.V.GetHumanCountOnSeat) + 57 (M.V.GetHumanCountOnSeat) + 58 (M.V.GetHumanCountOnSeat) + 59 (M.V.GetHumanCountOnSeat) +
			60 (M.V.GetHumanCountOnSeat) + 61 (M.V.GetHumanCountOnSeat) + 62 (M.V.GetHumanCountOnSeat) + 63 (M.V.GetHumanCountOnSeat) + 64 (M.V.GetHumanCountOnSeat) +
			65 (M.V.GetHumanCountOnSeat) + 66 (M.V.GetHumanCountOnSeat) + 67 (M.V.GetHumanCountOnSeat) + 68 (M.V.GetHumanCountOnSeat) + 69 (M.V.GetHumanCountOnSeat) +
			70 (M.V.GetHumanCountOnSeat) + 71 (M.V.GetHumanCountOnSeat) + 72 (M.V.GetHumanCountOnSeat) + 73 (M.V.GetHumanCountOnSeat) + 74 (M.V.GetHumanCountOnSeat) +
			75 (M.V.GetHumanCountOnSeat) + 76 (M.V.GetHumanCountOnSeat) + 77 (M.V.GetHumanCountOnSeat) + 78 (M.V.GetHumanCountOnSeat) + 79 (M.V.GetHumanCountOnSeat) +
			80 (M.V.GetHumanCountOnSeat) + 81 (M.V.GetHumanCountOnSeat) + 82 (M.V.GetHumanCountOnSeat) + 83 (M.V.GetHumanCountOnSeat) + 84 (M.V.GetHumanCountOnSeat) +
			85 (M.V.GetHumanCountOnSeat) + 86 (M.V.GetHumanCountOnSeat) + 87 (M.V.GetHumanCountOnSeat) + 88 (M.V.GetHumanCountOnSeat) + 89 (M.V.GetHumanCountOnSeat) +
			90 (M.V.GetHumanCountOnSeat) + 91 (M.V.GetHumanCountOnSeat) + 92 (M.V.GetHumanCountOnSeat) + 93 (M.V.GetHumanCountOnSeat) + 94 (M.V.GetHumanCountOnSeat) +
			95 (M.V.GetHumanCountOnSeat) + 96 (M.V.GetHumanCountOnSeat) + 97 (M.V.GetHumanCountOnSeat) + 98 (M.V.GetHumanCountOnSeat) + 99 (M.V.GetHumanCountOnSeat) + "03" $IntToStrEnh $+
			" Fahrgäste im Fahrzeug" $+ (S.$.Ticket_PrintString)
		{endif}
	{else}
		0 (S.L.Anzeige_Prio)
		"EVENDPC2\Off.dds" (S.$.EVENDPC2_Basetexture)
		0 (S.L.EVEND_Mode) (S.L.EVEND_init_timer) (S.L.GotHeaderInfo)
		0 (S.L.EVEND_Fahrerkarte) (S.L.EVEND_Fahrernummer) (S.L.EVEND_Fahrernummer_Autoassign)
		0 (S.L.EVENDPC2_Login) (S.L.Delay_Timer) (S.L.Clickspot_Enabled) (S.L.Button_U1) (S.L.Button_U2)
		0 (S.L.Button_U3) (S.L.Button_U4) (S.L.Clickspot_Unten_Enabled) (S.L.Clickspot_Ticketblock_Enabled)
		0 (S.L.TicketPackLength) (S.L.GotTicketPackLength) (S.L.GotTicketPackDifference) (S.L.GotHeaderInfo)
		0 (S.L.EVENDPC_Ticketmode_oben) (S.L.EVENDPC_Ticketmode_unten) 
		-1 (S.L.EVENDPC2_Ticket) (S.L.Ticket_ID)
		0 (S.L.Clickspot_TicketVerkauf_Enabled) (S.L.EVENDPC_TicketVerkauf_Abbruch) (S.L.EVENDPC_TicketVerkauf_OK)
		0 (S.L.EVENDPC2_ticket_pos) (S.L.Strings_Generate) 0 (S.L.Clickspot_Ticketblock_Updn_Enabled)
		0 (S.L.EVENDPC2_Loggedin)
		0 (S.L.Anzeige_Mode)
		"" (S.$.String_Kopfzeile) (S.$.String_Login) (S.$.Ticket_String_AA) (S.$.String_Abmeldung)
		"" (S.$.Ticket_String_BB) (S.$.Ticket_PrintString) (S.$.Fahrerstring) (S.$.String_Einstellungen)
		"" (S.$.Ticket_String_A) (S.$.Ticket_String_B) (S.$.Ticket_String_A_Diff)
		"" (S.$.Ticket_PrintString) (S.$.TicketString_Convert) (S.$.TicketString_Preis)
		"" (S.$.TicketString_Preis_Cent) (S.$.TicketString_Preis_Euro) (S.$.TicketString_Name)
		"" (S.$.Ticket_String_AA) (S.$.Ticket_String_BB) (S.$.String_Abmeldung)
		"" (S.$.IBIS_Complex_Line) (S.$.String_Kopfzeile)
	{endif}

{end}

{macro:GetTicketPackLength}
	(L.L.TicketPackLength) (M.V.GetTicketValue) 100 * !
	{if}
		1 (S.L.GotTicketPackLength)
	{else}
		(L.L.TicketPackLength) s0
		(L.$.Ticket_String_A) l0 (M.V.GetTicketName) $+ "@ @" $+ (S.$.Ticket_String_A)
		(L.L.TicketPackLength) 1 + (S.L.TicketPackLength)
		0 (S.L.GotTicketPackLength)
	{endif}

{end}

{macro:AddLineBreaksForTicketString}
	(L.L.TicketPackLength) s0
		l0 14 =
		{if}
			"EinzelTicket@Erw. A"  (S.$.Ticket_String_A_Diff)
		{endif}
		l0 13 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K" (S.$.Ticket_String_A_Diff)
		{endif}
		l0 12 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K" (S.$.Ticket_String_A_Diff)
		{endif}
		l0 11 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A" (S.$.Ticket_String_A_Diff)
		{endif}
		l0 10 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A"
		(S.$.Ticket_String_A_Diff)
		{endif}
		l0 9 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D"
		(S.$.Ticket_String_A_Diff)
		{endif}
		l0 8 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 7 =
		{if}
			"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 6 =
		{if}
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@"
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 5 =
		{if}
			"4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 4 =
		{if}
			"4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 3 =
		{if}
			"KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		(S.$.Ticket_String_A_Diff)
		{endif}
		l0 2 =
		{if}
			"EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		l0 1 =
		{if}
			"4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
			"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
			"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_A_Diff)
		{endif}
		(L.$.Ticket_String_A) (L.$.Ticket_String_A_Diff) $+ (S.$.Ticket_String_AA)
		"TagesTicket@1 Person@Schönes WE@1 Person@SchönerTag@1 Person@TagesTicket@2 Personen@Schönes WE@2 Personen@SchönerTag@5 Personen@"
		"TagesTicket@3 Personen@Schönes WE@3 Personen@SchöneFahrt@Erwachsene@TagesTicket@4 Personen@Schönes WE@4 Personen@SchöneFahrt@Kind@" $+
		"TagesTicket@5 Personen@Schönes WE@5 Personen@Fahrrad@Tag NRW" $+ (S.$.Ticket_String_BB)
'		(L.$.Ticket_String_A) (S.$.Ticket_String_AA)
		1 (S.L.GotTicketPackDifference)
{end}

{macro:GenerateRuhrgebietTicketStrings}
'Block 1:
		"EinzelTicket@Erw. A@4erTicket@Erw. K@EinzelTicket@Erw. K@KurzStrecke@Erw. A@4erTicket@Erw.A@4erTicket@Kind K-D@"
		"TagesKarte@Erw. A@4erTicket@Erw. B@ @ZusatzTicket@EinzelTicket@Kind K-D@4erTicket@Erw. C@4erTicket@Zusatz@" $+
		"KurzStrecke@ Kind K-D @4erTicket@Erw. D@EinfachWeiter@ERW" $+ (S.$.Ticket_String_AA)
'Block 2:
		"TagesTicket@1 Person@Schönes WE@1 Person@SchönerTag@1 Person@TagesTicket@2 Personen@Schönes WE@2 Personen@SchönerTag@5 Personen@"
		"TagesTicket@3 Personen@Schönes WE@3 Personen@SchöneFahrt@Erwachsene@TagesTicket@4 Personen@Schönes WE@4 Personen@SchöneFahrt@Kind@" $+
		"TagesTicket@5 Personen@Schönes WE@5 Personen@Fahrrad@Tag NRW" $+ (S.$.Ticket_String_BB)
{end}

{macro:TicketStringRemoveLineBreak}
		"" (S.$.TicketString_Convert) $+
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(M.L.TicketString_RemoveStep) (M.L.TicketString_RemoveStep)
		(L.$.TicketString_Convert)
{end}

{macro:TicketString_RemoveStep}
		$d $length 1 >
		{if}
			$d 2 $SetLengthR $d 1 $SetLengthL
			$d " " $= " " $= || !
			1 $SetLengthR &&
			{if}
				(M.L.TicketString_Remove)
			{endif}
			(L.$.TicketString_Convert) $+ (S.$.TicketString_Convert) 0 $* $+
			1 $cutEnd
		{endif}
		$d $length 1 =
		{if}
		  (L.$.TicketString_Convert) $+ (S.$.TicketString_Convert) ""
		  1 $cutEnd
		{endif}
{end}

{macro:TicketString_Remove}
		0
		d ! $d "@" $= && {if} 0 $* $+ " " {endif} d ! $d "-" $= && {if} 0 $* $+ " " {endif}
{end}

{trigger:IBIS_setmode_linie_kurs}

{end}

{trigger:IBIS_setmode_route}

{end}

{trigger:IBIS_setmode_ziel}

{end}

{trigger:IBIS_1}
	1 (M.L.IBIS_Zahlentasten)
{end}


{trigger:IBIS_2}
	2 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_3}
	3 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_4}
	4 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_5}
	5 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_6}
	6 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_7}
	7 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_8}
	8 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_9}
	9 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_0}
	0 (M.L.IBIS_Zahlentasten)
{end}

{trigger:IBIS_C}
	(L.L.Evend_Mode) 77 =
	{if}
		73 (S.L.Evend_Mode)
	{endif}
	(L.L.Evend_Mode) 75 =
	{if}
		77 (S.L.Evend_Mode)
	{endif}
	"" (S.$.RBL_String)
	(L.L.Evend_Mode) 74 =
	{if}
		73 (S.L.Evend_Mode)
	{endif}

	(L.L.Evend_Mode) 73 =
	{if}
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base.dds" $= !
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base_N.dds" $= ! ||
		(L.L.DelayLockneg) ! &&
		{if}
			1 (S.L.DelayLockneg)
'			1 (S.L.DelayLockTT1)
			0 (S.L.RBL_Soundlock)
			"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
		{endif}
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base.dds" $= !
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base_N.dds" $= ! ||
		(L.L.DelayLockpos) ! &&
		{if}
'			0 (S.L.DelayLockTT2)
			1 (S.L.DelayLockpos)
			0 (S.L.RBL_Soundlock)
			"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
		{endif}
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base.dds" $= !
		(L.$.EVENDPC2_Basetexture) "EVENDPC2\RBL_Base_N.dds" $= ! ||
		(L.L.DelayLockStart) ! &&
		{if}
			1 (S.L.DelayLockStart)
			0 (S.L.RBL_Soundlock)
			"EVENDPC2\RBL_Base" (L.$.EVENDPC2_Timemode) $+ (S.$.EVENDPC2_Basetexture)
		{endif}
	{endif}
	(L.L.Evend_Mode) 70 =
	(L.L.Evend_Mode) 71 = ||
	{if}
		74 (S.L.Evend_Mode)
	{endif}

{end}

{macro:IBIS_Zahlentasten}
	s0
	(L.L.EVEND_Mode) 70 =
	{if}
		(L.$.RBL_String) $length 4 <=
		{if}
			(L.$.RBL_String) l0 $IntToStr $+ (S.$.RBL_String)
		{endif}
	{endif}
	(L.L.EVEND_Mode) 71 =
	{if}
		(L.$.RBL_String) $length 1 <=
		{if}
			(L.$.RBL_String) l0 $IntToStr $+ (S.$.RBL_String)
		{endif}
	{endif}
	(L.L.EVEND_Mode) 75 =
	{if}
		(L.$.RBL_String) $length 2 <=
		{if}
			(L.$.RBL_String) l0 $IntToStr $+ (S.$.RBL_String)
		{endif}
	{endif}
{end}

{trigger:IBIS_eingabe}
	(L.L.EVEND_Mode) 77 =
	{if}
		0 (S.L.RBL_TerminusIndex)
		"" (S.$.RBL_String)
		0 (S.L.RBL_Reset_Timer)
		73 (S.L.EVEND_Mode)
	{endif}
	(L.L.EVEND_Mode) 75 =
	{if}
		(L.$.RBL_String) $RemoveSpaces $StrToFloat (S.L.RBL_Ziel)
		"" (S.$.RBL_String)
		0 (S.L.RBL_Reset_Timer)
		76 (S.L.EVEND_Mode)
	{endif}
	(L.L.Evend_Mode) 74 =
	{if}
		-1 (S.L.RBL_RouteIndex)
		0 (S.L.RBL_Route) (S.L.RBL_TerminusIndex) (S.L.RBL_Linie)
		0 (S.L.RBL_LinieSuffix) (S.L.RBL_TerminusCode)
		73 (S.L.Evend_Mode)
	{endif}
	(L.L.EVEND_Mode) 71 =
	{if}
		(L.$.RBL_String) $RemoveSpaces $StrToFloat (S.L.RBL_Route)
		"" (S.$.RBL_String)
		0 (S.L.RBL_Reset_Timer)
		72 (S.L.EVEND_Mode)
	{endif}
	(L.L.EVEND_Mode) 70 =
	{if}
		(L.$.RBL_String) $length 5 =
		{if}
			(L.$.RBL_String) $StrToFloat (S.L.RBL_LinieSuffix)
			"" (S.$.RBL_String)
			0 (S.L.RBL_Reset_Timer)
			71 (S.L.EVEND_Mode)
		{endif}
	{endif}
{end}

{macro:RBL_PlayAnnouncement}
	(L.L.RBL_RouteIndex) (L.L.RBL_busstop) (M.V.GetRouteBusstopIdent) (S.$.RBL_actbusstop)
	
	(L.L.RBL_busstop) 0 >
	{if}

		"..\..\Announcements\" 0 (M.V.GetDepotStringGlobal) "\" $+ $+ (L.$.RBL_actbusstop) $+ $msg

		(L.L.RBL_RouteIndex) (M.V.GetBusstopCount) 1 - (L.L.RBL_Busstop) <=
		{if}
			"_#terminus" $+
		{endif}

		".wav" $+
		(L.L.RBL_Ansage) !
		{if}
			(T.F.ev_IBIS_Ansagen)
		{endif}
	{endif}
{end}
