include "ScenarioBehavior.gs" include "gs.gs" // Здесь извращался Добрый :) class myScript isclass ScenarioBehavior { bool objectRunningDriver =false; Browser br=null, br1=null, br2=null; int height=Interface.GetDisplayHeight(); int width=Interface.GetDisplayWidth(); int puvs=0, pupop=0, puvsw=0, pu=0; // номeр пути для поездов int puin, puout; // номер пути для стрелок bool vstr=false, vstr2=false, poput=false, poput2=false, man=false; // признаки наличия поездов bool okno=true, order=false, del=false, sound=false, res=false, seven=false, depo=false; int is, im, it, its, np, npw, lk, ip, sos, sostavsize, ds, glav, tt, fl, um, itt=0, speed=90, razd=0, ii=1, st=0, var=1; int pr=1, prvs=2, prvsw=2; // приоритет Train traint, traint1, traint2, traint3, traint4, traint5, trainout, train0, train1, train2, train3, Mytrain; Train depo1, depo2, depo3, depo4, depo5, depo6, depo7, depo8; string trig, trigw, mark, markp, junin, junout, jm, text, oknotext, lg, lgp, lgw, lgz, jn, jc, dsp; bool nap=true; // направление движения нашего поезда: true - нечётное, false - чётное bool side=false; // dir false - правые двери, true - левые StringTable strTable; Message msg; SecurityToken token=null; KUID[] sostav; Vehicle[] veh0, vehd; DriverCharacter[] dcl; Vehicle one,two,one1,two1,one2,two2,loko0, loko1,loko2; Schedule train1Schedule, train2Schedule; float time, fTime; int iHours=0, iMins=0, iSecs=0; KUID prod; Asset product; ProductQueue[] queues; ProductQueue queue = null; Signal sig; public bool OnTrigger(Train train, string trigname, int stage) { string sourceName, minor; if (!stage) minor="Enter"; else if (stage==1) minor = "Stopped"; else minor="Leave"; GameObject source; Sniff(train, "Trigger", "", true); wait() { on "Trigger", "", msg : { source = msg.src, sourceName = source.GetName(); if (sourceName == trigname and msg.minor == minor) break; continue; } } Sniff(train, "Trigger", "", false); return true; } public bool OnJunction(Train train, string junname, int stage) { string sourceName, minor; if (!stage) minor="Enter"; else minor="Leave"; GameObject source; Sniff(train, "Junction", "", true); wait() { on "Junction", "", msg : { source = msg.src, sourceName = source.GetName(); if (sourceName == junname and msg.minor == minor) break; continue; } } Sniff(train, "Junction", "", false); return true; } Signal GetNextSignal(Vehicle veh){ // Функция поиска следующего сигнала GSTrackSearch GSTS = veh.BeginTrackSearch(true); // Создаём поиск MapObject obj = GSTS.SearchNext(); // Берём первый объект while(obj) { // Ищем, пока впереди есть хоть что-то if (GSTS.GetDistance()>1000) return null; // Если забрались дальше 1000 м, обрываем поиск if (GSTS.GetFacingRelativeToSearchDirection() and obj.isclass(Signal)) { return castobj;} // Если объект смотрит на нас и является сигналом, приводим тип к Signal и возвращаем obj = GSTS.SearchNext(); // Берём следующий объект } return null; // Если что-то пошло не так, возвращаем нуль } void ChangeJunc(string jName, int direct) { // Функция переключения стрелки Junction junction = cast Router.GetGameObject(jName); junction.SetDirection(token,direct); } // Функции для свистка встречного thread void HornThread(){ if (!train1.IsStopped()) Sleep(1.5), train1.SoundHorn(); } public void VstrHorn (Message ms){ if (ms.src == Mytrain and vstr) HornThread(); } // Функция открытия светофоров void SetNextSignals(Train train, int len, int cont){ Vehicle v=train.GetVehicles()[0]; len=len*1000; GSTrackSearch GSTS = v.BeginTrackSearch(true); MapObject obj = GSTS.SearchNext(); int sn=1; while(obj) { if (GSTS.GetDistance()>len or sn>cont) break; if (GSTS.GetFacingRelativeToSearchDirection() and obj.isclass(Signal)) { sig=castobj; PostMessage(sig,"CTRL","MayOpen^true",sn); ++sn; } obj = GSTS.SearchNext(); } Interface.Print ("sn="+sn); } // Функция розжига маневровых void SetNextShuntSignals(Train train, bool dir, int cont){ Vehicle v=train.GetVehicles()[0]; GSTrackSearch GSTS = v.BeginTrackSearch(dir); MapObject obj = GSTS.SearchNext(); int sn=1; while(obj) { if (GSTS.GetDistance()>2000 or sn>cont) break; if (GSTS.GetFacingRelativeToSearchDirection() and obj.isclass(Signal)) { sig=castobj; PostMessage(sig,"CTRL","ShuntMode.true",sn); ++sn; } obj = GSTS.SearchNext(); } Interface.Print ("sn="+sn); } thread void JunThread(){ // Нить переключения стрелок Jun: Interface.Print ("JunThread: ii="+ii+", pu="+pu+", puin="+puin+", puout="+puout); Sleep(1); if (razd==1) { if (ii==2) { // Новоалексеевка if (puin==2 and nap==false) {ChangeJunc("ff107",0); ChangeJunc("ff1",0);} else if (puin==3 and nap==false) {ChangeJunc("ff3",0); ChangeJunc("ff21",0); ChangeJunc("ff101",0); ChangeJunc("ff5",2);} else if (puin==4 and nap==false) {ChangeJunc("ff107",0); ChangeJunc("ff1",2); ChangeJunc("ff43",0);} else if (puin==6 and nap==false) {ChangeJunc("ff107",0); ChangeJunc("ff1",2); ChangeJunc("ff43",2); ChangeJunc("ff31",2);} if (puout==2 and nap==false) {ChangeJunc("ff2",2);} else if (puout==1 and nap==true) {ChangeJunc("ff105",0); ChangeJunc("ff3",2);} else if (puout==3 and nap==true) {ChangeJunc("ff3",0); ChangeJunc("ff21",0); ChangeJunc("ff5",2);} else if (puout==4 and nap==false) {ChangeJunc("ff2",0); ChangeJunc("ff33",2); ChangeJunc("ff38",0);} else if (puout==4 and nap==true) {ChangeJunc("ff107",2); ChangeJunc("ff1",2); ChangeJunc("ff43",0);} else if (puout==5 and nap==true) { ChangeJunc("ff7",2); ChangeJunc("ff3",0); ChangeJunc("ff21",0); ChangeJunc("ff5",0);} // else if (puout==6 and nap==false) {ChangeJunc("ff32",0); ChangeJunc("ff34",0);} else if (puout==6 and nap==true) {ChangeJunc("ff107",2); ChangeJunc("ff1",2); ChangeJunc("ff43",2); ChangeJunc("ff31",2);} } else if (ii==3) { // Сальково if (puin==1) {ChangeJunc("ee4",0);} else if (puin==3) {ChangeJunc("ee4",2);} else if (puin==2) {ChangeJunc("ee1",0);} else if (puin==4) {ChangeJunc("ee1",2);} if (puout==1) {ChangeJunc("ee3",2);} else if (puout==3) {ChangeJunc("ee3",0); ChangeJunc("ee21",0);} else if (puout==2) {ChangeJunc("ee2",2);} else if (puout==4) {ChangeJunc("ee2",0);} } else if (ii==4) { // Сиваш if (puin==1) {ChangeJunc("dd4",0);} else if (puin==3) {ChangeJunc("dd4",2);} else if (puin==2) {ChangeJunc("dd1",0);} else if (puin==4) {ChangeJunc("dd1",2);} if (puout==1) {ChangeJunc("dd3",2);} else if (puout==3) {ChangeJunc("dd3",0);} else if (puout==2) {ChangeJunc("dd2",2);} else if (puout==4) {ChangeJunc("dd2",0);} } else if (ii==5) { // Сол. Озеро if (puin==2) {ChangeJunc("cc1",0);} else if (puin==4) {ChangeJunc("cc1",2);} else if (puin==1) {ChangeJunc("cc4",0);} else if (puin==3) {ChangeJunc("cc4",2);} if (puout==2) {ChangeJunc("cc2",2);} else if (puout==4) {ChangeJunc("cc2",0);} else if (puout==1) {ChangeJunc("cc3",2);} else if (puout==3) {ChangeJunc("cc3",0);} } else if (ii==6) { // Мамут if (puin==1) {ChangeJunc("bb4",0);} else if (puin==3) {ChangeJunc("bb4",2);} if (puout==1) {ChangeJunc("bb3",2);} else if (puout==3) {ChangeJunc("bb3",0);} } else if (ii==7) { // Джанкой if (puin==1 and nap==true) {ChangeJunc("y142", 2); ChangeJunc("y24", 2);} else if (puin==2 and nap==true) {ChangeJunc("y112", 0); ChangeJunc("y84", 2); ChangeJunc("y2", 2); ChangeJunc("y120", 0); ChangeJunc("y126", 0); ChangeJunc("y138", 0); } else if (puin==2 and nap==false) {ChangeJunc("y1", 0); ChangeJunc("y3", 2);} else if (puin==4 and nap==true) {ChangeJunc("y112", 0); ChangeJunc("y84", 2); ChangeJunc("y120", 0); ChangeJunc("y126", 0); ChangeJunc("y2", 0); ChangeJunc("y138", 0); } else if (puin==4 and nap==false) {ChangeJunc("y1", 2);} else if (puin==5 and nap==true) {ChangeJunc("y84",2); ChangeJunc("y130",2); ChangeJunc("y120",2); ChangeJunc("y4",2);} else if (puin==5 and nap==false) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y37", 0); ChangeJunc("y99", 2);} else if (puin==15 and nap==true) {ChangeJunc("y142", 2); ChangeJunc("y24", 0);} else if (puin==17 and nap==false){ChangeJunc("y1", 2); ChangeJunc("y141", 2); ChangeJunc("y2", 0); ChangeJunc("y126", 2); ChangeJunc("y124", 2);} else if (puin==18 and nap==true) {ChangeJunc("y112", 0); ChangeJunc("y84", 0); ChangeJunc("y54", 0);} // для электричек else if (puin==18 and nap==false){ChangeJunc("y141", 2); ChangeJunc("y1", 2); ChangeJunc("y2", 0); ChangeJunc("y126", 2); ChangeJunc("y124", 0);} else if (puin==20) {ChangeJunc("y2",2); ChangeJunc("y126",0); ChangeJunc("y54",2); ChangeJunc("y52",2); ChangeJunc("y86",0); ChangeJunc("y104",0); ChangeJunc("y114",0); ChangeJunc("y138",0);} if (puout==1 and nap==false) {ChangeJunc("y142", 2); ChangeJunc("y24", 2); ChangeJunc("y148", 2);} else if (puout==1 and nap==true) {ChangeJunc("y119",0);} else if (puout==2 and nap==true) {ChangeJunc("y1", 2); ChangeJunc("y3", 2); ChangeJunc("y79", 0);} else if (puout==2 and nap==false) {ChangeJunc("y2", 2); ChangeJunc("y138", 0); ChangeJunc("y122", 2); ChangeJunc("y54", 2); ChangeJunc("y126", 0); ChangeJunc("y86", 2); ChangeJunc("y34", 2); ChangeJunc("y136", 2);} else if (puout==4 and nap==true) {ChangeJunc("y1", 2); ChangeJunc("y3", 2); ChangeJunc("y79", 2);} else if (puout==4 and nap==false) {ChangeJunc("y2", 0); ChangeJunc("y138", 0); ChangeJunc("y122", 2); ChangeJunc("y54", 2); ChangeJunc("y126", 0); ChangeJunc("y86", 2); ChangeJunc("y34", 2);} else if (puout==5 and nap==true) {ChangeJunc("y3",0); ChangeJunc("y99", 2);} else if (puout==5 and nap==false) {ChangeJunc("y140",2); ChangeJunc("y122",2); ChangeJunc("y54",2);} else if (puout==15 and nap==false) {ChangeJunc("y142", 2); ChangeJunc("y24", 0); ChangeJunc("y148", 2);} else if (puout==17 and nap==false) {ChangeJunc("y34", 0); ChangeJunc("y56", 2);} else if (puout==17 and nap==true) {ChangeJunc("y1", 2); ChangeJunc("y3", 2); ChangeJunc("y2", 2); ChangeJunc("y126", 2); ChangeJunc("y124", 2); ChangeJunc("y136", 2);} else if (puout==18 and nap==true) {ChangeJunc("y1", 2); ChangeJunc("y3", 2); ChangeJunc("y2", 2); ChangeJunc("y126", 2); ChangeJunc("y124", 0); ChangeJunc("y136", 2);} else if (puout==18 and nap==false) {ChangeJunc("y34", 2); ChangeJunc("y54", 0); ChangeJunc("y52", 2); ChangeJunc("y86", 2);} else if (puout==20) {ChangeJunc("y2",0); ChangeJunc("y126",0); ChangeJunc("y54",2); ChangeJunc("y52",2); ChangeJunc("y86",0); ChangeJunc("y104",0); ChangeJunc("y114",0); ChangeJunc("y138",0);} } else if (ii==8) { // Отрадная if (puin==1) {ChangeJunc("aa2",0);} else if (puin==3) {ChangeJunc("aa2",2);} else if (puin==2) {ChangeJunc("aa1",0);} else if (puin==4) {ChangeJunc("aa1",2);} if (puout==1) {ChangeJunc("aa3",2);} else if (puout==3) {ChangeJunc("aa3",0); ChangeJunc("aa21",0);} else if (puout==2) {ChangeJunc("aa4",2);} else if (puout==4) {ChangeJunc("aa4",0);} } else if (ii==9) { // Урожайная if (puin==1 and nap==true) {ChangeJunc("kk6",0);} else if (puin==2 and nap==false) {ChangeJunc("kk19",0);} else if (puin==3 and nap==true) {ChangeJunc("kk6",2);} else if (puin==4 and nap==false) {ChangeJunc("kk19",2);} if (puout==1 and nap==true) {ChangeJunc("kk5",2);} else if (puout==3 and nap==true) {ChangeJunc("kk5",0);} else if (puout==2 and nap==false) {ChangeJunc("kk4",2);} else if (puout==4 and nap==false) {ChangeJunc("kk4",0);} } else if (ii==10) { // Краснопартизанская if (puin==2) {ChangeJunc("ll1",0);} else if (puin==4) {ChangeJunc("ll1",2);} if (puout==2) {ChangeJunc("ll4",2);} else if (puout==4) {ChangeJunc("ll4",0);} } else if (ii==11) { // Ефремовская if (puin==2) {ChangeJunc("mm7",0);} else if (puin==4) {ChangeJunc("mm7",2);} if (puout==2) {ChangeJunc("mm4",2);} else if (puout==4) {ChangeJunc("mm4",0);} } else if (ii==12) { // Элеваторная if (puin==1 and nap==true) {ChangeJunc("nn2",0);} else if (puin==3 and nap==true) {ChangeJunc("nn2",2);} else if (puin==2 and nap==false) {ChangeJunc("nn7",0);} else if (puin==4 and nap==false) {ChangeJunc("nn7",2);} if (puout==1 and nap==true) {ChangeJunc("nn3",2);} else if (puout==3 and nap==true) {ChangeJunc("nn3",0); ChangeJunc("nn5",0);} else if (puout==2 and nap==false) {ChangeJunc("nn8",2); ChangeJunc("nn4",2);} else if (puout==4 and nap==false) {ChangeJunc("nn8",0); ChangeJunc("nn4",2);} } else if (ii==13) { // Пролётная if (puin==2) {ChangeJunc("pp9",0);} else if (puin==4) {ChangeJunc("pp9",2);} else if (puin==6) {ChangeJunc("pp9",2); ChangeJunc("pp11",2);} if (puout==2) {ChangeJunc("pp4",2);} else if (puout==4) {ChangeJunc("pp4",0); ChangeJunc("pp6",2);} else if (puout==6) {ChangeJunc("pp9",2); ChangeJunc("pp11",2); ChangeJunc("pp7",2);} } else if (ii==14) { // Остряково if (puin==1 and nap==true) {ChangeJunc("tt4",0);} else if (puin==3 and nap==true) {ChangeJunc("tt4",2);} else if (puin==2 and nap==false) {ChangeJunc("tt5",0);} else if (puin==4 and nap==false) {ChangeJunc("tt5",2);} else if (puin==3 and nap==false) {ChangeJunc("tt7",0); ChangeJunc("tt3",0);} if (puout==1 and nap==true) {ChangeJunc("tt3",2);} else if (puout==3 and nap==true) {ChangeJunc("tt3",0);} else if (puout==2 and nap==false) {ChangeJunc("tt8",2);} else if (puout==4 and nap==false) {ChangeJunc("tt8",0);} else if (pu==2 and puout==3) {ChangeJunc("tt36",0); ChangeJunc("tt30",0);} } else if (ii==15) { // Симферополь-товарный if (puin==1 and nap==true) {ChangeJunc("rr2",2);} else if (puin==3 and nap==true) {ChangeJunc("rr2",2); ChangeJunc("rr10",2);} else if (puin==4 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",2); ChangeJunc("rr6",0); ChangeJunc("rr8",2);} else if (puin==5 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",2); ChangeJunc("rr6",0); ChangeJunc("rr8",0);} else if (puin==6 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",2); ChangeJunc("rr20",2);} else if (puin==7 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",2); ChangeJunc("rr20",0);} else if (puin==8 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",0); ChangeJunc("rr16",2);} else if (puin==9 and nap==true) {ChangeJunc("rr2",0); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",0); ChangeJunc("rr16",0);} else if (puin==2 and nap==false) {ChangeJunc("rr1",0); ChangeJunc("rr3",2); ChangeJunc("rr7",0);} else if (puin==4 and nap==false) {ChangeJunc("rr1",0); ChangeJunc("rr7",2); ChangeJunc("rr9",0); ChangeJunc("rr13",0);} else if (puin==5 and nap==false) {ChangeJunc("rr1",0); ChangeJunc("rr7",2); ChangeJunc("rr9",0); ChangeJunc("rr13",2);} else if (puin==6 and nap==false) {ChangeJunc("rr1",0); ChangeJunc("rr7",2); ChangeJunc("rr9",2); ChangeJunc("rr11",0);} else if (puin==7 and nap==false) {ChangeJunc("rr1",0); ChangeJunc("rr7",2); ChangeJunc("rr9",2); ChangeJunc("rr11",2);} else if (puin==8 and nap==false) {ChangeJunc("rr1",2); ChangeJunc("rr17",2); ChangeJunc("rr19",0); ChangeJunc("rr23",0); ChangeJunc("rr27",0);} else if (puin==9 and nap==false) {ChangeJunc("rr1",2); ChangeJunc("rr17",2); ChangeJunc("rr19",0); ChangeJunc("rr23",0); ChangeJunc("rr27",2);} if (puout==2 and nap==false) {ChangeJunc("rr22",2); ChangeJunc("rr6",2); ChangeJunc("rr2",2);} else if (puout==4 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",2); ChangeJunc("rr6",0); ChangeJunc("rr8",2);} else if (puout==5 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",2); ChangeJunc("rr6",0); ChangeJunc("rr8",0);} else if (puout==6 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",2); ChangeJunc("rr20",2);} else if (puout==7 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",2); ChangeJunc("rr20",0);} else if (puout==8 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",0); ChangeJunc("rr16",2);} else if (puout==9 and nap==false) {ChangeJunc("rr2",2); ChangeJunc("rr22",0); ChangeJunc("rr12",0); ChangeJunc("rr14",0); ChangeJunc("rr16",0);} else if (puout==1 and nap==true) {ChangeJunc("rr39",0); ChangeJunc("rr49",0);} else if (puout==4 and nap==true) {ChangeJunc("rr39",2); ChangeJunc("rr7",2); ChangeJunc("rr9",0); ChangeJunc("rr13",0);} else if (puout==5 and nap==true) {ChangeJunc("rr39",2); ChangeJunc("rr7",2); ChangeJunc("rr9",0); ChangeJunc("rr13",2);} else if (puout==6 and nap==true) {ChangeJunc("rr39",2); ChangeJunc("rr7",2); ChangeJunc("rr9",2); ChangeJunc("rr11",0);} else if (puout==7 and nap==true) {ChangeJunc("rr39",2); ChangeJunc("rr7",2); ChangeJunc("rr9",2); ChangeJunc("rr11",2);} else if (puout==8 and nap==true) {ChangeJunc("rr51",2); ChangeJunc("rr1",2); ChangeJunc("rr17",2); ChangeJunc("rr19",0); ChangeJunc("rr23",0); ChangeJunc("rr27",0);} else if (puout==9 and nap==true) {ChangeJunc("rr51",2); ChangeJunc("rr1",2); ChangeJunc("rr17",2); ChangeJunc("rr19",0); ChangeJunc("rr23",0); ChangeJunc("rr27",2);} } else if (ii==16) { // Симферополь if (puin==1) {ChangeJunc("ss15",0); ChangeJunc("ss29",0); ChangeJunc("ss37",0);} else if (puin==2) {ChangeJunc("ss15",0); ChangeJunc("ss29",0); ChangeJunc("ss37",2);} else if (puin==3) {ChangeJunc("ss15",0); ChangeJunc("ss29",2); ChangeJunc("ss43",0); ChangeJunc("ss39",0); ChangeJunc("ss23",0);} else if (puin==4) {ChangeJunc("ss15",0); ChangeJunc("ss29",2); ChangeJunc("ss43",2); ChangeJunc("ss39",0); ChangeJunc("ss23",0);} else if (puin==5) {ChangeJunc("ss15",0); ChangeJunc("ss29",2); ChangeJunc("ss39",2); ChangeJunc("ss23",0); ChangeJunc("ss5",0); } else if (puin==6) {ChangeJunc("ss15",0); ChangeJunc("ss49",0); ChangeJunc("ss47",2); ChangeJunc("ss23",0); ChangeJunc("ss5",2);} else if (puin==7) {ChangeJunc("ss15",0); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",0); ChangeJunc("ss23",0); ChangeJunc("ss5",2);} else if (puin==8) {ChangeJunc("ss15",0); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",0); ChangeJunc("ss5",2); ChangeJunc("ss55",0);} else if (puin==9) {ChangeJunc("ss15",0); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",0); ChangeJunc("ss5",2); ChangeJunc("ss55",2); ChangeJunc("ss59",0);} else if (puin==10) {ChangeJunc("ss15",0); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",0); ChangeJunc("ss5",2); ChangeJunc("ss55",2); ChangeJunc("ss59",2); ChangeJunc("ss67",0);} else if (puin==11) {ChangeJunc("ss15",0); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",0); ChangeJunc("ss5",2); ChangeJunc("ss55",2); ChangeJunc("ss59",2); ChangeJunc("ss67",2);} if (puout==1) {ChangeJunc("ss37",0); ChangeJunc("ss31",2);} else if (puout==2) {ChangeJunc("ss37",2); ChangeJunc("ss31",2);} else if (puout==3) {ChangeJunc("ss15",2); ChangeJunc("ss29",2); ChangeJunc("ss43",0); ChangeJunc("ss39",0); ChangeJunc("ss23",0);} else if (puout==4) {ChangeJunc("ss15",2); ChangeJunc("ss29",2); ChangeJunc("ss43",2); ChangeJunc("ss39",0); ChangeJunc("ss23",0);} else if (puout==5) {ChangeJunc("ss15",2); ChangeJunc("ss29",2); ChangeJunc("ss39",2); ChangeJunc("ss23",0);} else if (puout==6) {ChangeJunc("ss15",2); ChangeJunc("ss49",0); ChangeJunc("ss47",2); ChangeJunc("ss23",2);} else if (puout==7) {ChangeJunc("ss15",2); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",0); ChangeJunc("ss23",2);} else if (puout==8) {ChangeJunc("ss15",2); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",2); ChangeJunc("ss55",0);} else if (puout==9) {ChangeJunc("ss15",2); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",2); ChangeJunc("ss55",2); ChangeJunc("ss59",0);} else if (puout==10) {ChangeJunc("ss15",2); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",2); ChangeJunc("ss55",2); ChangeJunc("ss59",2); ChangeJunc("ss67",0);} else if (puout==11) {ChangeJunc("ss15",2); ChangeJunc("ss49",2); ChangeJunc("ss47",2); ChangeJunc("ss51",2); ChangeJunc("ss23",2); ChangeJunc("ss55",2); ChangeJunc("ss59",2); ChangeJunc("ss67",2);} } } if (razd==3) { if (ii==0) { // Джанкой товарный ChangeJunc("y21", 0); ChangeJunc("y131", 2); ChangeJunc("y129", 0); ChangeJunc("y151", 0); ChangeJunc("y410", 0); if (puout==1){ChangeJunc("y421", 0); ChangeJunc("y411", 2); ChangeJunc("y509", 2); ChangeJunc("y533", 2);} else if (puout==2){ChangeJunc("y413", 2); ChangeJunc("y411", 0); ChangeJunc("y509", 2); ChangeJunc("y533", 2);} else if (puout==3){ChangeJunc("y413", 0); ChangeJunc("y411", 0); ChangeJunc("y509", 2); ChangeJunc("y533", 2);} else if (puout==4){ChangeJunc("y415", 2); ChangeJunc("y403", 2); ChangeJunc("y509", 0); ChangeJunc("y533", 2);} else if (puout==5){ChangeJunc("y415", 0); ChangeJunc("y403", 2); ChangeJunc("y509", 0); ChangeJunc("y533", 2);} else if (puout==6){ChangeJunc("y401", 2); ChangeJunc("y403", 0); ChangeJunc("y509", 0); ChangeJunc("y533", 2);} else if (puout==7){ChangeJunc("y401", 0); ChangeJunc("y403", 0); ChangeJunc("y509", 0); ChangeJunc("y533", 2);} else if (puout==8){ChangeJunc("y405", 2); ChangeJunc("y531", 2); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==9){ChangeJunc("y405", 0); ChangeJunc("y423", 2); ChangeJunc("y531", 2); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==10){ChangeJunc("y405", 0); ChangeJunc("y423", 0); ChangeJunc("y425", 2); ChangeJunc("y531", 2); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==11){ChangeJunc("y405", 0); ChangeJunc("y423", 0); ChangeJunc("y425", 0); ChangeJunc("y427", 2); ChangeJunc("y531", 2); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==12){ChangeJunc("y405", 0); ChangeJunc("y423", 0); ChangeJunc("y425", 0); ChangeJunc("y427", 0); ChangeJunc("y531", 2); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==13){ChangeJunc("y431", 2); ChangeJunc("y417", 2); ChangeJunc("y531", 0); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==14){ChangeJunc("y431", 0); ChangeJunc("y417", 2); ChangeJunc("y531", 0); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==15){ChangeJunc("y417", 0); ChangeJunc("y531", 0); ChangeJunc("y511", 2); ChangeJunc("y507", 0);} else if (puout==16){ChangeJunc("y433", 2); ChangeJunc("y419", 2); ChangeJunc("y407", 2); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==17){ChangeJunc("y433", 0); ChangeJunc("y419", 2); ChangeJunc("y407", 2); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==18){ChangeJunc("y435", 2); ChangeJunc("y419", 0); ChangeJunc("y407", 2); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==19){ChangeJunc("y435", 0); ChangeJunc("y419", 0); ChangeJunc("y407", 2); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==20){ChangeJunc("y437", 2); ChangeJunc("y429", 2); ChangeJunc("y407", 0); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==21){ChangeJunc("y437", 0); ChangeJunc("y429", 2); ChangeJunc("y407", 0); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==22){ChangeJunc("y439", 2); ChangeJunc("y429", 0); ChangeJunc("y407", 0); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} else if (puout==23){ChangeJunc("y439", 0); ChangeJunc("y429", 0); ChangeJunc("y407", 0); ChangeJunc("y511", 0); ChangeJunc("y507", 0);} } else if (ii==1) { // Джанкой ChangeJunc("y52",2); ChangeJunc("y141",0); ChangeJunc("y21",2); if (puin==4) {ChangeJunc("y1",2); jc="y1";} else if (puin==2) {ChangeJunc("y1", 0); ChangeJunc("y3", 2); jc="y3";} else if (puin==5) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y45", 2); ChangeJunc("y85", 2); jc="y3";} else if (puin==6) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 2); ChangeJunc("y45", 0); ChangeJunc("y5", 2); jc="y5";} else if (puin==7) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 2); ChangeJunc("y45", 0); ChangeJunc("y5", 0); jc="y5";} else if (puin==8) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 0); ChangeJunc("y45", 0); ChangeJunc("y51", 2); ChangeJunc("y9", 2); jc="y9";} else if (puin==9) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 0); ChangeJunc("y45", 0); ChangeJunc("y51", 2); ChangeJunc("y9", 0); jc="y9";} else if (puin==10) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 0); ChangeJunc("y45", 0); ChangeJunc("y51", 0); ChangeJunc("y59", 2); jc="y59";} else if (puin==11) {ChangeJunc("y1", 0); ChangeJunc("y3", 0); ChangeJunc("y43", 0); ChangeJunc("y45", 0); ChangeJunc("y51", 0); ChangeJunc("y59", 0); jc="y59";} else if (puin==17) {ChangeJunc("y126",2); ChangeJunc("y124",2); ChangeJunc("y1",2); ChangeJunc("y2",0); ChangeJunc("y141",0); jc="y124";} jn="y121"; if (puout==2) ChangeJunc("y1",0); else if (puout==4) ChangeJunc("y1",2); else if (puout==5) {ChangeJunc("y126",2); ChangeJunc("y124",2); ChangeJunc("y1",0); ChangeJunc("y3", 0);} else if (puout==6) {ChangeJunc("y62",0); ChangeJunc("y8",0); ChangeJunc("y6",0);} else if (puout==7) {ChangeJunc("y62",0); ChangeJunc("y8",2); ChangeJunc("y6",0);} else if (puout==8) {ChangeJunc("y62",0); ChangeJunc("y10",0); ChangeJunc("y6",2);} else if (puout==9) {ChangeJunc("y62",0); ChangeJunc("y10",2); ChangeJunc("y6",2);} else if (puout==10) {ChangeJunc("y62",2); ChangeJunc("y12",0);} else if (puout==11) {ChangeJunc("y62",2); ChangeJunc("y12",2); ChangeJunc("y14",0);} else if (nap==false and puout==17) {ChangeJunc("y52",0); ChangeJunc("y86",0); ChangeJunc("y104",0); ChangeJunc("y114",0); ChangeJunc("y116",0);} else if (nap==true and puout==17) {ChangeJunc("y126",2); ChangeJunc("y124",2); ChangeJunc("y1",2); ChangeJunc("y2",0); ChangeJunc("y141",0); } else if (puout==20) {ChangeJunc("y2",0); ChangeJunc("y126",0); ChangeJunc("y54",2); ChangeJunc("y52",2); ChangeJunc("y86",0); ChangeJunc("y104",0); ChangeJunc("y114",0); ChangeJunc("y116",0);} else if (puout==22) {ChangeJunc("y52",0); ChangeJunc("y86",0); ChangeJunc("y104",0); ChangeJunc("y114",0); ChangeJunc("y116",0);} } else if (ii==2) { // 10 км if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("g1", 0); ChangeJunc("g3", 0); jc="g3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("g1", 0); ChangeJunc("g3", 2); jc="g3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("g1", 2); jc="g1";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("g2", 2); ChangeJunc("g4", 2); jn="g4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("g2", 2); ChangeJunc("g4", 0); jn="g4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("g2", 0); jn="g2";} } else if (ii==3) { // Азовская if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("o1", 0); ChangeJunc("o3", 0); ChangeJunc("o5", 0); jc="o11";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("o1", 0); ChangeJunc("o3", 0); ChangeJunc("o5", 2); jc="o5";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("o1", 0); ChangeJunc("o3", 2); jc="o3";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("o1", 2); jc="o1";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("o2", 2); jn="o2";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("o2", 0); ChangeJunc("o4", 2); jn="o4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("o2", 0); ChangeJunc("o4", 0);ChangeJunc("o6", 2); jn="o6";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("o2", 0); ChangeJunc("o4", 0); ChangeJunc("o6", 0); jn="o6";} } else if (ii==4) { // 30 км if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("l1", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("l1", 2);} jn="l2"; jc="l1"; if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("l2", 2);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("l2", 0);} } else if (ii==5) { // Нижнегорская if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("j1", 0); ChangeJunc("j3", 0); jc="j15";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("j1", 0); ChangeJunc("j3", 2); jc="j3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("j1", 2); ChangeJunc("j5", 0); jc="j5";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("j1", 2); ChangeJunc("j5", 2); jc="j5";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("j2", 2); ChangeJunc("j4", 2); jn="j20";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("j2", 2); ChangeJunc("j4", 0); jn="j4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("j2", 0); ChangeJunc("j6", 2); jn="j6";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("j2", 0); ChangeJunc("j6", 0); jn="j6";} } else if (ii==6) { // 50 км if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("k1", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("k1", 2);} jc="k1"; jn="k2"; if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("k2", 2);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("k2", 0);} } else if (ii==7) { // Краснофлотская if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("i1", 0); ChangeJunc("i3", 0); ChangeJunc("i22", 0); jc="i3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("i1", 0); ChangeJunc("i3", 2); jc="i1";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("i1", 2); ChangeJunc("i5", 0); jc="i1";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("i2", 2); ChangeJunc("i4", 2); ChangeJunc("i22", 0); jn="i22";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("i2", 2); ChangeJunc("i4", 0); jn="i4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("i2", 0); ChangeJunc("i6", 2); jn="i12";} } else if (ii==8) { // Новофедоровка if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("h1", 2); ChangeJunc("h3", 2); jc="h3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("h1", 2); ChangeJunc("h3", 0); jc="h3";} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("h1", 0); jc="h1";} if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("h2", 0); ChangeJunc("h4", 0); jn="h4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("h2", 0); ChangeJunc("h4", 2); jn="h4";} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("h2", 2); jn="h2";} } else if (ii==9) { // Кировская if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("f1", 0); ChangeJunc("f3", 2); jc="f3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("f1", 2); ChangeJunc("f5", 0); jc="f5";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("f1", 0); ChangeJunc("f3", 0); jc="f21";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("f1", 2); ChangeJunc("f5", 2); jc="f5";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("f2", 2); ChangeJunc("f4", 0); jn="f4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("f2", 0); ChangeJunc("f6", 2); jn="f6";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("f2", 2); ChangeJunc("f4", 2); jn="f4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("f2", 0); ChangeJunc("f6", 0); jn="f6";} } else if (ii==10) { // Владиславовка if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("e1", 0); ChangeJunc("e15", 2); jc="e15";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("e1", 2); ChangeJunc("e3", 2); ChangeJunc("e29", 0); jc="e29";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("e1", 0); ChangeJunc("e3", 2); ChangeJunc("e15", 0); jc="e15";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("e1", 2); ChangeJunc("e3", 2); ChangeJunc("e29", 2); jc="e31";} // пути с Петрово else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e11", 0); ChangeJunc("e9", 0); jc="e9";} else if ((nap==false and puin==6) or (puout==6 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e11", 0); ChangeJunc("e9", 2); jc="e9";} else if ((nap==false and puin==7) or (puout==7 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 0); ChangeJunc("e13", 0); jc="e13";} else if ((nap==false and puin==8) or (puout==8 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 0); ChangeJunc("e13", 2); jc="e13";} else if ((nap==false and puin==9) or (puout==9 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 2); ChangeJunc("e35", 0); jc="e35";} else if ((nap==false and puin==10) or (puout==10 and nap==true)){ChangeJunc("e7", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 2); ChangeJunc("e35", 2); jc="e35";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("e2", 2); ChangeJunc("e4", 0); jn="e4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 2); ChangeJunc("e8", 2); jn="e8";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("e2", 2); ChangeJunc("e4", 2); jn="e4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 2); ChangeJunc("e8", 0); jn="e8";} // пути на Петрово else if ((puin==5 and nap==true) or (puout==5 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 2); ChangeJunc("e12", 2); jn="e10";} else if ((puin==6 and nap==true) or (puout==6 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 2); ChangeJunc("e12", 0); jn="e10";} else if ((puin==7 and nap==true) or (puout==7 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 2); jn="e10";} else if ((puin==8 and nap==true) or (puout==8 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 2); jn="e10";} else if ((puin==9 and nap==true) or (puout==9 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 0); ChangeJunc("e28", 2); jn="e10";} else if ((puin==10 and nap==true) or (puout==10 and nap==false)){ChangeJunc("e2",0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 0); ChangeJunc("e28", 0); jn="e10";} } else if (ii==11) { // 107 км if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("d1", 2); ChangeJunc("d3", 2); jc="d3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("d1", 2); ChangeJunc("d3", 0); jc="d3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("d1", 0); jc="d1";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("d2", 0); ChangeJunc("d4", 0); jn="d4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("d2", 0); ChangeJunc("d4", 2); jn="d4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("d2", 2); jn="d2";} } else if (ii==12){ // Айвазовская-тов if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("c1", 2); ChangeJunc("c3", 2); jc="c3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("c1", 2); ChangeJunc("c3", 0); jc="c3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("c1", 0); ChangeJunc("c5", 2); jc="c5";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("c1", 0); ChangeJunc("c5", 0); ChangeJunc("c7", 2); jc="c7";} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("c1", 0); ChangeJunc("c5", 0); ChangeJunc("c7", 0); ChangeJunc("c9", 2); jc="c9";} else if ((nap==false and puin==6) or (puout==6 and nap==true)) {ChangeJunc("c1", 0); ChangeJunc("c5", 0); ChangeJunc("c7", 0); ChangeJunc("c9", 0); jc="c9";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("c2", 0); ChangeJunc("c4", 0); jn="c4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("c2", 0); ChangeJunc("c4", 2); jn="c4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("c2", 2); ChangeJunc("c6", 0); jn="c6";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("c2", 2); ChangeJunc("c6", 2); ChangeJunc("c8", 0); jn="c8";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("c2", 2); ChangeJunc("c6", 2); ChangeJunc("c8", 2); ChangeJunc("c10", 0); jn="c10";} else if ((nap==true and puin==6) or (puout==6 and nap==false)) {ChangeJunc("c2", 2); ChangeJunc("c6", 2); ChangeJunc("c8", 2); ChangeJunc("c10", 2); jn="c10";} } else if (ii==13) { // Айвазовская if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("b1", 0); ChangeJunc("b3", 0); ChangeJunc("b9", 0); jc="b45";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("b1", 0); ChangeJunc("b3", 0); ChangeJunc("b9", 2); jc="b9";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("b1", 0); ChangeJunc("b3", 2); ChangeJunc("b7", 0); ChangeJunc("b5", 0); jc="b5";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("b1", 0); ChangeJunc("b3", 2); ChangeJunc("b7", 0); ChangeJunc("b5", 2); jc="b5";} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("b1", 0); ChangeJunc("b3", 2); ChangeJunc("b7", 2); jc="b7";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("b2", 2); ChangeJunc("b4", 2); jn="b50";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("b2", 0); ChangeJunc("b6", 2); jn="b6";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("b2", 2); ChangeJunc("b4", 0); jn="b4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("b2", 0); ChangeJunc("b6", 0); ChangeJunc("b8", 2); jn="b8";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("b2", 0); ChangeJunc("b6", 0); ChangeJunc("b8", 0); jn="b8";} } else if (ii==14){ // Феодосия if (pu==1) {ChangeJunc("a2", 2);} else if (pu==2) {ChangeJunc("a2", 0); ChangeJunc("a4", 2);} else if (pu==3) {ChangeJunc("a4", 0); ChangeJunc("a2", 0); ChangeJunc("a6", 2); ChangeJunc("a8", 2);} else if (pu==4) {ChangeJunc("a4", 0); ChangeJunc("a2", 0); ChangeJunc("a6", 2); ChangeJunc("a8", 0); ChangeJunc("a10", 0);} jn="a2"; jc="a1"; } if (pr!=3) {if(nap==true and ii<2) junout="y21"; else if (nap==true) junin=jn, junout=jc; else junin=jc, junout=jn;} } else if (razd==2) { if (ii==10) { // Аршинцево if (pu==1) {ChangeJunc("x1", 0); ChangeJunc("x3", 0);} else if (pu==2) {ChangeJunc("x1", 0); ChangeJunc("x3", 2);} else if (pu==3) {ChangeJunc("x1", 2); ChangeJunc("x5", 0);} else if (pu==4) {ChangeJunc("x1", 2); ChangeJunc("x5", 2); ChangeJunc("x7", 0);} else if (pu==5) {ChangeJunc("x1", 2); ChangeJunc("x5", 2); ChangeJunc("x7", 2);} jn="x1"; jc="x1"; } else if (ii==9) { // Крым if (puin==1) {ChangeJunc("r2",2); ChangeJunc("r4",2);} else if (puin==2) {ChangeJunc("r2",2); ChangeJunc("r4",0);} else if (puin==3) {ChangeJunc("r2",0); ChangeJunc("r6",2);} else if (puin==4) {ChangeJunc("r2",0); ChangeJunc("r6",0);} jn="r2"; jc="r3"; if (puout==1) {ChangeJunc("r1",0); ChangeJunc("r3",0);} else if (puout==2) {ChangeJunc("r1",0); ChangeJunc("r3",2); ChangeJunc("r5",0);} else if (puout==3) {ChangeJunc("r1",0); ChangeJunc("r3",2); ChangeJunc("r5",2);} else if (puout==4) {ChangeJunc("r1",2);} } else if (ii==8) { // Керчь-завод if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("n1", 2); jc="n1";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n5", 2); jc="n5";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n5", 0); ChangeJunc("n7", 2); jc="n7";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n5", 0); ChangeJunc("n7", 0); jc="n7";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("n2", 0); jn="n2";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 0); jn="n4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 0); jn="n6";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 2); ChangeJunc("n8", 0); jn="n8";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 2); ChangeJunc("n8", 2); jn="n8";} } else if (ii==7) { // Керчь if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("z1", 0); ChangeJunc("z3", 0); ChangeJunc("z89", 2); jc="z3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("z1", 0); ChangeJunc("z3", 2); jc="z3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 0); jc="z5";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 0); ChangeJunc("z9", 0); ChangeJunc("z7", 0); jc="z7";} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 0); ChangeJunc("z9", 0); ChangeJunc("z7", 2); jc="z7";} else if ((nap==false and puin==6) or (puout==6 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 0); ChangeJunc("z9", 2); ChangeJunc("z19", 0); jc="z19";} else if ((nap==false and puin==7) or (puout==7 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 0); ChangeJunc("z9", 2); ChangeJunc("z19", 2); jc="z19";} else if ((nap==false and puin==8) or (puout==8 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 2); ChangeJunc("z21", 0); ChangeJunc("z17", 0); jc="z17";} else if ((nap==false and puin==9) or (puout==9 and nap==true)) {if (pr==2) ChangeJunc("z1", 2); ChangeJunc("z5", 2); ChangeJunc("z11", 2); ChangeJunc("z21", 0); ChangeJunc("z17", 2); jc="z17";} else if ((nap==false and puin==10) or (puout==10 and nap==true)) {if (pr==2) ChangeJunc("z1",2); ChangeJunc("z5",2); ChangeJunc("z11", 2); ChangeJunc("z21", 2); jc="z21";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("z2", 2); ChangeJunc("z4", 2); jn="z36";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("z2", 2); ChangeJunc("z4", 0); jn="z4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("z2", 0); ChangeJunc("z8", 2); ChangeJunc("z6", 2); jn="z6";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("z2", 0); ChangeJunc("z8", 2); ChangeJunc("z6", 0); jn="z6";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("z2", 0); ChangeJunc("z8", 0); ChangeJunc("z54",2); jn="z12";} else if ((nap==true and puin==6) or (puout==6 and nap==false)) {ChangeJunc("z2", 0); ChangeJunc("z8", 0); ChangeJunc("z54",0); ChangeJunc("z10",2); jn="z10";} else if ((nap==true and puin==7) or (puout==7 and nap==false)) {ChangeJunc("z2", 0); ChangeJunc("z8", 0); ChangeJunc("z54",0); ChangeJunc("z10",0); jn="z10";} } else if (ii==6) { // Багерово if ((nap==false and puin==3) or (puout==3 and nap==true)) ChangeJunc("w1", 0), jc="w1"; else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("w1", 2); ChangeJunc("w3", 0); jc="w3";} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("w1", 2); ChangeJunc("w3", 2); jc="w3";} if ((nap==true and puin==1) or (puout==1 and nap==false)) ChangeJunc("w2", 0), jn="w2"; else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("w2", 2); ChangeJunc("w4", 0); jn="w4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("w2", 2); ChangeJunc("w4", 2); jn="w4";} } else if (ii==5) { // Чистополье if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("v1", 0); ChangeJunc("v3", 0); jc="v3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("v1", 0); ChangeJunc("v3", 2); jc="v3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("v1", 2); ChangeJunc("v5", 0); jc="v5";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("v1", 2); ChangeJunc("v5", 2); jc="v5";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("v2", 2); ChangeJunc("v4", 2); ChangeJunc("v6", 2); jn="v6";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("v2", 2); ChangeJunc("v4", 2); ChangeJunc("v6", 0); jn="v6";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("v2", 2); ChangeJunc("v4", 0); jn="v4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) ChangeJunc("v2", 0), jn="v2"; } else if (ii==4) { // Пресноводная if ((nap==false and puin==1) or (puout==1 and nap==true)) ChangeJunc("u1", 0), jc="u1"; else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("u1", 2); ChangeJunc("u3", 0); jc="u3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("u1", 2); ChangeJunc("u3", 2); jc="u3";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("u2", 2); ChangeJunc("u4", 2); jn="u4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("u2", 2); ChangeJunc("u4", 0); jn="u4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) ChangeJunc("u2", 0), jn="u2"; } else if (ii==3) { // Астанино if ((nap==false and puin==1) or (puout==1 and nap==true)) ChangeJunc("t1", 0); else if ((nap==false and puin==2) or (puout==2 and nap==true)) ChangeJunc("t1", 2); jc="t1"; jn="t2"; if ((nap==true and puin==1) or (puout==1 and nap==false)) ChangeJunc("t2", 2); else if ((nap==true and puin==2) or (puout==2 and nap==false)) ChangeJunc("t2", 0); } else if (ii==2) { // Семь Kолодезей if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("s1", 0); ChangeJunc("s3", 0); ChangeJunc("s21",0); jc="s23";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("s1", 0); ChangeJunc("s3", 0); ChangeJunc("s21",2); jc="s21";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("s1", 0); ChangeJunc("s3", 2); jc="s3";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("s1", 2); ChangeJunc("s7", 0); ChangeJunc("s5",0); jc="s5";} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("s1", 2); ChangeJunc("s7", 0); ChangeJunc("s5",2); jc="s25";} else if ((nap==false and puin==6) or (puout==6 and nap==true)) {ChangeJunc("s1", 2); ChangeJunc("s7", 2); jc="s7";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("s2", 2); ChangeJunc("s6", 2); ChangeJunc("s20", 2); jn="s20";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("s2", 2); ChangeJunc("s6", 2); ChangeJunc("s20", 0); jn="s20";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("s2", 2); ChangeJunc("s6", 0); ChangeJunc("s4", 2); jn="s4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("s2", 2); ChangeJunc("s6", 0); ChangeJunc("s4", 0); jn="s4";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("s2", 0); ChangeJunc("s10", 2); jn="s10";} else if ((nap==true and puin==6) or (puout==6 and nap==false)) {ChangeJunc("s2", 0); ChangeJunc("s10", 0); jn="s10";} } else if (ii==1) { // Петрово if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("p1", 0); ChangeJunc("p3", 0); jc="p3";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("p1", 0); ChangeJunc("p3", 2); jc="p3";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("p1", 2); jc="p1";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("p2", 2); jn="p2";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("p2", 0); ChangeJunc("p4", 2); jn="p4";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("p2", 0); ChangeJunc("p4", 0); jn="p4";} } else if (ii==0) { // Владиславовка if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("e7", 0); ChangeJunc("e1", 0); ChangeJunc("e3", 0); ChangeJunc("e15", 2); jc="e15";} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("e7", 0); ChangeJunc("e1", 0); ChangeJunc("e3", 2); ChangeJunc("e29", 0); jc="e29";} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("e7", 0); ChangeJunc("e1", 0); ChangeJunc("e3", 0); ChangeJunc("e15", 0); jc="e15";} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e5", 0); ChangeJunc("e27", 0); ChangeJunc("e29", 0); jc="e31";} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 0); ChangeJunc("e9", 0); jc="e9";} else if ((nap==false and puin==6) or (puout==6 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 0); ChangeJunc("e9", 2); jc="e9";} else if ((nap==false and puin==7) or (puout==7 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 0); ChangeJunc("e13", 0); jc="e13";} else if ((nap==false and puin==8) or (puout==8 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 0); ChangeJunc("e13", 2); jc="e13";} else if ((nap==false and puin==9) or (puout==9 and nap==true)) {ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 2); ChangeJunc("e35", 0); jc="e35";} else if ((nap==false and puin==10) or (puout==10 and nap==true)){ChangeJunc("e7", 2); ChangeJunc("e27", 2); ChangeJunc("e11", 2); ChangeJunc("e33", 2); ChangeJunc("e35", 2); jc="e35";} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("e2", 2); ChangeJunc("e4", 0); jn="e4";} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 2); ChangeJunc("e8", 2); jn="e8";} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("e2", 2); ChangeJunc("e4", 2); jn="e4";} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 2); ChangeJunc("e8", 0); jn="e8";} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 2); ChangeJunc("e12", 2); jn="e12";} else if ((nap==true and puin==6) or (puout==6 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 2); ChangeJunc("e12", 0); jn="e12";} else if ((nap==true and puin==7) or (puout==7 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 2); jn="e14";} else if ((nap==true and puin==8) or (puout==8 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 2); jn="e26";} else if ((nap==true and puin==9) or (puout==9 and nap==false)) {ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 0); ChangeJunc("e28", 2); jn="e28";} else if ((nap==true and puin==10) or (puout==10 and nap==false)){ChangeJunc("e2", 0); ChangeJunc("e6", 0); ChangeJunc("e10", 0); ChangeJunc("e14", 0); ChangeJunc("e26", 0); ChangeJunc("e28", 0); jn="e28";} } if (pr!=3) {if (nap==true) junin=jn, junout=jc; else junin=jc, junout=jn;} } else if (razd==4) { if (ii==4) { // Крым if (puin==1) {ChangeJunc("r2",2); ChangeJunc("r4",2);} else if (puin==2) {ChangeJunc("r2",2); ChangeJunc("r4",0);} else if (puin==3) {ChangeJunc("r2",0); ChangeJunc("r6",2);} else if (puin==4) {ChangeJunc("r2",0); ChangeJunc("r6",0);} if (puout==1) {ChangeJunc("r1",0); ChangeJunc("r3",0);} else if (puout==4) {ChangeJunc("r1",2);} else if (puout==2) {ChangeJunc("r1",0); ChangeJunc("r3",2); ChangeJunc("r5",0);} else if (puout==3) {ChangeJunc("r1",0); ChangeJunc("r3",2); ChangeJunc("r5",2);} } else if (ii==3) { // Керчь-завод if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("n1", 2);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n3", 2); ChangeJunc("n5", 2);} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n3", 2); ChangeJunc("n5", 0);} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n3", 0); ChangeJunc("n7", 2);} else if ((nap==false and puin==5) or (puout==5 and nap==true)) {ChangeJunc("n1", 0); ChangeJunc("n3", 0); ChangeJunc("n7", 0);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("n2", 0);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 0);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 0);} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 2); ChangeJunc("n8", 0);} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("n2", 2); ChangeJunc("n4", 2); ChangeJunc("n6", 2); ChangeJunc("n8", 2);} } else if (ii==2) { // Керчь if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("z1", 0); ChangeJunc("z3", 0); ChangeJunc("z89", 2);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("z1", 0); ChangeJunc("z3", 2);} else if (puin==11 or puout==11) {ChangeJunc("z1", 0); ChangeJunc("z3", 0); ChangeJunc("z89", 0);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("z42", 2); ChangeJunc("z36", 0); ChangeJunc("z38", 0); ChangeJunc("z34", 0);} // else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("z42", 0); ChangeJunc("z36", 0);} else if (puin==12 or puout==12) {ChangeJunc("z38", 2); ChangeJunc("z36", 0); ChangeJunc("z42", 2);} } else if (ii==1) { // Керчь Южная if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("m1", 0); ChangeJunc("m3", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("m1", 0); ChangeJunc("m3", 2);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) ChangeJunc("m1", 2); if ((nap==true and puin==3) or (puout==3 and nap==false)) ChangeJunc("m2", 2); else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("m2", 0); ChangeJunc("m4", 2);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("m2", 0); ChangeJunc("m4", 0);} } else if (ii==0) { // Аршинцево if (puin==1) {ChangeJunc("x1", 0); ChangeJunc("x3", 0);} else if (puin==2) {ChangeJunc("x1", 0); ChangeJunc("x3", 2);} else if (puin==3) {ChangeJunc("x1", 2); ChangeJunc("x5", 0);} else if (puin==4) {ChangeJunc("x1", 2); ChangeJunc("x5", 2); ChangeJunc("x7", 0);} else if (puin==5) {ChangeJunc("x1", 2); ChangeJunc("x5", 2); ChangeJunc("x7", 2);} } } else if (razd==5) { if (ii==4) { // Саки if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("ww2", 2); ChangeJunc("ww18", 2);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("ww2", 2); ChangeJunc("ww18", 0);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("ww1", 0); ChangeJunc("ww7", 0); ChangeJunc("ww13", 0);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("ww1", 0); ChangeJunc("ww7", 0); ChangeJunc("ww13", 2);} } else if (ii==2) { // Яркая if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("ua2", 2);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("ua2", 0); ChangeJunc("ua4", 2);} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("ua2", 0); ChangeJunc("ua4", 0);} if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("ua1", 0); ChangeJunc("ua3", 0);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("ua1", 0); ChangeJunc("ua3", 2);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("ua1", 2);} } else if (ii==5) { // Прибрежное if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("xp2", 0); ChangeJunc("xp4", 2);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("xp2", 2); ChangeJunc("xp6", 0);} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("xp2", 2); ChangeJunc("xp6", 2);} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("xp2", 0); ChangeJunc("xp4", 0);} if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("xp1", 0); ChangeJunc("xp3", 0); ChangeJunc("xp7", 2);} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("xp1", 0); ChangeJunc("xp3", 0); ChangeJunc("xp7", 0);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("xp1", 0); ChangeJunc("xp3", 2);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("xp1", 2);} } else if (ii==6) { // Евпатория-тов. if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("yy12", 0); ChangeJunc("yy2", 2);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("yy12", 2); ChangeJunc("yy16", 0);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("yy12", 2); ChangeJunc("yy16", 2);} if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("yy1", 0); ChangeJunc("yy5", 2);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("yy1", 0); ChangeJunc("yy5", 0); ChangeJunc("yy27", 2);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("yy1", 0); ChangeJunc("yy5", 2); ChangeJunc("yy27", 0);} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("yy1", 2); ChangeJunc("yy17", 0);} else if ((nap==true and puin==5) or (puout==5 and nap==false)) {ChangeJunc("yy1", 2); ChangeJunc("yy17", 2); ChangeJunc("yy19", 0);} else if ((nap==true and puin==6) or (puout==6 and nap==false)) {ChangeJunc("yy1", 2); ChangeJunc("yy17", 2); ChangeJunc("yy19", 2); ChangeJunc("yy21", 0);} else if ((nap==true and puin==7) or (puout==7 and nap==false)) {ChangeJunc("yy1", 2); ChangeJunc("yy17", 2); ChangeJunc("yy19", 2); ChangeJunc("yy21", 2);} } else if (ii==7) { // Евпатория-кур. if (pu==1) {ChangeJunc("zz11", 2);} else if (pu==13) {ChangeJunc("zz11", 0);} else if (pu==2) {ChangeJunc("zz11", 2); ChangeJunc("zz17", 2); ChangeJunc("zz23", 0);} else if (pu==3) {ChangeJunc("zz11", 2); ChangeJunc("zz17", 2); ChangeJunc("zz23", 2); ChangeJunc("zz27", 0); PostMessage(Router.GetGameObject("nm3zz"),"CTRL","MayOpen^true",10);} } else if (ii==0) { // Остряково if (pu==2) {ChangeJunc("tt24", 0); ChangeJunc("tt20", 2); ChangeJunc("tt16", 2);} else if (pu==3) {ChangeJunc("tt24", 2); ChangeJunc("tt30", 2); ChangeJunc("tt3", 0);} else if (pu==1) {ChangeJunc("tt24", 2); ChangeJunc("tt30", 0);} } } else if (razd==6) { if (ii==1) { // Вадим if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("va8", 0);} else if ((nap==false and puin==4) or (puout==4 and nap==true)) {ChangeJunc("va8", 2);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("va7", 2);} else if ((nap==true and puin==4) or (puout==4 and nap==false)) {ChangeJunc("va7", 0);} } else if (ii==2) { // Армянск if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("ar2", 0);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("ar2", 2); ChangeJunc("ar4", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("ar2", 2); ChangeJunc("ar4", 2);} if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("ar1", 0); ChangeJunc("ar3", 0);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("ar1", 0); ChangeJunc("ar3", 2);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("ar1", 2);} } else if (ii==3) { // Красноперекопск if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("kr4", 0); ChangeJunc("kr20", 0);} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("kr18", 0);} else if ((nap==false and puin==9) or (puout==9 and nap==true)) {ChangeJunc("kr4", 2); ChangeJunc("kr20", 0);} else if ((nap==false and puin==10) or (puout==10 and nap==true)) {ChangeJunc("kr2", 0);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("kr6", 2); ChangeJunc("kr20", 0);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("kr7", 0); ChangeJunc("kr19", 0);} else if ((nap==true and puin==9) or (puout==9 and nap==false)) {ChangeJunc("kr6", 0); ChangeJunc("kr20", 0);} else if ((nap==true and puin==7) or (puout==7 and nap==false)) {ChangeJunc("kr1", 2);} } else if (ii==4) { // Воинка if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("vo2", 0);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("vo2", 2); ChangeJunc("vo4", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("vo2", 2); ChangeJunc("vo4", 2);} if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("vo1", 0); ChangeJunc("vo5", 0);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("vo1", 0); ChangeJunc("vo5", 2);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("vo1", 2);} } else if (ii==5) { // Пахаревка if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("pa2", 0);} else if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("pa2", 2);} if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("pa1", 2);} else if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("pa1", 0);} } else if (ii==6) { // Богемка if ((nap==false and puin==2) or (puout==2 and nap==true)) {ChangeJunc("bo2", 2);} else if ((nap==false and puin==1) or (puout==1 and nap==true)) {ChangeJunc("bo2", 0); ChangeJunc("bo4", 2);} else if ((nap==false and puin==3) or (puout==3 and nap==true)) {ChangeJunc("bo2", 0); ChangeJunc("bo4", 0);} if ((nap==true and puin==2) or (puout==2 and nap==false)) {ChangeJunc("bo1", 0); ChangeJunc("bo3", 0);} else if ((nap==true and puin==1) or (puout==1 and nap==false)) {ChangeJunc("bo1", 0); ChangeJunc("bo3", 2);} else if ((nap==true and puin==3) or (puout==3 and nap==false)) {ChangeJunc("bo1", 2);} } else if (ii==7) { // Джанкой ChangeJunc("y116", 0); if (puin==2 or puout==2) ChangeJunc("y4", 0); else if (puout==4) {ChangeJunc("y2",0); ChangeJunc("y126",0); ChangeJunc("y54",2); ChangeJunc("y52",2); ChangeJunc("y86",0); ChangeJunc("y104",0);} else if (puin==17 or puout==17) {ChangeJunc("y102", 0); ChangeJunc("y84", 0); ChangeJunc("y52", 0);} else if (pu==6) {ChangeJunc("y58", 2); ChangeJunc("y8", 0); ChangeJunc("y6", 0);} else if (pu==7) {ChangeJunc("y58", 2); ChangeJunc("y8", 2); ChangeJunc("y6", 0);} else if (pu==8) {ChangeJunc("y58", 2); ChangeJunc("y6", 2); ChangeJunc("y10", 0);} else if (pu==9) {ChangeJunc("y58", 2); ChangeJunc("y6", 2); ChangeJunc("y10", 2);} } } } // конец нити стрелок thread void DelPopThread(){ // нить удаления попутных поездов Interface.Print ("wait poput on junction "+junout); OnJunction(train3,junout,4); Interface.Print ("junction "+junout+" OK"); Sleep(30); if (poput==true) { // на случай, если поезд уже удалён, не запускааем цикл vehd=train3.GetVehicles(); for (ip=0; ip1 or razd==2 or razd==4) puout=pu; JunThread(); PostMessage(Router.GetGameObject(lgz), "CTRL", "MayOpen^true", 10); Sleep(5); Interface.Print ("lgz="+lgz); Interface.Print ("TrainThread the end"); } // конец нити отслеживания встречных поездов thread void DelThread(){ // нить удаления поездов DEL0: if (razd>1) { if (poput==true) {poput=false; veh0=train3.GetVehicles(); for (ip=0; ip"+text+"")); else if (var==4) oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+text+"")); else if (var==0) oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+text+"")); else oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+text+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); } // конец нити подсказок thread void Flash() { for (fl=0; fl<13; ++fl) {br.SetWindowVisible(false); Sleep (0.5); br.SetWindowVisible(true); Sleep (0.5);}} thread void DopManThread() { // нить обработки параллельных событий при маневрах Interface.Print ("DopManThread is started"); time=World.GetGameTime(); // сравниваем время if (iHours < 12) fTime = 0.5 + (iHours / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); else fTime = ((iHours - 12) / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); if (np==0) { if (time<(fTime-0.5)) fTime=fTime+0.5; while(time6632))) {brrasp=Constructors.NewBrowser(); brrasp.SetWindowRect(50,100,840,520); brrasp.SetCloseEnabled(false); brrasp.LoadHTMLFile(GetAsset(), "razd5.html");} else if (razd==1) {brrasp=Constructors.NewBrowser(); brrasp.SetWindowRect(50,100,950,660); brrasp.SetCloseEnabled(false); brrasp.LoadHTMLFile(GetAsset(), "razd1.html"); } else if (razd==3 and np<6755) {brrasp=Constructors.NewBrowser(); brrasp.SetWindowRect(50,100,950,500); brrasp.SetCloseEnabled(true); brrasp.LoadHTMLFile(GetAsset(), "razd3.html");} else if (razd==6) {brrasp=Constructors.NewBrowser(); brrasp.SetWindowRect(50,100,840,520); brrasp.SetCloseEnabled(false); brrasp.LoadHTMLFile(GetAsset(), "razd6.html");} else { brrasp=Constructors.NewBrowser(); brrasp.SetWindowRect(50,100,750,300); brrasp.SetCloseEnabled(false); if (razd==2) brrasp.LoadHTMLFile(GetAsset(), "razd2.html"); else if (razd==3) brrasp.LoadHTMLFile(GetAsset(), "razd0.html"); else if (razd==4) brrasp.LoadHTMLFile(GetAsset(), "razd4.html"); } brrasp.SetWindowVisible(true); wait() {on "Browser-URL", "live://yell": {brrasp.SetWindowVisible(false);}} } } } // конец нити вызова расписания thread void FerstThread(){ // нить смены погоды int wst, we=0; for (wst=0; wst<8; wst++) { while (we<4){ if (wst==0 and Math.Rand(0,10)>5) we=Math.Rand(0,4); World.SetWeather (we,0); if (we==0) Sleep (Math.Rand(4800,6000)); else Sleep (Math.Rand(2100,2700)); ++we; } if (Math.Rand(0,10)>6) we=4; else we=3; while (we!=0){ World.SetWeather (we,0); Sleep (Math.Rand(900,1800)); --we; } } } // конец нити смены погоды thread void SevenThread(){ // нить инициализации SEVEN: // im - номер станции прибытия, st - номер станции отправления while (seven==true) { if (np==7) {im=16; st=2; razd=1; iHours=22, iMins=40;} else if (np==8) {im=1; st=16; razd=1; iHours=0, iMins=53;} else if (np==11) {im=16; st=2; razd=1; iHours=7, iMins=51;} else if (np==12) {im=1; st=16; razd=1; iHours=16, iMins=45;} else if (np==17) {im=16; st=2; razd=1; iHours=10, iMins=45;} else if (np==18) {im=1; st=16; razd=1; iHours=19, iMins=32;} else if (np==27) {im=16; st=2; razd=1; iHours=7, iMins=8;} else if (np==28) {im=1; st=16; razd=1; iHours=20, iMins=11;} else if (np==39) {im=16; st=2; razd=1; iHours=2, iMins=5;} else if (np==40) {im=1; st=16; razd=1; iHours=14, iMins=41;} else if (np==47) {im=16; st=2; razd=1; iHours=3, iMins=54;} else if (np==48) {im=1; st=16; razd=1; iHours=21, iMins=38;} else if (np==53) {im=16; st=2; razd=1; iHours=12, iMins=52;} else if (np==54) {im=1; st=16; razd=1; iHours=19, iMins=43;} else if (np==67) {im=16; st=2; razd=1; iHours=18, iMins=11;} else if (np==68) {im=1; st=16; razd=1; iHours=11, iMins=43;} else if (np==81) {im=16; st=2; razd=1; iHours=4, iMins=25;} else if (np==82) {im=1; st=16; razd=1; iHours=22, iMins=16;} else if (np==85) {im=16; st=2; razd=1; iHours=7, iMins=41;} else if (np==86) {im=1; st=16; razd=1; iHours=12, iMins=11;} else if (np==87) {im=16; st=2; razd=1; iHours=7, iMins=26;} else if (np==88) {im=1; st=16; razd=1; iHours=13, iMins=21;} else if (np==89) {im=16; st=2; razd=1; iHours=3, iMins=44;} else if (np==90) {im=1; st=16; razd=1; iHours=21, iMins=46;} else if (np==97) {im=7; st=2; razd=1; iHours=16, iMins=19;} // (Москва)-Джанкой-Владиславовка-Керчь else if (np==98) {im=0; st=7; razd=2; iHours=9, iMins=11; speed=60;} // Керчь-Владиславовка-Джанкой-(Москва) else if (np==99) {im=16; st=2; razd=1; iHours=8, iMins=40;} else if (np==100) {im=1; st=16; razd=1; iHours=12, iMins=58;} else if (np==137) {im=16; st=2; razd=1; iHours=10, iMins=1;} else if (np==138) {im=1; st=16; razd=1; iHours=17, iMins=16;} else if (np==141) {im=16; st=2; razd=1; iHours=7, iMins=11;} else if (np==142) {im=1; st=16; razd=1; iHours=15, iMins=56;} else if (np==143) {im=16; st=2; razd=1; iHours=4, iMins=15;} else if (np==144) {im=1; st=16; razd=1; iHours=20, iMins=46;} else if (np==146) {im=1; st=16; razd=1; iHours=19, iMins=51;} // Симферополь-Фундуклеевка else if (np==211) {im=14; st=10; razd=3; iHours=20, iMins=13; speed=50;} else if (np==212) {im=10; st=14; razd=3; iHours=11, iMins=1; speed=25;} else if (np==309) {im=7; st=1; razd=6; iHours=7, iMins=39; speed=80;} else if (np==310) {im=7; st=16; razd=1; iHours=16, iMins=56; speed=80;} else if (np==341) {im=16; st=2; razd=1; iHours=8, iMins=50; speed=65;} else if (np==342) {im=1; st=16; razd=1; iHours=17, iMins=36; speed=65;} else if (np==615) {im=0; st=7; razd=2; iHours=13, iMins=16; speed=60;} else if (np==616) {im=7; st=16; razd=1; iHours=23, iMins=11; speed=70;} else if (np==501) {im=16; st=2; razd=1; iHours=1, iMins=53;} else if (np==590) {im=7; st=16; razd=1; iHours=1, iMins=11;} else if (np==667) {im=0; st=7; razd=5; iHours=9, iMins=8;} else if (np==668) {im=14; st=16; razd=1; iHours=12, iMins=52;} // прицепной до Евпатории else if (np==869) {im=7; st=1; razd=6; iHours=18, iMins=15; speed=80;} // (Николаев)-Джанкой-Владиславовка-Керчь else if (np==870) {im=0; st=7; razd=2; iHours=5, iMins=56; speed=60;} // Керчь-Владиславовка-Джанкой-(Николаев) else if (np==6605) {im=14; st=1; razd=3; iHours=4, iMins=46; speed=60;} // Джанкой-Феодосия else if (np==6606) {im=1; st=14; razd=3; iHours=8, iMins=16; speed=25;} // Феодосия-Джанкой else if (np==6607) {im=14; st=1; razd=3; iHours=16, iMins=41; speed=60;} // Джанкой-Феодосия else if (np==6610) {im=1; st=14; razd=3; iHours=20, iMins=26; speed=25;} // Феодосия-Джанкой else if (np==6615) {im=16; st=7; razd=1; iHours=4, iMins=56; speed=60;} else if (np==6612) {im=7; st=16; razd=1; iHours=17, iMins=6; speed=65;} else if (np==6617) {im=16; st=7; razd=1; iHours=5, iMins=41; speed=60;} else if (np==6630) {im=7; st=16; razd=1; iHours=20, iMins=31; speed=65;} else if (np==6621) {im=16; st=7; razd=1; iHours=11, iMins=15; speed=60;} else if (np==6620) {im=7; st=16; razd=1; iHours=8, iMins=36; speed=65;} else if (np==6619) {im=16; st=2; razd=1; iHours=5, iMins=1; speed=60;} else if (np==6622) {im=2; st=16; razd=1; iHours=11, iMins=11; speed=65;} else if (np==6625) {im=16; st=2; razd=1; iHours=15, iMins=46; speed=60;} else if (np==6628) {im=2; st=16; razd=1; iHours=18, iMins=21; speed=65;} else if (np==6631) {im=16; st=2; razd=1; iHours=18, iMins=56; speed=60;} else if (np==6616) {im=1; st=16; razd=1; iHours=5, iMins=26; speed=65;} else if (np==6634) {im=14; st=16; razd=1; iHours=5, iMins=5; speed=60;} else if (np==6642) {im=14; st=16; razd=1; iHours=8, iMins=35; speed=60;} else if (np==6648) {im=14; st=16; razd=1; iHours=14, iMins=15; speed=60;} else if (np==6654) {im=14; st=16; razd=1; iHours=17, iMins=35; speed=60;} else if (np==6678) {im=0; st=7; razd=5; iHours=4, iMins=55; speed=60;} else if (np==6680) {im=0; st=7; razd=5; iHours=7, iMins=45; speed=60;} else if (np==6686) {im=0; st=7; razd=5; iHours=12, iMins=15; speed=60;} else if (np==6694) {im=0; st=7; razd=5; iHours=17, iMins=25; speed=60;} else if (np==6603) {im=16; st=7; razd=1; iHours=3, iMins=18; speed=65;} else if (np==6604) {im=7; st=16; razd=1; iHours=23, iMins=8; speed=65;} else if (np==6611) {im=16; st=2; razd=1; iHours=8, iMins=11; speed=70;} else if (np==6618) {im=2; st=16; razd=1; iHours=6, iMins=21; speed=65;} else if (np==6623) {im=16; st=2; razd=1; iHours=12, iMins=56; speed=70;} else if (np==6626) {im=2; st=16; razd=1; iHours=14, iMins=7; speed=65;} else if (np==6703) {im=7; st=2; razd=1; iHours=9, iMins=50; speed=70;} // (Мелитополь)-Новоалексеевка-Джанкой отменен else if (np==6704) {im=1; st=7; razd=1; iHours=17, iMins=45; speed=60;} // Джанкой-Новоалексеевка-(Мелитополь) отменен else if (np==6729) {im=4; st=2; razd=4; iHours=5, iMins=10; speed=40;} // Крым-Керчь Южная (кольцевой) отменен else if (np==6735) {im=4; st=2; razd=4; iHours=17, iMins=0; speed=40;} // Крым-Керчь Южная (кольцевой) отменен else if (np==6743) {im=10; st=1; razd=3; iHours=5, iMins=53; speed=25;} // Джанкой-Керчь else if (np==6744) {im=0; st=7; razd=2; iHours=20, iMins=41; speed=60;} // Керчь-Джанкой else if (np==6745) {im=10; st=1; razd=3; iHours=14, iMins=00; speed=60;} // Джанкой-Керчь else if (np==6746) {im=0; st=7; razd=2; iHours=8, iMins=31; speed=60;} // Керчь-Джанкой else if (np==6749) {im=7; st=1; razd=6; iHours=13, iMins=5; speed=60;} // Вадим-Джанкой-Феодосия else if (np==6750) {im=1; st=14; razd=3; iHours=6, iMins=1; speed=25;} // Феодосия-Джанкой-Вадим // else if (np==6756) {im=10; st=14; razd=3; iHours=8, iMins=1; speed=40;} // только суббота else if (np==6757) {im=14; st=10; razd=3; iHours=9, iMins=16; speed=60;} // Владиславовка-Феодосия (кольцевой) else if (np==6758) {im=10; st=14; razd=3; iHours=10, iMins=36; speed=25;} else if (np==6759) {im=14; st=10; razd=3; iHours=11, iMins=46; speed=60;} else if (np==6760) {im=10; st=14; razd=3; iHours=14, iMins=41; speed=25;} else if (np==6761) {im=14; st=10; razd=3; iHours=16, iMins=51; speed=60;} else if (np==6762) {im=9; st=14; razd=3; iHours=18, iMins=1; speed=25;} // Кировская-Феодосия else if (np==6763) {im=14; st=9; razd=3; iHours=19, iMins=41; speed=60;} else if (np==3440) {im=0; st=7; razd=2; } // грузовой из Крыма else if (np==3441) {im=15; st=2; razd=1;} // грузовой из Новоалексеевки else if (np==3442) {im=0; st=7; razd=2; } // грузовой из Керчь-порта else if (np==3443) {im=13; st=1; razd=3;} // грузовой из Джанкоя else if (np==3444) {im=1; st=13; razd=3;} // грузовой из Айвазовской else if (np==3445) {im=13; st=16; razd=1;} // перегон вагонов else if (np==3446) {im=0; st=7; razd=2; } // грузовой из Керчи else if (np==3447) {im=14; st=7; razd=1; } // грузовой из Джанкоя в Евпаторию else if (np==3448) {im=1; st=16; razd=1; iHours=11, iMins=13; speed=80;} // грузовой из Симферополя else if (np==3449) {im=7; st=1; razd=6; } // грузовой из Вадима lk=0; Sleep(0.02); } } // конец нити инициализации thread void ProductThread(Train train, int pt, bool passprod){ // нить загрузки продуктов в вагоны Vehicle[] vehp=train.GetVehicles(); if (passprod) for (pt; pt"+"ASSET "+it+": "+lg)); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); sostav[0]=GetAsset().LookupKUIDTable(it); train0=World.CreateTrain(sostav,"SA",true), Sleep(0.1), train0.SetHandBrake(true); Sleep(0.1); World.DeleteTrain(train0); } br.SetWindowVisible(false); br1.SetWindowVisible(true); goto START; } on "Browser-URL", "live://v1": { // вариант привязки к реальному времени oknotext=""+HTMLWindow.StartTable(); br1.SetWindowVisible(false); oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w22"))); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); time=World.GetGameTime(); seven=true; Sleep(1.5); SevenThread(); for (np=7; np<871; ++np) { // ищем среди пассажирских if (np>98 and np<341 and np!=137 and np!=138 and np!=141 and np!=309 and np!=310) continue; else if (np>342 and np!=501 and np!=590 and np!=615 and np!=616 and np!=869 and np!=870 and np!=667 and np!=668) continue; lk=np; while (lk!=0) Sleep(0.01); if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime=((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); if ((fTime>time) and (fTime-time)<0.007) {break;} } if (np==871) for (np=6603; np<6764; ++np) { // ищем среди пригородных if (np==6634 and np==6642 and np==6648 and np==6654 and np==6678 and np==6680 and np==6686 and np==6694) Sleep(0.1); else if (np>6631 and np<6743) continue; lk=np; while (lk!=0) Sleep(0.01); if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime=((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); if ((fTime>time) and (fTime-time)<0.007) {break;} } // если нет подходящего поезда, назначаем грузовой if (np>6763) np=Math.Rand(3440,3450); lk=np; while (lk!=0) Sleep(0.01); seven=false; } on "Browser-URL", "live://v2": { // ручной выбор br1.SetWindowVisible(false); Sleep(1); br1 = Constructors.NewBrowser(); br1.SetCloseEnabled(false); br.SetWindowVisible(false); br1.SetWindowSize(550,660); br1.SetWindowTop (50); br1.SetWindowLeft (360); text=strTable.GetString("w0"); br1.LoadHTMLFile(GetAsset(), text); wait(){ on "Browser-URL", "live://tr7": {np=7;} on "Browser-URL", "live://tr8": {np=8;} on "Browser-URL", "live://tr17": {np=17;} on "Browser-URL", "live://tr18": {np=18;} on "Browser-URL", "live://tr27": {np=27;} on "Browser-URL", "live://tr28": {np=28;} on "Browser-URL", "live://tr47": {np=47;} on "Browser-URL", "live://tr48": {np=48;} on "Browser-URL", "live://tr67": {np=67;} on "Browser-URL", "live://tr68": {np=68;} on "Browser-URL", "live://tr81": {np=81;} on "Browser-URL", "live://tr88": {np=88;} on "Browser-URL", "live://tr97": {np=97;} on "Browser-URL", "live://tr98": {np=98;} on "Browser-URL", "live://tr141": {np=141;} on "Browser-URL", "live://tr142": {np=142;} on "Browser-URL", "live://tr143": {np=143;} on "Browser-URL", "live://tr144": {np=144;} on "Browser-URL", "live://tr211": {np=211;} on "Browser-URL", "live://tr212": {np=212;} on "Browser-URL", "live://tr309": {np=309;} on "Browser-URL", "live://tr310": {np=310;} on "Browser-URL", "live://tr615": {np=615;} on "Browser-URL", "live://tr616": {np=616;} on "Browser-URL", "live://tr667": {np=667;} on "Browser-URL", "live://tr668": {np=668;} on "Browser-URL", "live://tr869": {np=869;} on "Browser-URL", "live://tr870": {np=870;} on "Browser-URL", "live://tr6621": {np=6621;} on "Browser-URL", "live://tr6620": {np=6620;} on "Browser-URL", "live://tr6625": {np=6625;} on "Browser-URL", "live://tr6628": {np=6628;} on "Browser-URL", "live://tr6631": {np=6631;} on "Browser-URL", "live://tr6616": {np=6616;} on "Browser-URL", "live://tr6703": {np=6603;} // замена on "Browser-URL", "live://tr6704": {np=6604;} // замена on "Browser-URL", "live://tr6611": {np=6611;} on "Browser-URL", "live://tr6618": {np=6618;} on "Browser-URL", "live://tr6622": {np=6622;} on "Browser-URL", "live://tr6623": {np=6623;} on "Browser-URL", "live://tr6625": {np=6625;} on "Browser-URL", "live://tr6626": {np=6626;} on "Browser-URL", "live://tr6642": {np=6642;} on "Browser-URL", "live://tr6680": {np=6680;} on "Browser-URL", "live://tr6729": {np=6729;} on "Browser-URL", "live://tr6735": {np=6735;} on "Browser-URL", "live://tr6743": {np=6743;} on "Browser-URL", "live://tr6744": {np=6744;} on "Browser-URL", "live://tr6745": {np=6745;} on "Browser-URL", "live://tr6746": {np=6746;} on "Browser-URL", "live://tr6750": {np=6750;} on "Browser-URL", "live://tr6749": {np=6749;} on "Browser-URL", "live://tr6757": {np=6757;} on "Browser-URL", "live://tr6762": {np=6762;} on "Browser-URL", "live://tr3446": {np=3446;} on "Browser-URL", "live://tr3444": {np=3444;} on "Browser-URL", "live://tr3448": {np=3448;} on "Browser-URL", "live://tr3446": {np=3446;} on "Browser-URL", "live://tr3440": {np=3440;} on "Browser-URL", "live://tr3441": {np=3441;} on "Browser-URL", "live://tr3443": {np=3443;} on "Browser-URL", "live://tr3445": {np=3445;} on "Browser-URL", "live://tr3442": {np=3442;} on "Browser-URL", "live://tr3447": {np=3447;} on "Browser-URL", "live://tr3449": {np=3449;} on "Browser-URL", "live://test": {np=6654;} // тестовый состав } its=111; lk=np; seven=true; SevenThread(); while (lk!=0) Sleep(0.01); seven=false; } on "Browser-URL", "live://v3": { razd=0; np=0;} // маневровый } KUID [] np870=new KUID[0]; if ((np<700 or np==3445) and (razd==1 or razd>4)) { // выбор электровоза br1=Constructors.NewBrowser(); br1.SetWindowSize(290,200); br1.SetWindowTop (350); br1.SetWindowLeft (450); br1.SetScrollEnabled(false); br1.SetCloseEnabled(false); br1.LoadHTMLFile(GetAsset(), "start3.html"); wait() { on "Browser-URL", "live://232": {tt=232;} on "Browser-URL", "live://234": {tt=234;} } } else if (np==869 or np==870) { // выбор МВПС br1=Constructors.NewBrowser(); br1.SetWindowSize(290,200); br1.SetWindowTop (350); br1.SetWindowLeft (450); br1.SetScrollEnabled(false); br1.SetCloseEnabled(false); br1.LoadHTMLFile(GetAsset(), "start4.html"); wait() { on "Browser-URL", "live://ra1": {np870[0]=GetAsset().LookupKUIDTable(181); np870[1]=GetAsset().LookupKUIDTable(182); np870[2]=GetAsset().LookupKUIDTable(183);} on "Browser-URL", "live://ra2": {np870[0]=GetAsset().LookupKUIDTable(195); np870[1]=GetAsset().LookupKUIDTable(196); np870[2]=GetAsset().LookupKUIDTable(197);} } } KUID [] er2DCC=new KUID[0]; // создаём электрички er2DCC[0]=GetAsset().LookupKUIDTable(156); er2DCC[1]=GetAsset().LookupKUIDTable(157); er2DCC[2]=GetAsset().LookupKUIDTable(158); er2DCC[3]=GetAsset().LookupKUIDTable(157); er2DCC[4]=GetAsset().LookupKUIDTable(158); er2DCC[5]=GetAsset().LookupKUIDTable(157); er2DCC[6]=GetAsset().LookupKUIDTable(157); er2DCC[7]=GetAsset().LookupKUIDTable(159); KUID [] er2=new KUID[0]; er2[0]=GetAsset().LookupKUIDTable(160); er2[1]=GetAsset().LookupKUIDTable(161); er2[2]=GetAsset().LookupKUIDTable(162); er2[3]=GetAsset().LookupKUIDTable(161); er2[4]=GetAsset().LookupKUIDTable(162); er2[5]=GetAsset().LookupKUIDTable(161); er2[6]=GetAsset().LookupKUIDTable(161); er2[7]=GetAsset().LookupKUIDTable(160); KUID [] poz=new KUID[0]; // пожарный поезд poz[0]=GetAsset().LookupKUIDTable(171); poz[1]=GetAsset().LookupKUIDTable(172); poz[2]=GetAsset().LookupKUIDTable(173); poz[3]=GetAsset().LookupKUIDTable(174); poz[4]=GetAsset().LookupKUIDTable(171); KUID [] vl8=new KUID[0]; // vl8 vl8[0]=GetAsset().LookupKUIDTable(177); vl8[1]=GetAsset().LookupKUIDTable(178); if (st6000) pr=1; else pr=2, okno=false; br1.SetWindowVisible(false); Interface.Print ("train "+np+": pr="+pr+", ii="+ii+", im="+im+", nap="+nap+", razd="+razd+", time="+iHours+"."+iMins); oknotext=""+HTMLWindow.StartTable(); oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(" "+""+strTable.GetString("w15"))); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); lk=0; if ((pr==1 and its==111) or np==3448) { // устанавливаем игровое время if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime=((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); if (np!=3445) World.SetGameTime(fTime); } if (razd==1) { //-------------------------------это раздел Геническ-Симферополь----------------------- int [] t7h = new int [0]; t7h [2]= 22; t7h [7]= 23; int [] t7m = new int [0]; t7m [2]= 44; t7m [7]= 34; int [] t8h = new int [0]; t8h [2]= 3; t8h [7]= 2; t8h [16]= 0; int [] t8m = new int [0]; t8m [2]= 4; t8m [7]= 14; t8m [16]= 57; int [] t11h = new int [0]; t11h [7]= 8; int [] t11m = new int [0]; t11m [7]= 45; int [] t12h = new int [0]; t12h [7]= 18; t12h [16]= 16; int [] t12m = new int [0]; t12m [7]= 6; t12m [16]= 50; int [] t17h = new int [0]; t17h [2]= 10; t17h [7]= 11; int [] t17m = new int [0]; t17m [2]= 50; t17m [7]= 41; int [] t18h = new int [0]; t18h [2]= 21; t18h [7]= 20; t18h [16]= 19; int [] t18m = new int [0]; t18m [2]= 43; t18m [7]= 55; t18m [16]= 36; int [] t27h = new int [0]; t27h [2]= 7; t27h [7]= 8; int [] t27m = new int [0]; t27m [2]= 12; t27m [7]= 19; int [] t28h = new int [0]; t28h [2]= 22; t28h [7]= 21; t28h [16]= 20; int [] t28m = new int [0]; t28m [2]= 33; t28m [7]= 45; t28m [16]= 15; int [] t39h = new int [0]; t39h [2]= 2; t39h [7]= 2; int [] t39m = new int [0]; t39m [2]= 9; t39m [7]= 57; int [] t40h = new int [0]; t40h [2]= 16; t40h [7]= 16; t40h [16]= 14; int [] t40m = new int [0]; t40m [2]= 48; t40m [7]= 0; t40m [16]= 45; int [] t47h = new int [0]; t47h [2]= 3; t47h [7]= 4; int [] t47m = new int [0]; t47m [2]= 58; t47m [7]= 45; int [] t48h = new int [0]; t48h [2]= 23; t48h [7]= 22; t48h [16]= 21; int [] t48m = new int [0]; t48m [2]= 29; t48m [7]= 52; t48m [16]= 42; int [] t53h = new int [0]; t53h [2]= 12; t53h [7]= 13; int [] t53m = new int [0]; t53m [2]= 56; t53m [7]= 40; int [] t54h = new int [0]; t54h [2]= 21; t54h [7]= 21; t54h [16]= 19; int [] t54m = new int [0]; t54m [2]= 57; t54m [7]= 3; t54m [16]= 47; int [] t67h = new int [0]; t67h [7]= 19; int [] t67m = new int [0]; t67m [7]= 9; int [] t68h = new int [0]; t68h [7]= 13; t68h [16]= 12; int [] t68m = new int [0]; t68m [7]= 30; t68m [16]= 0; int [] t81h = new int [0]; t81h [2]= 4; t81h [7]= 5; t81h [14]= 6; int [] t81m = new int [0]; t81m [2]= 29; t81m [7]= 20; t81m [14]= 24; int [] t82h = new int [0]; t82h [2]= 0; t82h [7]= 23; t82h [16]= 22; int [] t82m = new int [0]; t82m [2]= 26; t82m [7]= 37; t82m [16]= 20; int [] t85h = new int [0]; t85h [7]= 8; t85h [2]= 7; int [] t85m = new int [0]; t85m [7]= 34; t85m [2]= 45; int [] t86h = new int [0]; t86h [2]= 15; t86h [7]= 14; t86h [9]= 13; t86h [16]= 12; int [] t86m = new int [0]; t86m [2]= 19; t86m [7]= 28; t86m [9]= 23; t86m [16]= 15; int [] t87h = new int [0]; t87h [2]= 7; t87h [7]= 8; int [] t87m = new int [0]; t87m [2]= 30; t87m [7]= 26; int [] t88h = new int [0]; t88h [2]= 15; t88h [7]= 14; t88h [9]= 14; t88h [16]= 13; int [] t88m = new int [0]; t88m [2]= 35; t88m [7]= 48; t88m [9]= 23; t88m [16]= 25; int [] t89h = new int [0]; t89h [2]= 3; t89h [7]= 4; int [] t89m = new int [0]; t89m [2]= 48; t89m [7]= 53; int [] t90h = new int [0]; t90h [2]= 0; t90h [7]= 23; t90h [16]= 21; int [] t90m = new int [0]; t90m [2]= 6; t90m [7]= 18; t90m [16]= 50; int [] t99h = new int [0]; t99h [2]= 8; t99h [7]= 9; int [] t99m = new int [0]; t99m [2]= 44; t99m [7]= 28; int [] t100h = new int [0]; t100h [2]= 14; t100h [7]= 14; t100h [16]= 13; int [] t100m = new int [0]; t100m [2]= 56; t100m [7]= 12; t100m [16]= 3; int [] t137h = new int [0]; t137h [2]= 10; t137h [7]= 10; int [] t137m = new int [0]; t137m [2]= 7; t137m [7]= 58; int [] t138h = new int [0]; t138h [2]= 19; t138h [7]= 18; t138h [16]= 17; int [] t138m = new int [0]; t138m [2]= 37; t138m [7]= 46; t138m [16]= 20; int [] t141h = new int [0]; t141h [7]= 8; int [] t141m = new int [0]; t141m [7]= 9; int [] t142h = new int [0]; t142h [7]= 17; t142h [16]= 16; int [] t142m = new int [0]; t142m [7]= 19; t142m [16]= 0; int [] t143h = new int [0]; t143h [2]= 4; t143h [7]= 5; t143h [9]= 5; t143h [14]= 6; int [] t143m = new int [0]; t143m [2]= 19; t143m [7]= 12; t143m [9]= 36; t143m [14]= 14; int [] t144h = new int [0]; t144h [16]= 20; t144h [14]= 21; t144h [9]= 21; t144h [7]= 22; t144h [2]= 23; int [] t144m = new int [0]; t144m [16]= 50; t144m [14]= 13; t144m [9]= 59; t144m [7]= 26; t144m [2]= 12; int [] t146h = new int [0]; t146h [2]= 22; t146h [7]= 21; t146h [16]= 19; int [] t146m = new int [0]; t146m [2]= 12; t146m [7]= 15; t146m [16]= 55; t310h [7]= 18; t310h [9]= 18; t310h [12]= 17; t310h [16]= 17; t310m [7]= 48; t310m [9]= 3; t310m [12]= 40; t310m [16]= 0; int [] t341h = new int [0]; t341h [2]= 8; t341h [7]= 10; t341h [9]= 10; t341h [14]= 11; int [] t341m = new int [0]; t341m [2]= 54; t341m [7]= 18; t341m [9]= 46; t341m [14]= 29; int [] t342h = new int [0]; t342h [2]= 20; t342h [7]= 19; t342h [9]= 18; t342h [12]= 18; t342h [14]= 18; t342h [16]= 17; int [] t342m = new int [0]; t342m [2]= 15; t342m [7]= 12; t342m [9]= 48; t342m [12]= 24; t342m [14]= 3; t342m [16]= 40; int [] t501h = new int [0]; t501h [2]= 1; t501h [7]= 2; int [] t501m = new int [0]; t501m [2]= 57; t501m [7]= 49; int [] t590h = new int [0]; t590h [7]= 2; t590h [16]= 1; int [] t590m = new int [0]; t590m [7]= 50; t590m [16]= 15; int [] t6603h = new int [0]; t6603h [7]= 3; t6603h [9]= 3; t6603h [12]= 4; t6603h [14]= 4; int [] t6603m = new int [0]; t6603m [7]= 25; t6603m [9]= 52; t6603m [12]= 16; t6603m [14]= 41; int [] t6604h = new int [0]; t6604h [8]= 0; t6604h [9]= 0; t6604h [10]= 0; t6604h [11]= 0; t6604h [12]= 0; t6604h [13]= 23; t6604h [14]= 23; t6604h [15]= 23; t6604h [16]= 23; int [] t6604m = new int [0]; t6604m [8]= 47; t6604m [9]= 36; t6604m [10]= 24; t6604m [11]= 16; t6604m [12]= 6; t6604m [13]= 48; t6604m [14]= 36; t6604m [15]= 26; t6604m [16]= 15; int [] t6612h = new int [0]; t6612h [8]= 19; t6612h [9]= 18; t6612h [10]= 18; t6612h [11]= 18; t6612h [12]= 18; t6612h [13]= 17; t6612h [14]= 17; t6612h [15]= 17; t6612h [16]= 17; int [] t6612m = new int [0]; t6612m [8]= 4; t6612m [9]= 50; t6612m [10]= 24; t6612m [11]= 18; t6612m [12]= 8; t6612m [13]= 46; t6612m [14]= 36; t6612m [15]= 22; t6612m [16]= 10; int [] t6615h = new int [0]; t6615h [8]= 5; t6615h [9]= 5; t6615h [10]= 6; t6615h [11]= 6; t6615h [12]= 6; t6615h [13]= 6; t6615h [14]= 6; t6615h [15]= 7; t6615h [7]= 5; int [] t6615m = new int [0]; t6615m [8]= 18; t6615m [9]= 50; t6615m [10]= 5; t6615m [11]= 13; t6615m [12]= 23; t6615m [13]= 38; t6615m [14]= 51; t6615m [15]= 5; t6615m [7]= 0; int [] t6616h = new int [0]; t6616h [2]= 8; t6616h [3]= 8; t6616h [4]= 8; t6616h [5]= 7; t6616h [6]= 7; t6616h [7]= 7; t6616h [8]= 7; t6616h [9]= 6; t6616h [10]= 6; t6616h [11]= 6; t6616h [12]= 6; t6616h [13]= 6; t6616h [14]= 5; t6616h [15]= 5; t6616h [16]= 5; int [] t6616m = new int [0]; t6616m [2]= 45; t6616m [3]= 31; t6616m [4]= 1; t6616m [5]= 49; t6616m [6]= 38; t6616m [7]= 23; t6616m [8]= 3; t6616m [9]= 48; t6616m [10]= 34; t6616m [11]= 28; t6616m [12]= 20; t6616m [13]= 5; t6616m [14]= 55; t6616m [15]= 42; t6616m [16]= 30; int [] t6617h = new int [0]; t6617h [8]= 6; t6617h [9]= 6; t6617h [10]= 6; t6617h [11]= 6; t6617h [12]= 6; t6617h [13]= 7; t6617h [14]= 7; t6617h [15]= 7; t6617h [7]= 5; int [] t6617m = new int [0]; t6617m [8]= 2; t6617m [9]= 19; t6617m [10]= 33; t6617m [11]= 39; t6617m [12]= 48; t6617m [13]= 4; t6617m [14]= 15; t6617m [15]= 29; t6617m [7]= 45; int [] t6619h = new int [0]; t6619h [2]= 5; t6619h [3]= 5; t6619h [4]= 5; t6619h [5]= 5; t6619h [6]= 6; t6619h [7]= 6; t6619h [8]= 6; t6619h [9]= 6; t6619h [10]= 7; t6619h [11]= 7; t6619h [12]= 7; t6619h [13]= 7; t6619h [14]= 7; t6619h [15]= 8; int [] t6619m = new int [0]; t6619m [2]= 5; t6619m [3]= 10; t6619m [4]= 44; t6619m [5]= 56; t6619m [6]= 7; t6619m [7]= 25; t6619m [8]= 41; t6619m [9]= 59; t6619m [10]= 12; t6619m [11]= 19; t6619m [12]= 28; t6619m [13]= 43; t6619m [14]= 54; t6619m [15]= 8; int [] t6620h = new int [0]; t6620h [8]= 10; t6620h [9]= 10; t6620h [10]= 9; t6620h [11]= 9; t6620h [12]= 9; t6620h [13]= 9; t6620h [14]= 9; t6620h [15]= 8; t6620h [16]= 8; int [] t6620m = new int [0]; t6620m [8]= 20; t6620m [9]= 4; t6620m [10]= 50; t6620m [11]= 43; t6620m [12]= 35; t6620m [13]= 19; t6620m [14]= 8; t6620m [15]= 53; t6620m [16]= 40; int [] t6621h = new int [0]; t6621h [8]= 11; t6621h [9]= 12; t6621h [10]= 12; t6621h [11]= 12; t6621h [12]= 12; t6621h [13]= 12; t6621h [14]= 13; t6621h [15]= 13; t6621h [7]= 11; int [] t6621m = new int [0]; t6621m [8]= 40; t6621m [9]= 6; t6621m [10]= 20; t6621m [11]= 27; t6621m [12]= 36; t6621m [13]= 51; t6621m [14]= 4; t6621m [15]= 18; t6621m [7]= 20; int [] t6622h = new int [0]; t6622h [3]= 14; t6622h [4]= 13; t6622h [5]= 13; t6622h [6]= 13; t6622h [7]= 13; t6622h [8]= 12; t6622h [9]= 12; t6622h [10]= 12; t6622h [11]= 12; t6622h [12]= 12; t6622h [13]= 11; t6622h [14]= 11; t6622h [15]= 11; t6622h [16]= 11; int [] t6622m = new int [0]; t6622m [3]= 28; t6622m [4]= 59; t6622m [5]= 42; t6622m [6]= 31; t6622m [7]= 16; t6622m [8]= 56; t6622m [9]= 41; t6622m [10]= 27; t6622m [11]= 21; t6622m [12]= 12; t6622m [13]= 51; t6622m [14]= 41; t6622m [15]= 27; t6622m [16]= 15; int [] t6625h = new int [0]; t6625h [2]= 15; t6625h [3]= 15; t6625h [4]= 16; t6625h [5]= 16; t6625h [6]= 16; t6625h [7]= 17; t6625h [8]= 17; t6625h [9]= 17; t6625h [10]= 18; t6625h [11]= 18; t6625h [12]= 18; t6625h [13]= 18; t6625h [14]= 18; t6625h [15]= 19; int [] t6625m = new int [0]; t6625m [2]= 50; t6625m [3]= 59; t6625m [4]= 29; t6625m [5]= 40; t6625m [6]= 51; t6625m [7]= 20; t6625m [8]= 38; t6625m [9]= 55; t6625m [10]= 10; t6625m [11]= 17; t6625m [12]= 27; t6625m [13]= 42; t6625m [14]= 55; t6625m [15]= 9; int [] t6628h = new int [0]; t6628h [3]= 21; t6628h [4]= 21; t6628h [5]= 20; t6628h [6]= 20; t6628h [7]= 20; t6628h [8]= 20; t6628h [9]= 19; t6628h [10]= 19; t6628h [11]= 19; t6628h [12]= 19; t6628h [13]= 19; t6628h [14]= 18; t6628h [15]= 18; t6628h [16]= 18; int [] t6628m = new int [0]; t6628m [3]= 51; t6628m [4]= 30; t6628m [5]= 58; t6628m [6]= 47; t6628m [7]= 32; t6628m [8]= 14; t6628m [9]= 59; t6628m [10]= 31; t6628m [11]= 25; t6628m [12]= 17; t6628m [13]= 0; t6628m [14]= 50; t6628m [15]= 37; t6628m [16]= 25; int [] t6630h = new int [0]; t6630h [8]= 22; t6630h [9]= 22; t6630h [10]= 21; t6630h [11]= 21; t6630h [12]= 21; t6630h [13]= 21; t6630h [14]= 21; t6630h [15]= 20; t6630h [16]= 20; int [] t6630m = new int [0]; t6630m [8]= 26; t6630m [9]= 11; t6630m [10]= 57; t6630m [11]= 51; t6630m [12]= 40; t6630m [13]= 12; t6630m [14]= 2; t6630m [15]= 48; t6630m [16]= 35; int [] t6631h = new int [0]; t6631h [2]= 19; t6631h [3]= 19; t6631h [4]= 19; t6631h [5]= 19; t6631h [6]= 19; t6631h [7]= 20; t6631h [8]= 20; t6631h [9]= 20; t6631h [10]= 21; t6631h [11]= 21; t6631h [12]= 21; t6631h [13]= 21; t6631h [14]= 21; t6631h [15]= 21; int [] t6631m = new int [0]; t6631m [2]= 0; t6631m [3]= 0; t6631m [4]= 33; t6631m [5]= 43; t6631m [6]= 54; t6631m [7]= 15; t6631m [8]= 32; t6631m [9]= 50; t6631m [10]= 4; t6631m [11]= 10; t6631m [12]= 18; t6631m [13]= 31; t6631m [14]= 41; t6631m [15]= 54; int [] t6703h = new int [0]; t6703h [2]= 9; t6703h [3]= 10; t6703h [4]= 10; t6703h [5]= 10; t6703h [6]= 10; int [] t6703m = new int [0]; t6703m [2]= 54; t6703m [3]= 2; t6703m [4]= 23; t6703m [5]= 33; t6703m [6]= 44; int [] t6704h = new int [0]; t6704h [2]= 19; t6704h [4]= 18; t6704h [5]= 18; t6704h [6]= 18; t6704h [7]= 17; int [] t6704m = new int [0]; t6704m [2]= 15; t6704m [4]= 38; t6704m [5]= 18; t6704m [6]= 5; t6704m [7]= 50; int [] t6611h = new int [0]; t6611h [2]= 8; t6611h [3]= 8; t6611h [4]= 9; t6611h [5]= 9; t6611h [6]= 9; t6611h [7]= 10; t6611h [8]= 10; t6611h [9]= 10; t6611h [10]= 11; t6611h [11]= 11; t6611h [12]= 11; t6611h [13]= 11; t6611h [14]= 11; t6611h [15]= 11; int [] t6611m = new int [0]; t6611m [2]= 15; t6611m [3]= 24; t6611m [4]= 7; t6611m [5]= 20; t6611m [6]= 31; t6611m [7]= 2; t6611m [8]= 38; t6611m [9]= 56; t6611m [10]= 7; t6611m [11]= 13; t6611m [12]= 21; t6611m [13]= 32; t6611m [14]= 44; t6611m [15]= 55; int [] t6618h = new int [0]; t6618h [3]= 9; t6618h [4]= 9; t6618h [5]= 8; t6618h [6]= 8; t6618h [7]= 8; t6618h [8]= 7; t6618h [9]= 7; t6618h [10]= 7; t6618h [11]= 7; t6618h [12]= 7; t6618h [13]= 6; t6618h [14]= 6; t6618h [15]= 6; t6618h [16]= 6; int [] t6618m = new int [0]; t6618m [3]= 43; t6618m [4]= 14; t6618m [5]= 54; t6618m [6]= 43; t6618m [7]= 27; t6618m [8]= 57; t6618m [9]= 42; t6618m [10]= 28; t6618m [11]= 22; t6618m [12]= 14; t6618m [13]= 59; t6618m [14]= 49; t6618m [15]= 36; t6618m [16]= 25; int [] t6623h = new int [0]; t6623h [2]= 13; t6623h [3]= 13; t6623h [4]= 13; t6623h [5]= 14; t6623h [6]= 14; t6623h [7]= 14; t6623h [8]= 15; t6623h [9]= 15; t6623h [10]= 15; t6623h [11]= 15; t6623h [12]= 15; t6623h [13]= 16; t6623h [14]= 16; t6623h [15]= 16; int [] t6623m = new int [0]; t6623m [2]= 00; t6623m [3]= 10; t6623m [4]= 50; t6623m [5]= 3; t6623m [6]= 16; t6623m [7]= 47; t6623m [8]= 5; t6623m [9]= 21; t6623m [10]= 34; t6623m [11]= 40; t6623m [12]= 49; t6623m [13]= 4; t6623m [14]= 15; t6623m [15]= 29; int [] t6626h = new int [0]; t6626h [3]= 17; t6626h [4]= 17; t6626h [5]= 16; t6626h [6]= 16; t6626h [7]= 16; t6626h [8]= 15; t6626h [9]= 15; t6626h [10]= 15; t6626h [11]= 15; t6626h [12]= 15; t6626h [13]= 14; t6626h [14]= 14; t6626h [15]= 14; t6626h [16]= 14; int [] t6626m = new int [0]; t6626m [3]= 47; t6626m [4]= 17; t6626m [5]= 56; t6626m [6]= 45; t6626m [7]= 30; t6626m [8]= 58; t6626m [9]= 42; t6626m [10]= 19; t6626m [11]= 12; t6626m [12]= 3; t6626m [13]= 47; t6626m [14]= 37; t6626m [15]= 23; t6626m [16]= 11; t668h [16]= 14; t668m [16]= 5; t6634h [16]= 5; t6634h [15]= 5; t6634m [16]= 10; t6634m [15]= 23; t6642h [16]= 8; t6642h [15]= 8; t6642m [16]= 40; t6642m [15]= 52; t6648h [16]= 14; t6648h [15]= 14; t6648m [16]= 20; t6648m [15]= 33; t6654h [16]= 17; t6654h [15]= 17; t6654m [16]= 40; t6654m [15]= 53; //-------------------------------создаём наш поезд----------------------------------- // задаём имя маркера, на который ставим наш поезд if (np==6619 or np==6625 or np==6623) mark="SFF1C", pu=4; else if (np==6611) mark="SFF5C", pu=3; else if (np==6704) mark="TY6704", pu=1; else if (np==6617) mark="SYP1", pu=17; else if (nap==true and st==7) mark="SYP3", pu=18; else if (nap==true and pr==1 and np>6000) mark="SFF0C", pu=1; else if (np==11 or np==67 or np==141) mark="START", pu=1; else if (nap==true) mark="SFF0", pu=1; else if (nap==false and pr==1 and np>6000) mark="SSS16", pu=8; else if (np==68 or np==3445) mark="ssd2", pu=5; else if (np==40 or np==82 or np==8) mark="SSS2", pu=1; else if (np==86 or np==54 or np==138 or np==668) mark="SSS4", pu=2; else if (np==88 or np==12 or np==144 or np==90) mark="SSS6", pu=3; else if (np==342 or np==142) mark="SSS8", pu=4; else if (np==100 or np==18 or np==48) mark="SSS10", pu=5; else if (np==616) mark="SSS12", pu=6; else if (np==310 or np==590 or np==146) mark="SSS14", pu=7; else if (nap==false and pr==1) mark="SSS2", pu=1; else mark="SRR12", pu=6; sostav=new KUID[0]; // if (np==310) mark="SKK6C", pu=2, st=9, ii=9; // тест if (np>6600) { // электричка Mytrain=World.CreateTrain(er2,mark,true); Mytrain.GetVehicles()[6].Reverse(); Mytrain.GetVehicles()[7].Reverse(); ProductThread(Mytrain,0,true); Sleep(2); if ((ii==2 and pu!=1) or ii==16) side=true; DoorsThread(Mytrain,0,true); } else if (np==3448) {Mytrain=World.CreateTrain(vl8, "ssd0", true), pr=3; Mytrain.GetVehicles()[1].Reverse();} // грузовой 3448 else if (np==3441) {Mytrain=World.CreateTrain(vl8, "SGG6", true), pr=2, pu=5; Mytrain.GetVehicles()[1].Reverse();} // грузовой 3441 else if (np==3447) {Mytrain=World.CreateTrain(vl8, "SYD0", true), pr=3, pu=1; Mytrain.GetVehicles()[1].Reverse();} // грузовой 3447 else if (np==616) {sostav[0]=GetAsset().LookupKUIDTable(232); for (is=1; is<6; ++is) sostav[is]=GetAsset().LookupKUIDTable(204); Mytrain=World.CreateTrain(sostav,mark,true);} else if (np==668) {sostav[0]=GetAsset().LookupKUIDTable(0); Mytrain=World.CreateTrain(sostav,mark,true); pr=3;} else { if (tt<234) sostav[0]=GetAsset().LookupKUIDTable(tt), lk=0; else {sostav[0]=GetAsset().LookupKUIDTable(tt); sostav[1]=GetAsset().LookupKUIDTable(tt+1), lk=1;} // локомотив if (np==7 or np==8) {for (is=sostav.size()+1; is<8; ++is) sostav[is]=GetAsset().LookupKUIDTable(169); for (is=8; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(170); sostav[8]=GetAsset().LookupKUIDTable(175);} else if (np==97) { sostav[lk+1]=GetAsset().LookupKUIDTable(176); for (is=sostav.size()+1; is<10; ++is) sostav[is]=GetAsset().LookupKUIDTable(216); for (is=10; is<14; ++is) sostav[is]=GetAsset().LookupKUIDTable(215); sostav[15]=GetAsset().LookupKUIDTable(220); sostav[16]=GetAsset().LookupKUIDTable(219);} else if (np==39 or np==40) {for (is=sostav.size()+1; is<12; ++is) sostav[is]=GetAsset().LookupKUIDTable(184);} else if (np==99 or np==100) {for (is=sostav.size()+1; is<9; ++is) sostav[is]=GetAsset().LookupKUIDTable(217); for (is=9; is<15; ++is) sostav[is]=GetAsset().LookupKUIDTable(218); sostav[15]=GetAsset().LookupKUIDTable(185);} else if (np==141 or np==142 or np==53 or np==54) for (is=sostav.size()+1; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(170); else if (np==67) {for (is=sostav.size()+1; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(168); sostav[is]=GetAsset().LookupKUIDTable(198);} else if (np==309 or np==310 or np==590 or np==28 or np==90 or np==341 or np==342) {for (is=sostav.size()+1; is<10; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(203,208));} else if (np!=68 and np!=3445) {for (is=sostav.size()+1; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(202,213));} else if (np==68) pr=3; if (np==68 or np==3445) Mytrain=World.CreateTrain(sostav,mark,false); else Mytrain=World.CreateTrain(sostav,mark,true); Sleep(0.2); if (lk==1) Mytrain.GetVehicles()[1].Reverse(); // если лок двухсекционный, разворачиваем вторую секцию } if (np==3445) pr=1; Mytrain.SetTrainPriorityNumber(pr); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); // сажаем в поезд машиниста Антона World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив сами Interface.Print ("sostav "+np+" OK"); Mytrain.SetPantographState(1); if (ii==7) SoundThread(); if (mark=="START") {PostMessage(Router.GetGameObject("nff"), "CTRL", "MayOpen^true", 2); PostMessage(Router.GetGameObject("n1ff"), "CTRL", "MayOpen^true", 1);} else if (ii==2 and pu==1) PostMessage(Router.GetGameObject("n1ff"), "CTRL", "MayOpen^true", 2); // Открываем выходной светофор в Новоалексеевке if (np==3448) npw=3406; else if (np==11) npw=12; else if (np==85) npw=86; else if (np==39) npw=40; else if (np==87) npw=88; else if (np==89) npw=90; else if (np==99) npw=100; else if (np==27) npw=28; else if (np==143) npw=144; else if (np==85) npw=86; else if (np==141) npw=142; else if (np==309) npw=310; else if (np==501) npw=502; else if (np==137) npw=138; else if (np==341) npw=342; else if (np==615) npw=616; else npw=np; //-------------------------------создаём НЕДВИЖИМОСТЬ----------------------------------- if (np==3441) { if (Math.Rand(6,11)>5) {ChangeJunc("ff32", 0); ChangeJunc("ff31", 2);} else {ChangeJunc("ff32", 2); ChangeJunc("ff31", 0);} // Геническ sostav=new KUID[0]; for (is=0; is6) {sostav=new KUID[0]; traint3=World.CreateTrain(er2DCC,"SGG2C",true); // электричка в Геническе traint3.GetVehicles()[6].Reverse(); traint3.GetVehicles()[7].Reverse();} sostav=new KUID[0]; for (is=0; is5) for (is; is5 and tt<10) mark="STFF8"; else mark="SFF1C"; Interface.Print ("mark man="+mark); if (tt<10) sostav[0]=GetAsset().LookupKUIDTable(0); else sostav[is]=GetAsset().LookupKUIDTable(0); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train3=loko0.GetMyTrain();} train3.SetTrainPriorityNumber(3); Interface.Print ("man OK"); dcl[2].SetLocation(train3.GetFrontmostLocomotive()); man=true; if (mark=="STFF8") { PostMessage(Router.GetGameObject("m2ff"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m24ff"), "CTRL", "ShuntMode.true", 4); } else if (mark=="SFF11") { PostMessage(Router.GetGameObject("m32ff"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m18ff"), "CTRL", "ShuntMode.true", 4); } else { PostMessage(Router.GetGameObject("zz4"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m8ff"), "CTRL", "ShuntMode.true", 4); } Sleep(10); train3.SetAutopilotMode(2); } } else if (ii==9) { if (Math.Rand(0,10)>5) mark="STKK3"; else mark="STKK4"; sostav=new KUID[0]; for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); // пересадили машиниста ChangeJunc("y27", 0); ChangeJunc("y63", 0); ChangeJunc("y521", 0); ChangeJunc("y517", 0); PostMessage(Router.GetGameObject("m62y"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("n72y"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m16y"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m120y"), "CTRL", "ShuntMode.true", 3); // Открываем маневровые светофоры junin="y527"; text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(30); ChangeJunc("y63", 2); ChangeJunc("y521", 2); ChangeJunc("y517", 2); ChangeJunc("y527", 2); ChangeJunc("y531", 0); PostMessage(Router.GetGameObject("m108y"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m118y"), "CTRL", "ShuntMode.true", 3); text=strTable.GetString("w21"); var=18; Window(); dsp="s1"; DSP3Thread(); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); // прицепка while (!Mytrain.IsStopped()) Sleep (5); Interface.Print ("Sleep 300"); Sleep(300); Mytrain.SetTrainPriorityNumber(2); ChangeJunc("y123", 2); ChangeJunc("y119", 0); pu=28; PostMessage(Router.GetGameObject("n74y"), "CTRL", "MayOpen^true", 20); PostMessage(Router.GetGameObject("n28y"), "CTRL", "MayOpen^true", 21); Sleep(50); ChangeJunc("tt20",2); ChangeJunc("tt24",0); PostMessage(Router.GetGameObject("natt"), "CTRL", "MayOpen^true",300); } } else if (ii==16) { if (Math.Rand(0,10)>5) {sostav=new KUID[0]; for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.SetTrainPriorityNumber(2); Mytrain.Turnaround(); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); World.Play2DSound(SCN_dir,Math.Rand(81,87)+".wav"); Sleep(60); World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"a"+Math.Rand(0,4)+".wav"); Interface.Print ("Sleep 100"); Sleep(100); puout=pu; prvs=2; pr=2; JunThread(); PostMessage(Router.GetGameObject(pu+"ss"),"CTRL","MayOpen^true",5); Sleep(30); PostMessage(null, "Train", "col", 10); // сигнальные лампы } else if (np==68) { sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(198); for (is=1; is<16; ++is) sostav[is]=GetAsset().LookupKUIDTable(168); CreateTrain("SSS10C"); wait() {on "CreateTrain", "ok", msg: break;} train0=loko0.GetMyTrain(); train0.SetHandBrake(true); ChangeJunc("ss1", 2); Mytrain.SetTrainPriorityNumber(3); br.SetWindowVisible(false); Sleep(30); dsp="s2"; DSP3Thread(); junin="ss1"; PostMessage(Router.GetGameObject("mdss"), "CTRL", "ShuntMode.true", 1); text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); Sleep(15); while (!Mytrain.IsStopped()) Sleep (5); Sleep (5); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); ChangeJunc("ss1", 0); ChangeJunc("ss25", 0); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); ChangeJunc("ss47", 0); ChangeJunc("ss41", 0); PostMessage(Router.GetGameObject("m1ss"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m31ss"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m15ss"), "CTRL", "ShuntMode.true", 2); text=strTable.GetString("w20"); var=18; Window(); Sleep(5); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); SendMessage(null,"Train","col"); // сигнальные лампы Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); traint.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); pr=1; Mytrain.SetTrainPriorityNumber(pr); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(2); } else if (np==3445) { sostav=new KUID[0]; for (is=0; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(208,212)); markp="SSS"+Math.Rand(1,8)*2+"C"; if (markp=="SSS10C") markp="SSS12C"; CreateTrain(markp); wait() {on "CreateTrain", "ok", msg: traint5=loko0.GetMyTrain();} traint5.SetHandBrake(true); traint5.EnablePhysics(false); ChangeJunc("ss1", 2); Mytrain.SetTrainPriorityNumber(3); br.SetWindowVisible(false); Sleep(30); dsp="s2"; DSP3Thread(); junin="ss1"; PostMessage(Router.GetGameObject("mdss"), "CTRL", "ShuntMode.true", 1); text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); Sleep(15); while (!Mytrain.IsStopped()) Sleep (5); Sleep (5); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); ChangeJunc("ss1", 0); ChangeJunc("ss25", 0); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); ChangeJunc("ss47", 0); ChangeJunc("ss41", 0); PostMessage(Router.GetGameObject("m1ss"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m31ss"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m15ss"), "CTRL", "ShuntMode.true", 2); SendMessage(null,"Train","col"); // сигнальные лампы junin="ss41"; text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); Sleep(15); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); pr=1; Mytrain.SetTrainPriorityNumber(pr); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(20); World.Play2DSound(SCN_dir,Math.Rand(81,87)+".wav"); Sleep(60); Interface.Print ("Sleep 100"); Sleep(100); puout=pu; prvs=2; pr=2; JunThread(); PostMessage(Router.GetGameObject(pu+"ss"),"CTRL","MayOpen^true",5); Sleep(10); SendMessage(null,"Train","col"); } else if (np==668) { // сначала ставим 88-й sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(238); sostav[1]=GetAsset().LookupKUIDTable(239); for (is=2; is<13; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(201,205)); CreateTrain("SSS6"); wait() {on "CreateTrain", "ok", msg: train3=loko0.GetMyTrain();} train3.SetTrainPriorityNumber(1); ProductThread(train3,2,true); Sleep(2); side=false; DoorsThread(train3,1,true); Sleep(2); dcl[2].SetLocation(train3.GetFrontmostLocomotive()); Sleep(1); train3.SetPantographState(2); train3.GetVehicles()[1].Reverse(); sostav=new KUID[0]; if (tt<234) sostav[0]=GetAsset().LookupKUIDTable(tt), lk=0; else {sostav[0]=GetAsset().LookupKUIDTable(tt); sostav[1]=GetAsset().LookupKUIDTable(tt+1), lk=1;} // наш будущий локомотив traint1=World.CreateTrain(sostav,"ssd2",false); traint1.SetTrainPriorityNumber(1); traint1.SetPantographState(1); if (lk==1) traint1.GetVehicles()[1].Reverse(); // теперь ставим 17-й sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(236); sostav[1]=GetAsset().LookupKUIDTable(237); for (is=2; is<18; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(201,205)); CreateTrain("Tss"); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.SetTrainPriorityNumber(1); vstr=true; ProductThread(train1,2,true); Sleep(2); dcl[3].SetLocation(train1.GetFrontmostLocomotive()); train1.SetPantographState(1); train1.GetVehicles()[1].Reverse(); sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(246); sostav[1]=GetAsset().LookupKUIDTable(247); for (is=2; is<9; ++is) sostav[is]=GetAsset().LookupKUIDTable(217); for (is=9; is<15; ++is) sostav[is]=GetAsset().LookupKUIDTable(218); CreateTrain("SSS10"); wait() {on "CreateTrain", "ok", msg: train2=loko0.GetMyTrain();} // 100-й side=false; DoorsThread(train2,1,true); Sleep(2); dcl[1].SetLocation(train2.GetFrontmostLocomotive()); train2.SetPantographState(1); train2.GetVehicles()[1].Reverse(); puin=1; JunThread(); PostMessage(Router.GetGameObject("nss"), "CTRL", "MayOpen^true",6); traint5=World.CreateTrain(er2DCC,"SSS15C",false); traint5.GetVehicles()[6].Reverse(); traint5.GetVehicles()[7].Reverse(); traint5.EnablePhysics(false); train1Schedule = new Schedule(); // команды 17-му train1Schedule.StopAtTrigger("Tss1",360); train1Schedule.StopAtTrigger("Tss1b",180); train1Schedule.ReverseTrain(); train1Schedule.StopAtTrigger("Tss2",80); train1Schedule.ReverseTrain(); train1Schedule.StopAtTrigger("Tss0",300); train1.RunSchedule(train1Schedule,false,1); PostMessage(null, "Train", "col", 40); // сигнальные лампы text=strTable.GetString("w26"); var=18; Window(); World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"17_1.wav"); junin="ss37"; Interface.Print ("wait train1 on Junction "+junin); OnJunction(train1,junin,4); Interface.Print ("train1 on Junction "+junin+" OK"); dsp="s7"; DSP3Thread(); while (!train1.IsStopped()) Sleep (5); World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"17_2.wav"); Sleep(7); one1=train1.GetVehicles()[14]; two1=train1.GetVehicles()[15]; // отцепка one1.Uncouple(two1); train1=one1.GetMyTrain(); trainout=two1.GetMyTrain(); trainout.SetHandBrake(true); one=train1.GetVehicles()[1]; two=train1.GetVehicles()[2]; train1.SetTrainPriorityNumber(3); one.Uncouple(two); train1=one.GetMyTrain(); train0=two.GetMyTrain(); train0.SetHandBrake(true); trainout.SetCouplingMask(Vehicle.COUPLE_BOTH); ChangeJunc("ss34", 2); PostMessage(Router.GetGameObject("n1ss"), "CTRL", "ShuntMode.true", 100); puout=5; puin=0; JunThread(); PostMessage(Router.GetGameObject("5ss"), "CTRL", "MayOpen^true",6); Sleep(60); ChangeJunc("ss37", 2); PostMessage(Router.GetGameObject("2ss"), "CTRL", "ShuntMode.true", 2); SendMessage(null,"Train","col"); junin="ss37"; text=strTable.GetString("w18")+junin; var=18; Window(); Sleep(12); dsp="s8"; DSP3Thread(); Sleep(15); World.Play2DSound(SCN_dir,Math.Rand(81,87)+".wav"); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); Sleep(40); ChangeJunc("ss37", 0); PostMessage(Router.GetGameObject("m41ss"), "CTRL", "ShuntMode.true", 2); while (!Mytrain.IsStopped()) Sleep (5); Sleep(5); Mytrain.Turnaround(); text=strTable.GetString("w20"); var=18; Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); SendMessage(null,"Train","col"); TrainUtil.DoCoupleUp(Mytrain,trainout); br.SetWindowVisible(false); // прицепка text=strTable.GetString("w26"); var=18; Window(); while (!Mytrain.IsStopped()) Sleep (5); Sleep(5); Mytrain.Turnaround(); time=World.GetGameTime(); fTime=0.04375; Interface.Print ("wait time 13:03"); while(time"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); ChangeJunc("ss1", 0); ChangeJunc("ss25", 0); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); ChangeJunc("ss47", 0); ChangeJunc("ss41", 0); PostMessage(Router.GetGameObject("m1ss"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m31ss"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m15ss"), "CTRL", "ShuntMode.true", 2); SendMessage(null,"Train","col"); text=strTable.GetString("w20"); var=18; Window(); Sleep(5); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,trainout); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); pr=1; Mytrain.SetTrainPriorityNumber(pr); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(2); veh0=train3.GetVehicles(); for (is=0; is5) {sostav=new KUID[0]; for (is=0; is3 and nap==true) or (pu==2 and nap==false))) side=true; else if (ii==14) side=true; else if (ii==16 and (pu==4 or pu==6 or pu==8)) side=true; else side=false; Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep(2); if (np<6000) {DoorsThread(Mytrain,lk+1,true); Sleep(1); } if (ii==7){ // Джанкой World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); // объявления по вокзалу if (np==18) World.Play2DSound(SCN_dir,"18_2.wav"); else if (np==8) World.Play2DSound(SCN_dir,"08_2.wav"); else if (np==17) World.Play2DSound(SCN_dir,"17_2.wav"); else if (np==98) World.Play2DSound(SCN_dir,"98.wav"); else if (np<400) World.Play2DSound(SCN_dir,"a"+Math.Rand(0,4)+".wav"); else if (np>6000) World.Play2DSound(SCN_prs,"md0.wav"); if (np>6000 or np==341 or np==90 or np==28 or np==89 or np==2 or np==98) { // новый фоновый грузовой на длинных стоянках if (train1) {veh0=train1.GetVehicles(); for (is=0; is5) mark="SYA"; else mark="SYG46"; CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} if (mark=="SYA") { PostMessage(Router.GetGameObject("nay"), "CTRL", "MayOpen^true", 6); PostMessage(Router.GetGameObject("y12n"), "CTRL", "MayOpen^true", 5); PostMessage(Router.GetGameObject("n12ay"), "CTRL", "MayOpen^true", 4); PostMessage(Router.GetGameObject("n12y"), "CTRL", "MayOpen^true", 3); PostMessage(Router.GetGameObject("g2y"), "CTRL", "MayOpen^true", 2); } else { PostMessage(Router.GetGameObject("c35y"), "CTRL", "MayOpen^true", 6); PostMessage(Router.GetGameObject("c12y"), "CTRL", "MayOpen^true", 5); PostMessage(Router.GetGameObject("c12ay"), "CTRL", "MayOpen^true", 4); PostMessage(Router.GetGameObject("12yc"), "CTRL", "MayOpen^true", 3); } train1.GetVehicles()[1].Reverse(); dcl[1].SetLocation(train1.GetFrontmostLocomotive()); vstr=true; Interface.Print ("train1 reposited"); train1.SoundHorn(); Sleep(2); train1.SetAutopilotMode(2); } if (np==615) { // отправляем 310-й Interface.Print ("wait time 18.48"); ChangeJunc("y136", 0); ChangeJunc("y114", 0); while(time<0.283) {time=World.GetGameTime(); Sleep(0.1);} train0.Turnaround(); Sleep(1); loko2=train0.GetVehicles()[0]; train3=loko2.GetMyTrain(); train3.SetTrainPriorityNumber(1); Sleep(1); dcl[1].SetLocation(train3.GetFrontmostLocomotive()); PostMessage(Router.GetGameObject("2y"), "CTRL", "MayOpen^true", 10); PostMessage(Router.GetGameObject("c05y"), "CTRL", "MayOpen^true", 8); PostMessage(Router.GetGameObject("c5y"), "CTRL", "MayOpen^true", 6); Sleep(35); World.Play2DSound(SCN_prs,"t1.wav"); Sleep(3); World.Play2DSound(SCN_prs,"2d2.wav"); Sleep(3); train3.SoundHorn(); Sleep(2); train3.SetAutopilotMode(2); } else if (np==27 or np==89) { puin=4; JunThread(); Sleep(5); SignalIn(); PostMessage(Router.GetGameObject("1yc"), "CTRL", "MayOpen^true", 15); SignalOut(); Interface.Print ("wait poput on junction y144"); OnJunction(train3,"y144",0); Interface.Print ("junction y144 OK"); World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"141.wav"); one=Mytrain.GetVehicles()[14]; two=Mytrain.GetVehicles()[15]; one.Uncouple(two); Mytrain=one.GetMyTrain(); train2=two.GetMyTrain(); train2.SetHandBrake(true); vstr2=true; } else if (np==28 or np==90) { // прицепка к 28-му или 90-му ChangeJunc("y23", 2); Sleep(20); br.SetWindowVisible(false); PostMessage(Router.GetGameObject("n16y"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m56y"), "CTRL", "ShuntMode.true", 6); one1=Mytrain.GetVehicles()[1]; two1=Mytrain.GetVehicles()[2]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); text=strTable.GetString("w24"); var=18; Window(); Schedule Train1Schedule = new Schedule(); // задаём команды маневровому локу Train1Schedule.StopAtTrigger("TY31",20); Train1Schedule.ReverseTrain(); Train1Schedule.StopTrain(10); Train1Schedule.CoupleVehicle(two1); Train1Schedule.StopAtTrigger("TY2C",100); Train1Schedule.StopAtTrigger("TY1",20); train3.RunSchedule(Train1Schedule,false,10); Interface.Print ("1 wait Junction y23"); OnJunction(train3,"y23",4); Interface.Print ("Junction y23 OK"); Sleep(10); br.SetWindowVisible(false); ChangeJunc("y23", 0); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); PostMessage(Router.GetGameObject("m24y"), "CTRL", "ShuntMode.true", 1); Interface.Print ("2 wait Junction y23"); OnJunction(train3,"y23",4); Interface.Print ("Junction y23 OK"); Sleep(10); while (!train3.IsStopped()) Sleep(60); train3.Turnaround(); one2=train3.GetVehicles()[0]; two2=train3.GetVehicles()[1]; one2.Uncouple(two2); train3=one2.GetMyTrain(); train0=two2.GetMyTrain(); traint3.SetHandBrake(true); Sleep(100); text=strTable.GetString("w6"); var=18; Window(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); } else if (np==88) { ChangeJunc("y2", 2); ChangeJunc("y126", 2); ChangeJunc("y136", 2); ChangeJunc("y138", 0); ChangeJunc("y124", 0); Sleep(120); PostMessage(Router.GetGameObject("n18y"), "CTRL", "MayOpen^true", 1); PostMessage(Router.GetGameObject("2yc"), "CTRL", "MayOpen^true", 0); train2.SoundHorn(); train2.SetAutopilotMode(2); Interface.Print ("wait vstr on Junction y2"); OnJunction(train2,"y2",4); Interface.Print ("Junction y2 OK"); } else if (np==6618) {ChangeJunc("y126", 0); PostMessage(Router.GetGameObject("ny"), "CTRL", "MayOpen^true", 1); PostMessage(Router.GetGameObject("0y"), "CTRL", "MayOpen^true", 1);} } Interface.Print ("wait time="+iHours+"."+iMins); if (iHours==12 and iMins==0) iHours=11, iMins=59, iSecs=50; // обходим проблему перехода через 0 --iMins, iSecs=20; // устанавливаем зазор 40 сек для открытия светофора time=World.GetGameTime (); // сравниваем время if (iHours < 12) fTime = 0.5 + (iHours / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); else fTime = ((iHours - 12) / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); if (time<(fTime-0.5)) fTime=fTime+0.5; if (np==18 and ii==7) {while(time<(fTime-0.0013)) {time=World.GetGameTime(); Sleep(0.1);} World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"18_4.wav"); } if (np==68 and ii==16) while(time>0.9) {time=World.GetGameTime(); Sleep(0.5);} else while(time2 and ii!=7 and ii!=9 and ii!=15) {veh0=train3.GetVehicles(); for (is=0; is6600 or ii==16 or ii==7) okno=true; else okno=false; // задали станции, на которых будут остановки if (((np==6704 or np==6619 or np==6628 or np==6631) and ii==3) or pr==2) okno=false; else if (np==6603 and (ii==8 or ii==10 or ii==11 or ii==13 or ii==15)) okno=false; else if (np==6604 and ii==15) okno=false; // задали станции, на которых не будет остановок // задаём станции, на которых мы становимся под обгон if (ii==4 and (np==6622 or np==6611 or np==6618 or np==6623 or np==6626 or np==6704)) poput=true; else if (ii==8 and np==6611) poput=true, poput2=true; else if (ii==9 and (np==6612 or np==6628 or np==6621 or np==6626)) poput=true; else if (ii==9 and np==6615) poput=true, poput2=true; else if (ii==12 and (np==6612 or np==6622 or np==6630 or np==310)) poput=true; else if (ii==7 and (np==27 or np==89 or np==86)) poput=true; else if (ii==7 and np==310) poput=true, poput2=true; else if (ii==15 and np==3448) poput=true; else if (np==6628 and ii==4) poput=true, poput2=true; else if (nap==true and pr==2 and (ii==5 or ii==6 or ii==9 or ii==12) and Math.Rand(0,10)>6) poput=true; else if (nap==false and pr==2 and ii<15 and ii>7 and ii!=12 and Math.Rand(0,10)>7) poput=true; Sleep(5); if (np==3445) poput=false; // задаём путь прибытия if (ii==2 and np==6628) pu=3; else if ((ii==3 or ii==4) and np>6610 and nap==true and okno==true) pu=3; else if (ii==2 and nap==false and okno==true) pu=4; else if ((ii==3 or ii==4) and np>6610 and nap==false and okno==true) pu=4; else if (ii==7 and (np==6703 or (nap==true and pr==2))) pu=1; else if (ii==7 and np==6630) pu=17; else if (ii==7 and (np==12 or np==100 or np==142)) pu=2; else if (ii==7 and (np==97 or np==616 or np==18 or np==8 or np==141 or np==3448)) pu=5; else if (ii==7 and np>6600) pu=18; else if (ii==7 and (np==47 or np==17)) pu=4; else if (ii==7 and nap==true) pu=2; else if (ii==7 and np==310) pu=0; else if (ii==7) pu=4; else if (np==53 and ii==16) pu=3; else if (ii==15 and pr==2) pu=6; else if (ii==13 and np==3445) pu=6; else if (ii==14 and nap==true and (np==3445 or np==3447)) pu=3; else if (ii==14 and np>6632) pu=3; else if (ii==16 and (np==7 or np==11 or np==17 or np==67 or np==81 or np==141 or np==143 or np==309 or np==341)) pu=5; else if (np==615 and ii==16) pu=8; else if (ii==16 and pr==1 and np>6000) pu=9; else if (ii==16 and pr==1) pu=7; else if (ii!=7 and poput==true) {if (nap==true) pu=3; else pu=4;} else if (nap==true) pu=1; else pu=2; if ((np==3441 and ii==15) or (ii==14 and np>6633)) Sleep(1); else if (nap==true and ii==7 and pu>15) Sleep(1); // не собираем входной маршрут иногда else puin=pu; // собираем входной маршрут обычно Interface.Print ("ii="+ii+", okno="+okno+", pu="+pu+", puin="+puin); if (ii!=7 and ii!=im and poput==false) { // открываем выходные светофоры на следующей станции puout=pu; JunThread(); if (nap==true) PostMessage(Router.GetGameObject("n"+pu+junw[ii]), "CTRL", "MayOpen^true", 7); else PostMessage(Router.GetGameObject("c"+pu+junw[ii]), "CTRL", "MayOpen^true", 7); } else if (ii==7 and np==310) { ChangeJunc("y141", 0); ChangeJunc("y2", 0); ChangeJunc("y126", 2); ChangeJunc("y124", 2); Sleep(2); } else if (puin==pu) JunThread(); // открываем входные светофоры на следующей станции if (ii==14) {PostMessage(Router.GetGameObject("n0tt"), "CTRL", "MayOpen^true", 35); PostMessage(Router.GetGameObject("c20tt"), "CTRL", "MayOpen^true", 33);} if (puin!=pu) Sleep(1); else if (nap==true) PostMessage(Router.GetGameObject("n"+junw[ii]), "CTRL", "MayOpen^true", 30); else PostMessage(Router.GetGameObject("c"+junw[ii]), "CTRL", "MayOpen^true", 30); if (ii==7) Sleep(7), SignalIn(); // входной и маршрутные Джанкоя if (ii==2 and (np==68 or np==6628 or np==6616)) Sleep(1); else if (vstr==false) { // запускаем встречныe if (nap==true) mark=marw[ii]; else mark=marwch[ii]; // электричка if ((np==11 and (ii==4 or ii==7 or ii==12)) or ((np==97 or np==6623 or np==6626) and ii==5) or (np==6678 and ii==16) or ((np==309 or np==668) and ii==15) or (np==6630 and ii==12) or ((np==6612 or np==6622) and ii==11) or (np==6622 and (ii==4 or ii==13)) or (np==6630 and ii==12) or ((np==146 or np==310) and ii==9) or (np==6615 and (ii==11 or ii==14)) or (np==6619 and (ii==9 or ii==12)) or ((np==342 or np==6625) and ii==6) or (np==6623 and ii==10) or (np==6631 and ii==13) or (np==6628 and ii==7) or ((np==6626 or np==6625 or np==6628) and ii==14) or ((np==143 or np==144) and ii==12) or ((np==48 or np==89 or np==90) and ii==15) or (np==6617 and (ii==13 or ii==11)) or (np==6618 and (ii==13 or ii==11 or ii==5)) or (np==27 and (ii==7 or ii==8 or ii==13)) or (np==87 and (ii==7 or ii==4 or ii==13)) or (np==99 and (ii==3 or ii==5 or ii==9)) or (np==341 and (ii==15 or ii==5)) or (np==40 and (ii==11 or ii==4)) or (np==81 and (ii==11 or ii==14)) or (np==67 and (ii==8 or ii==10)) or (np==68 and (ii==12 or ii==5)) or (np==18 and ii==7) or (np==100 and ii==15) or ((np==17 or np==47) and ii==13) or (np==53 and (ii==6 or ii==14)) or (np==28 and ii==10) or (np==54 and ii==9) or (np==12 and (ii==8 or ii==2)) or (np==6616 and (ii==10 or ii==9 or ii==8 or ii==3)) or (np==6611 and (ii==4 or ii==6 or ii==8 or ii==14)) or (np==85 and (ii==4 or ii==7 or ii==11)) or ((np==68 or np==98) and (ii==8 or ii==3)) or (np==615 and (ii==9 or ii==11)) or (np==137 and ii==13) or (np==138 and (ii==4 or ii==11)) or (pr==2 and Math.Rand(0,10)>6)) { train1=World.CreateTrain(er2DCC,mark,true); train1.GetVehicles()[6].Reverse(); train1.GetVehicles()[7].Reverse(); ProductThread(train1,0,true); Sleep(5); } // поезд 67/68 else if ((np==12 and ii==3) or (np==17 and ii==14) or (np==18 and ii==12) or (np==6611 and ii==16) or (np==6612 and ii==7) or (np==6621 and ii==13) or (np==6628 and ii==10) or (np==28 and ii==15) or (np==53 and ii==7) or (np==6623 and ii==6) or ((np==54 or np==146) and ii==13)) { sostav=new KUID[0]; is=Math.Rand(117,124)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(168); sostav[is]=GetAsset().LookupKUIDTable(198); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.GetVehicles()[1].Reverse(); veh0=train1.GetVehicles(); for (is=2; is5) train1.GetVehicles()[is].Reverse(); } // поезд 141/142, 7/8, 53/54 else if ((np==68 and ii==6) or (np==67 and ii==13) or ((np==615 or np==6620 or np==6623) and ii==14) or (np==6618 and ii==7) or (np==39 and ii==5) or (np==144 and ii==4) or (np==501 and ii==6) or (np==616 and ii==11) or (np==86 and ii==8) or (np==100 and ii==9) or ((np==88 or np==6604) and ii==10)){ sostav=new KUID[0]; is=Math.Rand(222,233); sostav[0]=GetAsset().LookupKUIDTable(is); for (is=1; is<10; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(169,171)); for (is=10; is<17; ++is) sostav[is]=GetAsset().LookupKUIDTable(170); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} veh0=train1.GetVehicles(); for (is=2; is5) train1.GetVehicles()[is].Reverse(); } // поезд 99/100 else if (((np==53 or np==6620) and ii==9) or (np==6623 and ii==7)) { sostav=new KUID[0]; is=Math.Rand(117,124)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<12; ++is) sostav[is]=GetAsset().LookupKUIDTable(217); sostav[12]=GetAsset().LookupKUIDTable(185); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.GetVehicles()[1].Reverse(); veh0=train1.GetVehicles(); for (is=2; is5) train1.GetVehicles()[is].Reverse(); } // поезд 39/40 else if ((np==7 and ii==5) or (np==97 and ii==3) or (np==53 and ii==16) or (np==6623 and ii==10)) { sostav=new KUID[0]; is=Math.Rand(117,124)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<13; ++is) sostav[is]=GetAsset().LookupKUIDTable(184); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.GetVehicles()[1].Reverse(); veh0=train1.GetVehicles(); for (is=2; is5) train1.GetVehicles()[is].Reverse(); } // прочие скорые и пассажирские else if (((np==7 and (ii==11 or (ii>3 and ii<8)))) or (np==615 and (ii==8 or ii==15)) or (np==6618 and (ii==6 or ii==5)) or (np==6622 and (ii==14 or ii==15 or ii==12 or ii==11)) or (np==6612 and ii==8) or (np==6625 and (ii==3 or (ii>8 and ii<13))) or ((np==146 or np==6618) and ii==15) or (np==342 and ii==7) or (np==6616 and (ii==14 or ii==13 or ii==12 or ii==11 or ii<7)) or (np==6631 and ii!=5 and ii!=7) or (np==6626 and ii==5) or (np==616 and ii==10) or (np==6628 and ii==11) or ((np==48 or np==6626) and ii==5) or (np==6620 and ii<14 and ii!=9) or ((np==68 or np==142 or np==6618 or np==6621) and ii==14) or (np==67 and (ii==3 or ii==12 or ii==14)) or (np==141 and (ii==4 or ii==12 or ii==8)) or (np==53 and (ii==9 or ii==10)) or (np==40 and (ii==15 or ii==2)) or (np==18 and ii==13) or (np==54 and ii==14) or (np==90 and ii==6) or (np==667 and ii==16) or (pr==2 and Math.Rand(0,10)>7)) { sostav=new KUID[0]; is=Math.Rand(117,124)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<18; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(203,213)); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.GetVehicles()[1].Reverse(); veh0=train1.GetVehicles(); for (is=2; is5) train1.GetVehicles()[is].Reverse(); } else { // грузовые if (nap==true and ii==2) mark=marw[ii+1]; sos=0; sostavsize=Math.Rand(55,61); tt=Math.Rand(1,10); sostav=new KUID[0]; if (Math.Rand(0,10)>4) is=Math.Rand(95,98)*2, sostav[0]=GetAsset().LookupKUIDTable(is), sostav[1]=GetAsset().LookupKUIDTable(is-1); else sostav[0]=GetAsset().LookupKUIDTable(166), sostav[1]=GetAsset().LookupKUIDTable(167); for (is=2; is7) speed=80; else if (((np==341 or np==342) and ii<7) or (ii>7 and np>6600)) speed=70; else if (np==6603 or np==341 or np==342 or np==6703 or (np==616 and ii<15) or (np==6611 and ii<8)) speed=70; else if (np>6600) speed=65; // выводим сообщение о скорости if (pr==1) {text=strTable.GetString("w1")+npw+","+strTable.GetString("w4")+speed+strTable.GetString("w2"); var=4; Window();} if (np==668 and ii==15) {World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,"8ev.wav");} if (np==3448 and ii==15) junout="ss15"; else if (np==3448 and ii==14) junout="rr6"; else if (np==3448 and ii==13) junout="tt8"; else if (nap==true and ii==8) junout="y119"; else if (nap==true) junout=junw[ii-1]+"3"; else if (nap==false and ii<7) junout=junw[ii+1]+"2"; else junout=junw[ii+1]+"4"; if (np==6703) {Interface.Print ("wait navigate junction "+ junout); OnJunction(Mytrain,junout,4); Interface.Print ("junction "+junout+" OK"); ChangeJunc(junout, 2);} if (poput==true) {if (nap==true) markp=marwch[ii-1]; else markp=marw[ii+1]; PoputTrain();} // ставим попутный if (ii==7 and np==310) { Interface.Print ("wait navigate train1 junction y113"); OnJunction(train1,"y113",4); Interface.Print ("junction y113 OK"); ChangeJunc("y111", 0); Sleep(2); SignalIn(); } else { // задаём имя триггера if (ii==1 and nap==false) trig="TFFNCH"; else if (nap==true) trig=ii; else if (nap==false) trig=ii+"*"; Interface.Print ("wait navigate trigger "+trig); OnTrigger(Mytrain,trig,0); Interface.Print ("trigger "+trig+" OK"); // и проезжаем его } if (nap==false and ii==7) Sleep(40); // если нет обгона, собираем выходной маршрут if (ii==7 and pr==2) {puout=pu; JunThread(); Sleep(7); SignalOut();} else if (im==14 and ii==14) { puin=pu, puout=3; JunThread(); Sleep(7); lg="c"+pu+"tt"; PostMessage(Router.GetGameObject(lg), "CTRL", "MayOpen^true", 2); PostMessage(Router.GetGameObject("ctt"), "CTRL", "MayOpen^true", 3); PostMessage(Router.GetGameObject("c30tt"), "CTRL", "MayOpen^true", 1); //SetNextSignals(Mytrain, 6, 5); } else if (puin!=pu) { // обработка исключительных ситуций с прибытием на боковые пути после ухода встречных puin=pu; JunThread(); Sleep(2); PostMessage(Router.GetGameObject("n"+junw[ii]), "CTRL", "MayOpen^true", 1); } if (nap==true) glav=1; else glav=2; DSP2Thread(); Sleep(10); // сообщения дежурного на приём del=true; DelThread(); while (del==true) Sleep(1); // удаляем старые вагоны в тупиках // тупики и отстой заново if (ii==2 and ii!=im) { sostav=new KUID[0]; for (is=0; is5) { sostav=new KUID[0]; for (is=0; is5) mark="STCC1"; else mark="STCC2"; sostav=new KUID[0]; for (is=0; is6) { it=Math.Rand(4,7); sostav=new KUID[0]; for (is=0; is6) { it=Math.Rand(7,9); sostav=new KUID[0]; for (is=0; is7) { sostav=new KUID[0]; for (is=0; is5) mark="STKK3"; else mark="STKK4"; sostav=new KUID[0]; for (is=0; is5 and np!=6620 and poput==false) { // маневровый состав в Урожайной if (Math.Rand(0,10)>5 and poput==false) mark="STKK6"; else mark="STKK5"; sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(0); for (is=1; is5) mark="SNN9"; else mark="SNN10"; if (Math.Rand(0,10)>5) mark=mark+"C"; sostav=new KUID[0]; for (is=0; is5) { sostav=new KUID[0]; for (is=0; is5) {for (is=0; is6) { // как бы электричка на Евпаторию train2=World.CreateTrain(er2DCC,"STT6C",true); train2.GetVehicles()[6].Reverse(); train2.GetVehicles()[7].Reverse(); dcl[2].SetLocation(train2.GetFrontmostLocomotive()); train2.SetTrainPriorityNumber(1); train2.SetPantographState(1); ProductThread(train2,0,true); Sleep(2); train2Schedule = new Schedule(); train2Schedule.DriveForever(); train2.RunSchedule(train2Schedule,false,Math.Rand(80,180)); vstr2=true; PostMessage(Router.GetGameObject("c3tt"),"CTRL","MayOpen^true",5); PostMessage(Router.GetGameObject("c30tt"),"CTRL","MayOpen^true",4); Interface.Print ("elektrichka on "+mark+" OK"); } } else if (ii==15) { if (pr==1) {it=Math.Rand(5,7); sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(166); sostav[1]=GetAsset().LookupKUIDTable(167); for (is=2; is6) { sostav=new KUID[0]; tt=Math.Rand(0,10); if (tt<5) {mark="srt1"; PostMessage(Router.GetGameObject("m7rr"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m25rr"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("n4rr"), "CTRL", "ShuntMode.true", 1);} else {mark="srt2"; PostMessage(Router.GetGameObject("prr"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("grr"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m16rr"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m24rr"), "CTRL", "ShuntMode.true", 4); PostMessage(Router.GetGameObject("c4rr"), "CTRL", "ShuntMode.true", 5);} Interface.Print ("mark man="+mark); sostav[0]=GetAsset().LookupKUIDTable(0); tt=Math.Rand(0,10); if (tt<5) for (is=1; is5) {sostav=new KUID[0]; for (is=0; is5) sostav[0]=GetAsset().LookupKUIDTable(1), traint=World.CreateTrain(sostav,"SSS4",true); else sostav[0]=GetAsset().LookupKUIDTable(179), traint=World.CreateTrain(sostav,"sst3",true); } Sleep (0.1); traint.SetHandBrake(true); if (Math.Rand(0,10)>5) {sostav=new KUID[0]; for (is=0; is6600 and ii==7){ // принимаем нечётные электрички в Джанкое if (np==6703) junin="y142"; else junin="y54"; Interface.Print ("wait navigate junction "+ junin); OnJunction(Mytrain,junin,4); Interface.Print ("junction "+junin+" OK"); } else if (np==3448 and ii==15) { // прицепка грузового в Симферополе-грузовом Interface.Print ("wait Junction rr11"); OnJunction(Mytrain,"rr11",4); Interface.Print ("Junction rr11 OK"); Sleep (10); dsp="s7"; DSP3Thread(); puin=2, puout=2; JunThread(); Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep (5); veh0=train1.GetVehicles(); for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} PostMessage(Router.GetGameObject("25rr"), "CTRL", "ShuntMode.true", 15); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); ChangeJunc("rr8", 2); ChangeJunc("rr12", 2); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); text=strTable.GetString("w20"); var=18; Window(); dsp="s2"; DSP3Thread(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(30); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.SetTrainPriorityNumber(2); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(150); pu=4; puout=4; JunThread(); PostMessage(Router.GetGameObject("c4rr"), "CTRL", "MayOpen^true", 15); Sleep(30); st=15; } else if (np==3445 and ii==13) { // прицепка в Пролётной Interface.Print ("wait Junction pp11"); OnJunction(Mytrain,"pp11",4); Interface.Print ("Junction pp11 OK"); Sleep (10); puin=2, puout=2; JunThread(); Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep (5); veh0=train1.GetVehicles(); for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} PostMessage(Router.GetGameObject("m9pp"), "CTRL", "ShuntMode.true", 15); if (itt==6) { ChangeJunc("pp19", 2); ChangeJunc("pp23", 2);} else if (itt==7) { ChangeJunc("pp19", 2); ChangeJunc("pp23", 0);} else ChangeJunc("pp19", 0); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); text=strTable.GetString("w20"); var=18; Window(); ChangeJunc("pp15", 0); dsp="s2"; DSP3Thread(); // сцепка Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(30); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(30); PostMessage(Router.GetGameObject("cgpp"), "CTRL", "ShuntMode.true", 15); text=strTable.GetString("w18")+junin; var=18; Window(); dsp="s9"; DSP3Thread(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(15); ChangeJunc("pp15", 2); PostMessage(Router.GetGameObject("n6pp"), "CTRL", "ShuntMode.true", 15); PostMessage(Router.GetGameObject("m9pp"), "CTRL", "ShuntMode.true", 15); Sleep(15); text=strTable.GetString("w8"); var=18; Window(); junin="pp8"; Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(40); //отцепка one1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); Sleep(10); ChangeJunc("pp8", 0); ChangeJunc("pp4", 0); PostMessage(Router.GetGameObject("c6pp"), "CTRL", "ShuntMode.true", 1); junin="pp4"; text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(3); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); Sleep(30); ChangeJunc("pp4", 2); PostMessage(Router.GetGameObject("m7pp"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("n2pp"), "CTRL", "ShuntMode.true", 2); junin="pp7"; text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); Sleep(10); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Sleep(40); ChangeJunc("pp9", 2); PostMessage(Router.GetGameObject("m4pp"), "CTRL", "ShuntMode.true", 4); text=strTable.GetString("w21"); var=18; Window(); dsp="s2"; DSP3Thread(); dsp="s2"; DSP3Thread(); // сцепка Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(5); Interface.Print ("Sleep 120 "); Sleep(120); puout=6; nap=true; JunThread(); im=14; Mytrain.SetTrainPriorityNumber(1); ChangeJunc("tt20",2); ChangeJunc("tt24",0); PostMessage(Router.GetGameObject("n4pp"), "CTRL", "MayOpen^true", 15); PostMessage(Router.GetGameObject("natt"), "CTRL", "MayOpen^true",30); Sleep (20); DSP1Thread(); } else if (poput==true and ii!=7) { // сборка маршрута попутному if (ii==9 and pu==3) junin="kk6"; else if (ii==9) junin="kk19"; else if (ii==12 and nap==false) junin="nn7"; else if (ii==11 and nap==false) junin="mm13"; else if (ii==5 and nap==true) junin="cc22"; else if (nap==true and ii<7) junin=junw[ii]+"4"; else if (nap==false and ii==13) junin="pp9"; else if (nap==false) junin=junw[ii]+"1"; else junin=junw[ii]+"2"; itt=0; Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); // проехали входную стрелку if (nap==false) puin=2, puout=2; else puin=1, puout=1; Sleep(15); JunThread(); // собрали маршрут попутному if (nap==true) lg="n"+junw[ii], lgw="n1"+junw[ii]; else lg="c"+junw[ii], lgw="c2"+junw[ii]; // открываем светофоры на нашей станции PostMessage(Router.GetGameObject(lg), "CTRL", "MayOpen^true", 10); PostMessage(Router.GetGameObject(lgw), "CTRL", "MayOpen^true", 9); if (nap==true) PostMessage(Router.GetGameObject("n"+junw[ii+1]), "CTRL", "MayOpen^true", 30); // открываем входной на следующей станции else PostMessage(Router.GetGameObject("c"+junw[ii-1]), "CTRL", "MayOpen^true", 30); if (nap==false and ii==14) junout="tt8"; else if (nap==true) junout=junw[ii]+"3"; else if (ii<6) junout=junw[ii]+"2"; else junout=junw[ii]+"4"; itt=1; if (pr==2 and ii<15) { // для грузовых DelPopThread(); // удаляем попутный после прохода им выходной стрелки while (poput==true) Sleep(30); puout=pu; JunThread(); Sleep(80); // собираем себе выходной маршрут if (nap==true) PostMessage(Router.GetGameObject("n3"+junw[ii]), "CTRL", "MayOpen^true", 1); // Открываем выходной светофор else PostMessage(Router.GetGameObject("c4"+junw[ii]), "CTRL", "MayOpen^true", 1); if (ii==14 and np==3448) PostMessage(Router.GetGameObject("c20tt"), "CTRL", "MayOpen^true", 3); } else DelPopThread(); // удаляем попутный для электрички } if (ii==7) SoundThread(); } //конец цикла движения Interface.Print ("cicle ii ended"); if (np==97 or np==616){ // будем менять локомотив if (np==97) trig="y4", side=true; else trig="y85", side=false; Interface.Print ("wait Junction"+trig); OnJunction(Mytrain,trig,4); Interface.Print ("Junction "+trig+" OK"); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); Sleep(4); while (!Mytrain.IsStopped()) Sleep(20); DoorsThread(Mytrain,lk+1,true); Sleep(10); Mytrain.SetTrainPriorityNumber(3); loko1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; loko1.Uncouple(two1); // отцепились Mytrain=two1.GetMyTrain(); trainout=loko1.GetMyTrain(); Mytrain.SetHandBrake(true); Sleep(10); if (np==97) trig="3yc", trigw="m54y", junin="y109", ChangeJunc("y37", 2), ChangeJunc("y97", 2), ChangeJunc("y45", 2), ChangeJunc("y2", 0), ChangeJunc("y122", 2), ChangeJunc("y52", 0), SignalIn(); else trig="3y", trigw="c5y", junin="y58"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject(trigw), "CTRL", "ShuntMode.true", 2); dsp="s3"; DSP3Thread(); text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junstion "+junin); OnJunction(trainout,junin,4); Interface.Print ("Junstion "+junin+" OK"); br.SetWindowVisible(false); while (!trainout.IsStopped()) Sleep(20); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(trainout.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); trainout.Turnaround(); if (np==97) ChangeJunc("y109", 0), ChangeJunc("y45", 2); else ChangeJunc("y58", 2), ChangeJunc("y62", 2), ChangeJunc("y12", 2), ChangeJunc("y14", 2), ChangeJunc("y110", 2); if (np==97) trig="m60y", trigw="m26y"; else trig="m45y", trigw="m55y"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 4); PostMessage(Router.GetGameObject(trigw), "CTRL", "ShuntMode.true", 4); dsp="s5"; DSP3Thread(); dcl[0].SetLocation(train0.GetFrontmostLocomotive()); train0.SetTrainPriorityNumber(3); br.SetWindowVisible(false); World.SetCamera(train0.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в тепловоз trainout.SetAutopilotMode(2); trig="2yc"; junin="y3"; ChangeJunc("y3", 2); PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true",1); text=strTable.GetString("w18")+junin; var=18; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(train0,junin,4); Interface.Print ("Junstion "+junin+" OK"); br.SetWindowVisible(false); while (!train0.IsStopped()) Sleep(15); Sleep(30); World.DeleteTrain(trainout); ChangeJunc("y3", 0); ChangeJunc("y37", 0), ChangeJunc("y97", 2); PostMessage(Router.GetGameObject("m34y"), "CTRL", "ShuntMode.true",1); PostMessage(Router.GetGameObject("m28y"), "CTRL", "ShuntMode.true", 4); text=strTable.GetString("w21"); var=18; Window(); dsp="s2"; DSP3Thread(); Sleep(7); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); // сцепляемся Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(train0,Mytrain); br.SetWindowVisible(false); // сцепились one=train0.GetVehicles()[0]; Mytrain=one.GetMyTrain(); if (np==97) { // выходные маршруты другим поездам ChangeJunc("y2", 0); ChangeJunc("y122", 2); ChangeJunc("y52", 2); PostMessage(Router.GetGameObject("1y"), "CTRL", "MayOpen^true", 10); PostMessage(Router.GetGameObject("c2y"), "CTRL", "MayOpen^true", 10); PostMessage(Router.GetGameObject("c03y"), "CTRL", "MayOpen^true", 10); text=strTable.GetString("w26"); var=18; Window(); Interface.Print ("wait train2 on Junstion y122"); OnJunction(train2,"y122",4); Interface.Print ("Junstion y122 OK"); puout=18; JunThread(); Sleep(10); SignalOut(); PostMessage(Router.GetGameObject("2yc"), "CTRL", "MayOpen^true", 10); sig = GetNextSignal(train3.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); Sleep(30); puout=18, DSP1Thread(); train3.SetAutopilotMode(2); } Mytrain.SetTrainPriorityNumber(1); lk=1; ii=1; im=10; razd=3; st=ii; speed=60; okno=true; nap=true; if (np==616) side=true; Interface.Print("razd=3"); goto RAZD3; } else { if (np==590) { ChangeJunc("y2", 2); Interface.Print ("wait Junction y1"); OnJunction(Mytrain,"y1",4); Interface.Print ("Junction y1 OK"); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(20); Sleep(10); Mytrain.SetTrainPriorityNumber(3); loko1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; loko1.Uncouple(two1); // отцепились Mytrain=two1.GetMyTrain(); trainout=loko1.GetMyTrain(); Mytrain.SetHandBrake(true); Sleep(10); ChangeJunc("y2", 0); ChangeJunc("y126", 0); ChangeJunc("y122", 0); PostMessage(Router.GetGameObject("1y"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("6ya"), "CTRL", "ShuntMode.true", 1); junin="y120"; text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); dsp="s6"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(trainout,junin,4); Interface.Print ("Junstion "+junin+" OK"); Sleep(10); br.SetWindowVisible(false); train0.SetTrainPriorityNumber(3); dcl[0].SetLocation(train0.GetFrontmostLocomotive()); World.SetCamera(train0.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в тепловоз Sleep(10); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); ChangeJunc("y122", 2); ChangeJunc("y4", 0); PostMessage(Router.GetGameObject("0y"), "CTRL", "ShuntMode.true", 1); text=strTable.GetString("w6"); var=18; Window(); dsp="s2"; DSP3Thread(); // сцепляемся Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(train0,Mytrain); br.SetWindowVisible(false); Sleep(10); // сцепились one=train0.GetVehicles()[0]; Mytrain=one.GetMyTrain(); World.DeleteTrain(trainout); Mytrain.SetTrainPriorityNumber(1); ChangeJunc("y2", 2); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); text=strTable.GetString("w26"); var=18; Window(); ChangeJunc("y130", 2); ChangeJunc("y2", 2); nap=true; SignalOut(); // готовим маршрут встречному SignalIn(); PostMessage(Router.GetGameObject("2yc"), "CTRL", "MayOpen^true", 3); Interface.Print ("wait train2 on Junstion y136"); OnJunction(train2,"y136",4); Interface.Print ("Junstion y136 OK"); iHours=t590h[7], iMins=t590m[7]; text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); time=World.GetGameTime (); // сравниваем время if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime = ((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); while(time"+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(train0.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // пересаживаемся Mytrain.SetTrainPriorityNumber(1); ChangeJunc("y126", 0); ChangeJunc("y122", 2); dcl[0].SetLocation(train0.GetFrontmostLocomotive()); text=strTable.GetString("w20"); var=18; Window(); PostMessage(Router.GetGameObject("0y"), "CTRL", "ShuntMode.true", 1); Sleep(10); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); // сцепка тепловоза TrainUtil.DoCoupleUp(train0,trainout); br.SetWindowVisible(false); Sleep(10); // сцепились one=Mytrain.GetVehicles()[0]; two=train0.GetVehicles()[0]; Mytrain=two.GetMyTrain(); train3=one.GetMyTrain(); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} // теперь меняем кабину World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Mytrain.SetTrainPriorityNumber(1); np=309; dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); puin=4; puout=4; JunThread(); Sleep(7); SignalIn(); SignalOut(); PostMessage(Router.GetGameObject("1y"), "CTRL", "MayOpen^true",30); Sleep(7); np=310; st=7; im=1; pu=2; okno=true; razd=6; vstr2=true; Interface.Print ("goto RAZD6"); goto RAZD6; } else if (np==3447) {razd=5; ii=0; im=6; goto RAZD5;} else if (ii==14) {npw=np-1; razd=5; ii=0; nap=true; im=7; goto RAZD5;} else if (ii!=1){ if (np==6612 or np==6620 or np==6630 or np==6604) junin="y126"; else if (np==6703) junin="y24"; else if (np==6628) junin="ff3"; else if (ii==2) junin="ff1"; else if (np==3441) junin="rr2"; else junin="ss5"; Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,0); Interface.Print ("Junction "+junin+" OK"); if (np==53 or np==667) {World.Play2DSound(SCN_dir,"t2.wav"); Sleep(4); World.Play2DSound(SCN_dir,np+".wav");} } if (ii==1) text=strTable.GetString("w16"); else text=strTable.GetString("w19"); var=0; Window(); if (ii==16) SendMessage(null,"Train","col"); // сигнальные лампы if (ii==1) Sleep (30); else while (!Mytrain.IsStopped()) Sleep(2); /* if (np==6703) { // оборачиваем состав Sleep(10); br1=Constructors.NewBrowser(); br1.SetWindowSize(290,200); br1.SetWindowTop (350); br1.SetWindowLeft (450); br1.LoadHTMLFile(GetAsset(), "info.html"); wait() {on "Browser-URL", "live://exit": br1.SetWindowVisible(false);} im=1, nap=false, np=6704, speed=65; Mytrain.Turnaround(); Sleep (3); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Interface.Print ("train "+np+" go to play"); World.SetGameTime (0.2409721); ChangeJunc("y146", 2), ChangeJunc("y126", 0); goto RAZD1; } */ } } //-------------------------------конец раздела Геническ-Симферополь----------------------- if (razd==3) { //-------------------------------это раздел Джанкой-Феодосия---------------------------- ChangeJunc("y124",0); ChangeJunc("g3",2); ChangeJunc("b20",2); ChangeJunc("c34",2); int [] t211h = new int [0]; t211h [10]= 20; t211h [13]= 21; int [] t211m = new int [0]; t211m [10]= 25; t211m [13]= 0; int [] t212h = new int [0]; t212h [14]= 11; t212h [13]= 11; int [] t212m = new int [0]; t212m [14]= 5; t212m [13]= 19; int [] t6606h = new int [14]; int [] t6607h = new int [15]; int [] t6606m = new int [14]; int [] t6607m = new int [15]; int [] t6605h = new int [14]; int [] t6610h = new int [15]; int [] t6605m = new int [14]; int [] t6610m = new int [15]; t6605h [1]= 4; t6605h [3]= 5; t6605h [4]= 5; t6605h [5]= 5; t6605h [7]= 6; t6605h [9]= 6; t6605h [10]= 6; t6605h [11]= 7; t6605h [12]= 7; t6605h [13]= 7; t6605m [1]= 50; t6605m [3]= 16; t6605m [4]= 28; t6605m [5]= 40; t6605m [7]= 3; t6605m [9]= 30; t6605m [10]= 54; t6605m [11]= 6; t6605m [12]= 18; t6605m [13]= 30; t6606h [3]= 10; t6606h [4]= 10; t6606h [5]= 10; t6606h [7]= 9; t6606h [9]= 9; t6606h [10]= 9; t6606h [11]= 8; t6606h [12]= 8; t6606h [13]= 8; t6606h [14]= 8; t6606m [3]= 39; t6606m [4]= 26; t6606m [5]= 14; t6606m [7]= 52; t6606m [9]= 25; t6606m [10]= 6; t6606m [11]= 52; t6606m [12]= 41; t6606m [13]= 32; t6606m [14]= 20; t6607h [1]= 16; t6607h [3]= 17; t6607h [4]= 17; t6607h [5]= 17; t6607h [7]= 18; t6607h [9]= 18; t6607h [10]= 19; t6607h [13]= 19; t6607m [1]= 45; t6607m [3]= 7; t6607m [4]= 19; t6607m [5]= 34; t6607m [7]= 2; t6607m [9]= 29; t6607m [10]= 1; t6607m [13]= 32; t6610h [3]= 22; t6610h [4]= 22; t6610h [5]= 22; t6610h [7]= 21; t6610h [9]= 21; t6610h [10]= 21; t6610h [11]= 20; t6610h [12]= 20; t6610h [13]= 20; t6610h [14]= 20; t6610m [3]= 35; t6610m [4]= 24; t6610m [5]= 13; t6610m [7]= 52; t6610m [9]= 25; t6610m [10]= 8; t6610m [11]= 58; t6610m [12]= 50; t6610m [13]= 43; t6610m [14]= 30; t6743h [1]= 5; t6743h [2]= 6; t6743h [3]= 6; t6743h [4]= 6; t6743h [5]= 7; t6743h [6]= 7; t6743h [7]= 7; t6743h [8]= 8; t6743h [9]= 8; t6743h [10]= 9; t6743m [1]= 57; t6743m [2]= 16; t6743m [3]= 41; t6743m [4]= 55; t6743m [5]= 14; t6743m [6]= 30; t6743m [7]= 50; t6743m [8]= 11; t6743m [9]= 28; t6743m [10]= 8; t6745h [1]= 14; t6745h [2]= 14; t6745h [3]= 14; t6745h [4]= 15; t6745h [5]= 15; t6745h [6]= 15; t6745h [7]= 15; t6745h [8]= 16; t6745h [9]= 16; t6745h [10]= 16; t6745m [1]= 20; t6745m [2]= 35; t6745m [3]= 56; t6745m [4]= 8; t6745m [5]= 23; t6745m [6]= 35; t6745m [7]= 49; t6745m [8]= 3; t6745m [9]= 21; t6745m [10]= 47; t6750h [1]= 9; t6750h [2]= 9; t6750h [3]= 8; t6750h [4]= 8; t6750h [5]= 8; t6750h [6]= 8; t6750h [7]= 7; t6750h [8]= 7; t6750h [9]= 7; t6750h [10]= 6; t6750h [11]= 6; t6750h [12]= 6; t6750h [13]= 6; t6750h [14]= 6; t6750m [1]= 52; t6750m [2]= 19; t6750m [3]= 59; t6750m [4]= 32; t6750m [5]= 17; t6750m [6]= 1; t6750m [7]= 48; t6750m [8]= 34; t6750m [9]= 18; t6750m [10]= 58; t6750m [11]= 42; t6750m [12]= 28; t6750m [13]= 19; t6750m [14]= 5; int [] t6756h = new int [0]; int [] t6756m = new int [0]; int [] t6757h = new int [0]; int [] t6757m = new int [0]; int [] t6758h = new int [0]; int [] t6758m = new int [0]; int [] t6759h = new int [0]; int [] t6759m = new int [0]; int [] t6760h = new int [0]; int [] t6760m = new int [0]; int [] t6761h = new int [0]; int [] t6761m = new int [0]; int [] t6762h = new int [0]; int [] t6762m = new int [0]; int [] t6763h = new int [0]; int [] t6763m = new int [0]; t6756h [14]= 8; t6756h [13]= 8; t6756h [12]= 8; t6756h [11]= 8; // только суббота t6756m [14]= 5; t6756m [13]= 19; t6756m [12]= 27; t6756m [11]= 40; t6757h [13]= 9; t6757h [12]= 9; t6757h [11]= 9; t6757h [10]= 9; t6757m [13]= 55; t6757m [12]= 45; t6757m [11]= 33; t6757m [10]= 20; t6758h [14]= 10; t6758h [13]= 10; t6758h [12]= 10; t6758h [11]= 11; t6758m [14]= 40; t6758m [13]= 51; t6758m [12]= 59; t6758m [11]= 10; t6759h [13]= 12; t6759h [12]= 12; t6759h [11]= 12; t6759h [10]= 11; t6759m [13]= 25; t6759m [12]= 15; t6759m [11]= 3; t6759m [10]= 50; t6760h [14]= 14; t6760h [13]= 14; t6760h [12]= 15; t6760h [11]= 15; t6760m [14]= 45; t6760m [13]= 58; t6760m [12]= 7; t6760m [11]= 19; t6761h [13]= 17; t6761h [12]= 17; t6761h [11]= 17; t6761h [10]= 16; t6761m [13]= 28; t6761m [12]= 18; t6761m [11]= 7; t6761m [10]= 55; t6762h [14]= 18; t6762h [13]= 18; t6762h [12]= 18; t6762h [11]= 18; t6762h [10]= 18; t6762m [14]= 5; t6762m [13]= 17; t6762m [12]= 26; t6762m [11]= 38; t6762m [10]= 56; t6763h [13]= 20; t6763h [12]= 20; t6763h [11]= 20; t6763h [10]= 20; t6763h [9]= 19; t6763m [13]= 45; t6763m [12]= 35; t6763m [11]= 24; t6763m [10]= 13; t6763m [9]= 45; //-------------------------------создаём наш поезд-------------------------------------- if (pr==1){ if (np==212 or np==6756 or np==6758 or np==6760 or np==6762 or np==6606 or np==6610 or np==6759) pu=1; else if (np==6757 or np==6761 or np==6750 or np==6763) pu=3; else pu=stangf[ii]; if ((np==6749 or np==6745 or np==6743 or np==6607 or np==6605) and ii==1) mark="SYP1", pu=17; else if (np==869 and ii==1) mark="SY1C", pu=1; else if (np==211) mark="SE5", pu=3; else if (nap==false) mark="S"+stanf[ii]+(pu*2)+"C"; else mark="S"+stanf[ii]+(pu*2-1)+"C"; } else { if (ii==1 and Math.Rand(0,10)>5) ii=0, st=0; if (ii==13) pu=Math.Rand(3,5); else if (ii==0) pu=Math.Rand(1,24); else if (ii==1) pu=Math.Rand(6,12); else pu=stangf[ii]; if (ii==1) mark="SY"+(pu*2-5); else if (nap==false) mark="S"+stanf[ii]+(pu*2); else mark="S"+stanf[ii]+(pu*2-1); } sostav=new KUID[0]; stand[pu]=false; // if (np==6750) pu=1, ii=4, st=4, mark="SL2C"; //тест if (np==211) sostav[0]=GetAsset().LookupKUIDTable(0); // пассажирский else if (np==212) {sostav[0]=GetAsset().LookupKUIDTable(0); sostav[1]=GetAsset().LookupKUIDTable(219); sostav[2]=GetAsset().LookupKUIDTable(220);} else if (np>=6756 and np<=6763) sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(214), sostav[2]=GetAsset().LookupKUIDTable(213), sostav[3]=GetAsset().LookupKUIDTable(214); else if (np==6605 or np==6606 or np==6607 or np==6610) {sostav[0]=GetAsset().LookupKUIDTable(180); if (np==6606) sostav[1]=GetAsset().LookupKUIDTable(214), sostav[2]=GetAsset().LookupKUIDTable(213), sostav[3]=GetAsset().LookupKUIDTable(214);} else if (np==6743) {sostav[0]=GetAsset().LookupKUIDTable(6); sostav[1]=GetAsset().LookupKUIDTable(200); sostav[2]=GetAsset().LookupKUIDTable(200); for (is=3; is<7; ++is) sostav[is]=GetAsset().LookupKUIDTable(204);} else if (np==6745) sostav[0]=GetAsset().LookupKUIDTable(12), sostav[1]=GetAsset().LookupKUIDTable(13), mark="SY6"; else if (pr==1) {sostav[0]=GetAsset().LookupKUIDTable(6); for (is=1; is<5; ++is) sostav[is]=GetAsset().LookupKUIDTable(216);} // пригородный else {sostav[0]=GetAsset().LookupKUIDTable(8); sostav[1]=GetAsset().LookupKUIDTable(9); if (np==3443) for (is=2; is<49; ++is) sostav[is]=GetAsset().LookupKUIDTable(87); else for (is=2; is<57; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28));} // грузовой Mytrain=World.CreateTrain(sostav,mark,true); if (np==3443) {veh0=Mytrain.GetVehicles(); prod=GetAsset().LookupKUIDTable("q10"); product=World.FindAsset(prod); for (is=2; is6000 or np<1000) Mytrain.SetTrainPriorityNumber(1); else Mytrain.SetTrainPriorityNumber(2); if (!is) dcl[3].SetLocation(Mytrain.GetFrontmostLocomotive()); else dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив Interface.Print ("sostav "+np+" OK"); if (np==211) { sostav=new KUID[0]; for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(3); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); // пересадили машиниста ChangeJunc("y141", 0); Mytrain.SetTrainPriorityNumber(1); pu=17; World.DeleteTrain(train3); ChangeJunc("y138", 0); } } else if (ii==9) { // тупики Кировской sostav=new KUID[0]; for (is=0; is10 and ii<=12) speed=60; if (ii>12 and ii<14) speed=50; else if (ii==14) speed=25; else if (ii==8 and np==6750) speed=70; else if (np==870 and ii<=7) speed=80; else if (np==869 and ii<5) speed=70; else if (pr==1) speed=60; else speed=80; if (okno==true) { if (np==97) iHours=t97h[ii], iMins=t97m[ii]; else if (np==98) iHours=t98h[ii], iMins=t98m[ii]; else if (np==211) iHours=t211h[ii], iMins=t211m[ii]; else if (np==212) iHours=t212h[ii], iMins=t212m[ii]; else if (np==615) iHours=t615h[ii], iMins=t615m[ii]; else if (np==616) iHours=t616h[ii], iMins=t616m[ii]; else if (np==869) iHours=t869h[ii], iMins=t869m[ii]; else if (np==870) iHours=t870h[ii], iMins=t870m[ii]; else if (np==6606) iHours=t6606h[ii], iMins=t6606m[ii]; else if (np==6607) iHours=t6607h[ii], iMins=t6607m[ii]; else if (np==6605) iHours=t6605h[ii], iMins=t6605m[ii]; else if (np==6610) iHours=t6610h[ii], iMins=t6610m[ii]; else if (np==6743) iHours=t6743h[ii], iMins=t6743m[ii]; else if (np==6744) iHours=t6744h[ii], iMins=t6744m[ii]; else if (np==6750) iHours=t6750h[ii], iMins=t6750m[ii]; else if (np==6749) iHours=t6749h[ii], iMins=t6749m[ii]; else if (np==6745) iHours=t6745h[ii], iMins=t6745m[ii]; else if (np==6746) iHours=t6746h[ii], iMins=t6746m[ii]; else if (np==6756) iHours=t6756h[ii], iMins=t6756m[ii]; else if (np==6757) iHours=t6757h[ii], iMins=t6757m[ii]; else if (np==6758) iHours=t6758h[ii], iMins=t6758m[ii]; else if (np==6759) iHours=t6759h[ii], iMins=t6759m[ii]; else if (np==6760) iHours=t6760h[ii], iMins=t6760m[ii]; else if (np==6761) iHours=t6761h[ii], iMins=t6761m[ii]; else if (np==6762) iHours=t6762h[ii], iMins=t6762m[ii]; else if (np==6763) iHours=t6763h[ii], iMins=t6763m[ii]; if ((ii==1 and pu!=2) or ii==11 or ii==12) side=nap; else if (nap==false) side=true; else side=false; if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); if (ii==st) Flash(); Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep(2); // открываем двери if (np==869 or np==870) is=0; else is=lk+1; if (is) DoorsThread(Mytrain,is,true); Sleep(1); if (puout!=pu and vstr==true and ii!=st) {text=strTable.GetString("w26"); var=18; Window(); while (puout!=pu) Sleep(1);} if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); if ((np==869 or np==615) and ii==9) { // исключительная ситуация в Кировской while (!Mytrain.IsStopped()) Sleep(20); if (np==869) {Interface.Print ("wait time 21.25"); while(time<0.3923) {time=World.GetGameTime(); Sleep(0.1);}} else {Interface.Print ("wait time 16.21"); while(time<0.1813) {time=World.GetGameTime(); Sleep(0.1);}} train2.SoundHorn(); Sleep(2); train2.SetAutopilotMode(2); } else if (np==6607 and ii==10) { // отправка от 6762-го из Владиславовки Interface.Print ("wait time 18.56"); while(time<0.2888) {time=World.GetGameTime(); Sleep(0.1);} sig = GetNextSignal(train2.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); World.Play2DSound(SCN_dir,"ob_na_vokz_111.wav"); Sleep(8); train2.SoundHorn(); Sleep(2); train2.SetAutopilotMode(2); } else if (np==6606 and ii==10) { // отцепка от 6606-го во Владиславовке while (!Mytrain.IsStopped()) Sleep(20); Sleep(5); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint5=two1.GetMyTrain(); traint5.SetHandBrake(true); } Interface.Print ("wait time="+iHours+"."+iMins); // if (iHours==12 and iMins==0) iHours=11, iMins=59, iSecs=50; // решаем проблему перехода через 0 if (ii==st) --iMins, iSecs=35; else iSecs=0; time=World.GetGameTime(); // сравниваем время if (ii==11 and np==6759) while(time>0.5) {time=World.GetGameTime(); Sleep(0.1);} if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime=((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); while(time19) { if (pu==20) PostMessage(Router.GetGameObject("c03y"), "CTRL", "MayOpen^true", 2); PostMessage(Router.GetGameObject("c3y"), "CTRL", "MayOpen^true", 3); } if (vstr==true or ii==st or ii==1) {DSP1Thread(); Sleep(10);} if (okno==true or (pr==1 and ii>10)) { // объявления по перрону if (np==212 and ii==st) World.Play2DSound(SCN_dir,"ob_na_vokz_212.wav"), Sleep(17), World.Play2DSound(GetAsset(),"proshanie_slavyanki.wav"); else if (ii==st and (np==6606 or np==6610)) World.Play2DSound(SCN_dir,"ob_na_vokz_22.wav"); else if (ii==st and np==6762) World.Play2DSound(SCN_dir,"ob_na_vokz_104.wav"); else if (ii==st and np==6758) World.Play2DSound(SCN_dir,"ob_na_vokz_6758.wav"); else if (ii==14 and np!=6750 and np!=6606 and np!=6610) World.Play2DSound(SCN_dir,"ob_na_vokz_102.wav"); else if (ii==14 and np==6750) World.Play2DSound(SCN_dir,"ob_na_vokz_6750.wav"); else if (ii==10 and np==6750) World.Play2DSound(SCN_dir,"ob_na_vokz_6750_.wav"); else if (ii==10 and np==6759) World.Play2DSound(SCN_dir,"ob_na_vokz_28.wav"); else if (np==616 and pu==2) World.Play2DSound(SCN_dir,"ob_na_vokz_613.wav"); else if (np==615 and pu==2) World.Play2DSound(SCN_dir,"ob_na_vokz_614.wav"); else if (ii==10 and (np==6757 or np==6761 or np==6763)) World.Play2DSound(SCN_dir,"ob_na_vokz_110.wav"); else if (ii==10 and np==6762) World.Play2DSound(SCN_dir,"ob_na_vokz_111.wav"); else if (ii==13 and np==6762) World.Play2DSound(SCN_dir,"ob_na_vokz_109.wav"); else if (ii==13 and (np==6757 or np==6759 or np==6761 or np==6763)) World.Play2DSound(SCN_dir,"ob_na_vokz_27.wav"); else if (np==98 and ii==10) World.Play2DSound(SCN_dir,"ob_na_vokz_119.wav"); Sleep(3); text=strTable.GetString("w1")+npw+","+strTable.GetString("w4")+speed+strTable.GetString("w2"); var=4; Window(); } else if (pr==2) br.SetWindowVisible(false); sound=false; if ((np==6750 or np==870) and ii==1) junout="y116"; else if (ii<2) junout="y21"; else if (nap==true) junout=junf[ii]+"1"; else junout=junf[ii]+"2"; if (ii>10 or (ii==10 and nap==true)) tt=0; else tt=4; // проезжаем выходную стрелку Interface.Print ("wait Junction "+junout+", "+tt); OnJunction(Mytrain,junout,tt); Interface.Print ("Junction "+junout+" OK"); if (ii<12) {del=true; DelThread(); while (del==true) Sleep(1);} // удаляем поезда else { if (vstr2==true) {vstr2=false; veh0=train2.GetVehicles(); for (is=0; is3 and ii<12) { // сначала отстой it=Math.Rand(2,(stanputf[ii])); if (it==stangf[ii]) it=stanputf[ii]; if (ii==1) { traint=World.CreateTrain(poz,"poz1",true), Sleep (0.1), traint.SetHandBrake(true); Sleep (2); sostav=new KUID[0]; for (is=0; is5 and ii!=9) { sostav=new KUID[0]; for (is=0; is5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(106,116)); else sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(117,123)); } traint=World.CreateTrain(sostav,"SJ24",true); Sleep (0.1); traint.SetHandBrake(true); } else if (nap==true and ii==12){ // Айвазовская (сразу отстой и тупики) it=Math.Rand(3,7); sostav=new KUID[0]; for (is=0; is5 ) { sostav=new KUID[0]; for (is=0; is0 and Math.Rand(0,7)<4) { sostav=new KUID[0]; it=Math.Rand(1,stantupf[ii]); // отстой if (ii==8 or ii==1) for (is=0; is5) speed=0, im=10; // вероятность отправки грузового на Керчь из Владиславовки if (np==6750 and ii==3) poput=true; // попутный для обгона пригородного else if (Math.Rand(0,10)<5 and ii!=14) vstr2=true, prvsw=2; // вероятность второго встречного if ((np==6749 and (ii==6 or ii==10)) or (np==6750 and ii==10) or (np==615 and (ii==5 or ii==3))) vstr=true, prvs=1; else if ((np==6610 and (ii==12 or ii==13 or ii==9)) or (np==6745 and (ii==2 or ii==9)) or (np==6743 and (ii==7 or ii==8))) vstr=true, prvs=1; else if ((ii!=im and np!=6610 and np!=6605 and np!=6607 and np!=869 and ii!=11 and Math.Rand(0,10)<6) or (np==97 and ii==10)) vstr=true, prvs=2; // вероятность встречного if (vstr==true and pr==2 and ii>2 and ii<10 and stanputf[ii]>2 and Math.Rand(0,10)>6) poput=true; // вероятность попутного (для обгона грузового) else if (vstr==true and pr==2 and ii<10 and stanputf[ii]>2 and Math.Rand(0,10)>6) poput=true, poput2=true, vstr2=false; if (((np==615 or np==869) and ii==9) or (np==870 and ii==8) or (np==98 and ii==2) or (np==616 and ii==3) or (np==615 and ii==6) or ((np==212 or np==6606) and ii==10)) vstr2=true, prvsw=1; else if ((np==97 and ii==3) or (np==6762 and ii==9) or (np==6763 and ii==13) or (np==6607 and (ii==5 or ii==10))) vstr2=true, prvsw=1; else if ((np==6744 and ii==3) or (np==97 and ii==9) or (np==6605 and ii==10)) vstr=true, prvs=1; if (pr==1) { // запрещаем встречные if ((ii==11 and prvsw==2) or (np==615 and (ii==3 or ii==im)) or (np==6610 and (ii==12 or ii==13 or ii==9)) or (np==6745 and prvs==1) or (np==6749 and (ii==4 or ii==6)) or ((ii==1 or ii==3 or ii==10) and (np==870 or np==6750)) or (np==6743 and (ii==7 or ii==8))) vstr2=false; else if ((nap==true and ii==7 and np!=616) or (nap==false and ii==8) or (np==615 and ii==4)) vstr=false; else if (ii==0) vstr=false, vstr2=false; if ((ii==11 and prvs==2) or (ii==1 and (np==870 or np==6750))) vstr=false; else if (ii==10 and (np==869 or np==6610)) vstr=false; else if (np==870 and (ii==5 or ii==3 or ii==1)) vstr=false; else if (ii==13 and np!=6610) vstr=false; else if (np==615 and ii==1) vstr2=false; else if (ii==12) vstr2=false; } if (ii==12 and nap==true) vstr=false; else if (pr==2 and ii==1) vstr=false, poput=false, poput2=false; else if (pr==2 and vstr==true and ii!=4 and ii!=8 and ii!=10 and speed!=0 and Math.Rand(0,10)<6) prvs=1; // некоторые встречные грузовому будут пригородными // если пасс без остановки, встречного не будет if ((np==97 or np==98) and ii!=5 and ii!=7 and ii!=9 and ii!=10 and ii!=1) okno=false, vstr=false; else if ((np==869 or np==870) and ii!=1 and ii!=3 and ii!=5 and ii!=7 and ii!=9 and ii!=10) okno=false, vstr=false; else if ((np==616 or np==615) and ii==6) okno=false, vstr=false; else if (np==616 and ii==2) okno=false, vstr=false; else if ((np==212 or np==211 or np==6607) and (ii==12 or ii==11)) okno=false, vstr=false; else if ((np==6605 or np==6606 or np==6607 or np==6610) and (ii==8 or ii==6 or ii==2)) okno=false, vstr=false; else if (pr==1) okno=true; // пути приёма нашего поезда if ((np==615 and ii==5) or (np==870 and ii==3) or (np==6749 and ii==6) or (np==6743 and (ii==7 or ii==8))) pu=2; else if ((np==97 or np==615 or np==6605 or np==6607 or np==6749 or np==6758) and ii==10) pu=1; else if (np==97 and ii==9) pu=1; else if (np==6750 and ii==10) pu=3; else if (np==6749 and ii==im) pu=3; else if (ii==4) pu=1; else if (ii==1 and (np==615 or np==6750 or np==6744 or np==6746 or np==6606 or np==6610)) pu=17; else if ((np==6750 or np==6749) and (ii==13 or ii==12)) pu=2; else if ((np==870 or np==98) and ii==1) pu=4; else if ((pr==1 and okno==false) or (np==97 or np==98)) pu=stangf[ii]; else if (pr==1 and (ii==11 or ii==9)) pu=3; else if (pr==1 and ii==im and (ii==10 or ii==9)) pu=3; else if (pr==1) pu=1; else if (pr==2) pu=stangf[ii]; stand[pu]=false; // заняли ячейку пути if (np==6750 and ii==3) pupop=2, vstr2=false, vstr=true; else pupop=stanputf[ii]; if (nap==false and ii==12) stand[um]=false; if (ii==im) puout=0; if (vstr2==true) { // если есть встречные - задаём пути приёма для них if ((np==212 or np==6762) and ii==im) puvsw=1; else if (ii==13) puvsw=5; else if (ii==10 and np==6749) {puvsw=6; while (stand[puvsw]==false) puvsw=Math.Rand(5,10);} else if (ii==10 and np==6750) puvsw=4; else if (ii==9 and pu==1 and prvsw==1) puvsw=3; else if ((np==6750 or np==6749) and ii==12) puvsw=4; else if (ii==im) puvsw=stanputf[ii]; else if (vstr==false and pu!=stangf[ii]) puvsw=stangf[ii]; else if (prvsw==1 and pr==2 and (ii==10 or ii==9)) puvsw=3; else if (prvsw==1) puvsw=2; else puvsw=stanputf[ii]; if (prvs==1 and ii==9) Sleep(1); else if (pr==2 or prvsw==2 and (ii==9 or ii==10)) stand[3]=false; // запрещаем ставить на 3 путь Кировской и Владиславовки if ((ii==4 or ii==6) and prvsw==2) puvsw=2; else { while (stand[puvsw]==false) --puvsw; if (puvsw<1) vstr2=false; if (vstr2==true) stand[puvsw]=false;} } if (vstr==true) { if (np==212 and ii==10) puvs=8; else if (np==6749 and ii==6) puvs=1; else if (np==6749 and ii==10) puvs=3; else if (pr==2 and prvs==1 and (ii==10 or ii==9)) puvs=3; else if (pr==2 and prvs==1) puvs=1; else if (pr==1 and pu!=1 and prvs==1) puvs=1; else if (np==97 and ii==10) puvs=2; else if (np==97 and ii==9) puvs=3; //else if (prvs==1) puvs=2; else if (ii==13 and np==6610) puvs=2; else if (ii==13) puvs=4; else if (np==6750 and ii==3) puvs=stanputf[ii]; //else if (pr==1 and pu!=stangf[ii]) puvs=stangf[ii]; else if (pu!=stangf[ii]) puvs=stangf[ii]; else puvs=stanputf[ii]; if (pr==1 and prvs==2 and (ii==9 or ii==10)) stand[3]=false; if ((ii==4 or ii==6) and prvs==2) puvs=2; else { while (stand[puvs]==false and puvs>0) --puvs; if (puvs<1) vstr=false; else stand[puvs]=false; if (poput==true and ii==10) pupop=5; else while (poput==true and stand[pupop]==false) {if (pupop==1) poput=false; else --pupop;} } } if (pr==2 and vstr==true and prvs==2){ // для разнoобразия меняем местами пути if (vstr2==true and Math.Rand(0,10)>5 and speed!=0) tt=puvs, puvs=puvsw, puvsw=tt; if (stanputf[ii]>2 and Math.Rand(0,10)>5 and speed!=0) tt=pu, pu=puvs, puvs=tt; if (ii==6 and vstr2==true and vstr==true) pu=2, puvs=1, puvsw=1; } if (ii==im and pr==2) { // задаём путь прибытия на конечную станцию грузовым if (ii==1) {puvsw=Math.Rand(6,10); stand[puvsw]=false; pu=7; while (stand[pu]==false) pu=Math.Rand(6,10);} else if (ii==14) pu=4; else if (ii==13) {pu=4; while (stand[pu]==false) pu=Math.Rand(3,5);} else if (ii==10) {pu=Math.Rand(5,7), vstr=true, puvs=2, vstr2=true, puvsw=4; while (stand[pu]==false) pu=Math.Rand(6,10);} // путь грузовых на Керчь } if (vstr==true) puout=puvs; else if (ii!=im and ii!=1) puout=pu; // если нет встречного - номер пути на выход тот же, что и на вход else if (ii==im and vstr==false) puout=40; puin=pu; JunThread(); Sleep(3); if (ii==13) lengf[13]=150; if (poput==true and (Math.Rand(0,10)>7 or (np==6750 and ii==3))) order=true; else if (poput2==true and Math.Rand(0,10)>4) order=true; else order=false; // вероятность того, что попутный нас обгонит // открываем светофоры на следующей станции if (ii==1) {PostMessage(Router.GetGameObject("cby"), "CTRL", "MayOpen^true", 6); PostMessage(Router.GetGameObject("cvy"), "CTRL", "MayOpen^true", 5); PostMessage(Router.GetGameObject("c02y"), "CTRL", "MayOpen^true", 4); if (pu==17) PostMessage(Router.GetGameObject("1y"), "CTRL", "MayOpen^true", 120);} else if (nap==true) PostMessage(Router.GetGameObject("n"+junf[ii]), "CTRL", "MayOpen^true", 6); else PostMessage(Router.GetGameObject("c"+junf[ii]), "CTRL", "MayOpen^true", 6); //---------------------------------это блок встречных поездов------------------------------------- Interface.Print ("ii="+ii+", junin="+junin+", junout="+junout); if (vstr==true) { // первый встречный if (nap==true) mark="S"+stanf[ii+1]+stangf[ii+1]*2; else mark="S"+stanf[ii-1]+(stangf[ii-1]*2-1); sostav=new KUID[0]; is=Math.Rand(1,7)*2; if (ii==2) ChangeJunc("y1", 0); if ((np==6749 and ii==10) or (np==97 and ii==9) or (np==6610 and ii==13)) sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(214), sostav[2]=GetAsset().LookupKUIDTable(213), sostav[3]=GetAsset().LookupKUIDTable(214); else if (np==6610 and ii==12) sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(219), sostav[2]=GetAsset().LookupKUIDTable(220); else { if (ii==13) sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(Math.Rand(16,28)); else sostav[0]=GetAsset().LookupKUIDTable(is), sostav[1]=GetAsset().LookupKUIDTable(is+1); if ((np==615 and ii==3) or (np==6762 and ii==9) or (np==6745 and ii==2)) for (is=2; is<16; ++is) {sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(208,213));} // встречный пассажирский else if (prvs==1) for (is=2; is<7; ++is) {sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(200,205));} // встречные пригородные else { sostavsize=38; its=0; // длина двухсекционного локомотива tt=Math.Rand(1,10); for (is=2; is<65; ++is) { sostavsize=sostavsize+its; if (sostavsize>lengf[ii]) break; // если длина состава превысит длину путей станции, больше вагонов не добавляем if (ii==5 and puvs==4 and sostavsize>800) break; if (tt==1) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28)), its=13; else if (tt==2) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(38,46)), its=15; else if (tt==3) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(46,50)), its=12; else if (tt==4) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(50,66)), its=15; else if (tt==5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(79,86)), its=15; else if (tt==6) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(90,92)), its=15; else if (tt==7) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(92,106)), its=15; else if (tt==8) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(106,116)), its=19; else sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(123,128)), its=25; } } } if ((np==615 and ii==5) or (np==6750 and ii==10)) {sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(180); its=3;} if ((np==6743 and ii==8) or (np==6610 and ii==9)) {sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(195), sostav[1]=GetAsset().LookupKUIDTable(196), sostav[2]=GetAsset().LookupKUIDTable(197);} CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.SetTrainPriorityNumber(prvs); Interface.Print ("vstrech on "+mark+" "+is+" vag"); if ((np==615 and ii==5) or (np==6750 and ii==10)) Sleep(0.1); else if ((np==6743 and ii==8) or (np==6745 and ii==9) or (np==6610 and ii==9)) train1.GetVehicles()[2].Reverse(); else train1.GetVehicles()[1].Reverse(); if (its==3) dcl[3].SetLocation(train1.GetFrontmostLocomotive()); else dcl[2].SetLocation(train1.GetFrontmostLocomotive()); if(speed!=0) TrainThread(); train1.SetHeadlightState(false); if (nap==true and ii==9) PostMessage(Router.GetGameObject("c1e"), "CTRL", "MayOpen^true", 2); else {sig=GetNextSignal(train1.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1);} // Открываем выходной светофор if (nap==true and ii==12) PostMessage(Router.GetGameObject("c0b"), "CTRL", "MayOpen^true", 2); else if (nap==false and ii==2) {PostMessage(Router.GetGameObject("nfy"), "CTRL", "MayOpen^true", 16); PostMessage(Router.GetGameObject("NVY"), "CTRL", "MayOpen^true", 15);} // входной светофор следующей станции if (nap==true) PostMessage(Router.GetGameObject("c"+junf[ii]), "CTRL", "MayOpen^true", 20); else PostMessage(Router.GetGameObject("n"+junf[ii]), "CTRL", "MayOpen^true", 20); if (nap==true) lg="T"+stanf[ii]+puvs*2+"C"; else lg="T"+stanf[ii]+(puvs*2-1)+"C"; train1Schedule = new Schedule(); if (prvs==1 and np!=615 and np!=6750) {if (np==6610) is=1; else is=2; ProductThread(train1,is,true); Sleep(2);} if (np==615 and ii==5) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,460);} else if (np==615 and ii==3) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,120);} else if (np==6605 and ii==10) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,780);} else if (np==6610 and ii==13) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,480);} else if (np==6610 and ii==12) {train1Schedule.DriveForever(); train1.RunSchedule(train1Schedule,false,30);} else if (np==6610 and ii==9) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,300);} else if (np==6743 and ii==7) {train1Schedule.StopAtTrigger(lg,120); train1Schedule.DriveForever(); train1.RunSchedule(train1Schedule,false,220);} else if (np==6744 and ii==3) {train1Schedule.StopAtTrigger(lg,120); train1Schedule.DriveForever(); train1.RunSchedule(train1Schedule,false,220);} else if (np==6745 and ii==9) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,340);} else if (np==6750 and ii==10) {train1Schedule.StopAtTrigger(lg,180); train1Schedule.DriveForever(); train1.RunSchedule(train1Schedule,false,1);} else if (np==97 and ii==9) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,2);} else if (np==6749 and ii==10) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,2090);} else if (pr==2 and prvs==1) {train1Schedule.StopAtTrigger(lg,120); train1Schedule.DriveForever(); train1.RunSchedule(train1Schedule,false,10);} } if (vstr2==true) { // второй встречный sostav=new KUID[0]; if (ii==1) mark="SY"+(puvsw*2-5); else if (nap==true) mark="S"+stanf[ii]+(puvsw*2); else mark="S"+stanf[ii]+(puvsw*2-1); if (prvsw==1 and ii!=1) mark=mark+"C"; if (ii==13) sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(Math.Rand(90,92)); else is=Math.Rand(1,7)*2, sostav[0]=GetAsset().LookupKUIDTable(is), sostav[1]=GetAsset().LookupKUIDTable(is+1); if (np==6762 and ii==9) {for (is=1; is<14; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(215,217)); sostav[14]=GetAsset().LookupKUIDTable(220); sostav[15]=GetAsset().LookupKUIDTable(219);} else if ((np==212 or np==6607) and ii==10) {sostav[0]=GetAsset().LookupKUIDTable(0), sostav[1]=GetAsset().LookupKUIDTable(214), sostav[2]=GetAsset().LookupKUIDTable(213), sostav[3]=GetAsset().LookupKUIDTable(214);} else if (prvsw==1) for (is=1; is<7; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(200,205)); // встречные пригородные else {sostavsize=38; tt=Math.Rand(1,10); for (is=2; islengf[ii]) break; if (ii==5 and puvsw==4 and sostavsize>800) break; if (tt==1) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28)), its=13; else if (tt==2) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(38,46)), its=15; else if (tt==3) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(46,50)), its=12; else if (tt==4) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(92,106)), its=15; else if (tt==5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(50,66)), its=15; else if (tt==6) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(79,86)), its=15; else if (tt==7) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(88,90)), its=15; else if (tt==8) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(128,144)), its=15; else sostav[is]=GetAsset().LookupKUIDTable(88), its=15; sostavsize=sostavsize+its; } } if ((np==869 and ii==9) or (np==6763 and ii==13)) {sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(180); itt=99;} else Interface.Print ("vstrech 2 on "+mark+" "+is+" vag"); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train2=loko0.GetMyTrain();} if (itt!=99) {train2.GetVehicles()[1].Reverse(); dcl[1].SetLocation(train2.GetFrontmostLocomotive());} else dcl[3].SetLocation(train2.GetFrontmostLocomotive()); train2.SetTrainPriorityNumber(prvsw); train2.SetHeadlightState(true); train2.SetHandBrake(true); if (prvsw==1) {if (itt==99) is=0; else is=2; ProductThread(train2,is,true); Sleep(2);} else if (tt==8 and ii<11) {ProductThread(train2,sos,false); Sleep(4);} } if (poput==true) { // попутный2 - уже стоит на станции прибытия, а попутный создаётся следом за нами sostav=new KUID[0]; if (poput2==true) {if (nap==true) mark="S"+stanf[ii]+(pupop*2-1); else mark="S"+stanf[ii]+(pupop*2);} else {if (nap==true) mark="S"+stanf[ii-1]+(stangf[ii-1]*2-1); else mark="S"+stanf[ii+1]+(stangf[ii+1]*2);} sostavsize=38; if (np==6750 and ii==3) sostav[0]=GetAsset().LookupKUIDTable(195), sostav[1]=GetAsset().LookupKUIDTable(196), sostav[2]=GetAsset().LookupKUIDTable(197); else { is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); tt=Math.Rand(0,10); if (tt>5) its=23; else its=21; for (is=2; is<28; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(117,123)); } Interface.Print ("poputn on "+mark+", order="+order); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train3=loko0.GetMyTrain();} train3.SetTrainPriorityNumber(2); dcl[3].SetLocation(train3.GetFrontmostLocomotive()); if (np==6750) train3.GetVehicles()[2].Reverse(); else train3.GetVehicles()[1].Reverse(); if (nap==false and ii==9) PostMessage(Router.GetGameObject("c1e"), "CTRL", "MayOpen^true", 2); else {sig=GetNextSignal(train3.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1);} if (ii==2) train3.SetHandBrake(true); train3.SetHeadlightState(false); if (pr==2 and poput2==false) train3.SetAutopilotMode(2); else if (np==6750 and ii==3) { ProductThread(train3,0,true); Sleep(2); train1Schedule = new Schedule(); train1Schedule.StopAtTrigger("TO3C",60); train1Schedule.DriveForever(); train3.RunSchedule(train1Schedule,false,690); } } if (ii==12 or ((np==212 or np==97) and ii==10)) { // маневровый состав sostav=new KUID[0]; tt=Math.Rand(1,5); if (tt==2) tt=5; if (np==212 and ii==10) { // 98-й mark="SE4C"; is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<15; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(204,211));} else if (np==97) {mark="SE13C"; sostav[0]=GetAsset().LookupKUIDTable(0); for (is=1; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); puout=0; JunThread(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); if (ii==13){ // в депо Айвазовской PostMessage(Router.GetGameObject("m2b"), "CTRL", "ShuntMode.true", 8); Sleep(5); ChangeJunc("b1",2); text=strTable.GetString("w18")+"b15"; var=18; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junstion b15"); OnJunction(Mytrain,"b15",Navigate.JUNCTION_LEAVE); Sleep(10); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); PostMessage(Router.GetGameObject("n7b"), "CTRL", "ShuntMode.true", 3); ChangeJunc("b13",0); ChangeJunc("b0",0); text=strTable.GetString("w14"); var=18; Window(); junin="b49"; Sleep(5); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junstion b23"); OnJunction(Mytrain,"b23",Navigate.JUNCTION_LEAVE); br.SetWindowVisible(false); ChangeJunc("b23", 2); ChangeJunc("b25", 2); while (!Mytrain.IsStopped()) Sleep(20); } else { // депо Джанкой PostMessage(Router.GetGameObject("n12ay"), "CTRL", "ShuntMode.true", 4); PostMessage(Router.GetGameObject("m55y"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m47y"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("mdy"), "CTRL", "ShuntMode.true", 5); junin="y82"; if (ii==1) {ChangeJunc("y62", 2); ChangeJunc("y12", 2); ChangeJunc("y14", 2); ChangeJunc("y16", 2);} ChangeJunc("y110", 2); ChangeJunc("y39", 2); ChangeJunc("y95", 2); ChangeJunc("y93", 2); ChangeJunc("y80", 0); ChangeJunc("y82", 0); } text=strTable.GetString("w7"); var=18; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,Navigate.JUNCTION_LEAVE); oknotext=""+HTMLWindow.StartTable(); oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w13")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); } else if (np==212) { text=strTable.GetString("w26"); var=3; Window(); while (!Mytrain.IsStopped()) Sleep(1); pr=3; Mytrain.SetTrainPriorityNumber(pr); ChangeJunc("e15", 2); Interface.Print ("wait time 11.45"); while(time<0.98958) {time=World.GetGameTime(); Sleep(0.1);} World.Play2DSound(SCN_dir,"ob_na_vokz_28.wav"); Sleep(10); train2.SoundHorn(); Sleep(2); train2.SetAutopilotMode(2); ChangeJunc("e2", 2); one=train3.GetVehicles()[1]; two=train3.GetVehicles()[2]; one.Uncouple(two); train3=one.GetMyTrain(); train2=two.GetMyTrain(); train2.SetHandBrake(true); Sleep(10); train3.SoundHorn(); train1Schedule = new Schedule(); train1Schedule.StopAtTrigger("TE4",10); train3.RunSchedule(train1Schedule,false,5); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint=two1.GetMyTrain(); traint.SetHandBrake(true); // отцепились ChangeJunc("e4", 2); junin="e4"; text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); PostMessage(Router.GetGameObject("c3e"), "CTRL", "ShuntMode.true", 2); dsp="s8"; DSP3Thread(); PostMessage(Router.GetGameObject("m11e"), "CTRL", "ShuntMode.true", 2); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); Interface.Print ("Junstion "+junin+" OK"); while (!Mytrain.IsStopped()) Sleep(15); Mytrain.Turnaround(); Sleep(10); ChangeJunc("e4", 0); ChangeJunc("e15", 2); ChangeJunc("e3", 0); junin="e3"; World.Play2DSound(SCN_dir,"ob_na_vokz_80.wav"); text=strTable.GetString("w18")+junin; var=18; Window(); PostMessage(Router.GetGameObject("m9e"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("n1e"), "CTRL", "ShuntMode.true", 15); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); Interface.Print ("Junstion "+junin+" OK"); while (!Mytrain.IsStopped()) Sleep(15); Sleep(10); Mytrain.Turnaround(); ChangeJunc("e3", 2); PostMessage(Router.GetGameObject("m18e"), "CTRL", "ShuntMode.true", 5); text=strTable.GetString("w20"); var=18; Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train2.SetDecouplingMask(Vehicle.COUPLE_BOTH); train2.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train2); br.SetWindowVisible(false); // сцепились while (!Mytrain.IsStopped()) Sleep(15); Sleep(10); Mytrain.Turnaround(); World.Play2DSound(SCN_dir,"ob_na_vokz_73.wav"); ChangeJunc("e5", 0); ChangeJunc("e7", 0); text=strTable.GetString("w9"); var=18; Window(); PostMessage(Router.GetGameObject("n2e"), "CTRL", "ShuntMode.true", 3); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); Interface.Print ("Junstion "+junin+" OK"); while (!Mytrain.IsStopped()) Sleep(15); Sleep(10); Mytrain.Turnaround(); ChangeJunc("e15", 0); ChangeJunc("e3", 0); World.Play2DSound(SCN_dir,"ob_na_vokz_118.wav"); text=strTable.GetString("w6"); Sleep(6); var=18; Window(); dsp="s2"; DSP3Thread(); PostMessage(Router.GetGameObject("m2e"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m18e"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m20e"), "CTRL", "ShuntMode.true", 4); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); traint.SetDecouplingMask(Vehicle.COUPLE_BOTH); traint.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,traint); br.SetWindowVisible(false); // сцепились while (!Mytrain.IsStopped()) Sleep(15); Sleep(10); Mytrain.Turnaround(); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint=two1.GetMyTrain(); traint.SetHandBrake(true); Sleep(10);// отцепились } else if (np==98){ // будем менять 98-му локомотив ChangeJunc("y2", 2); if (vstr2==false) {Interface.Print ("wait Junction y79"); OnJunction(Mytrain,"y79",0); Interface.Print ("Junction y79 OK");} br.SetWindowVisible(false); World.Play2DSound(SCN_dir,"ob_na_vokz_115.wav"); Sleep(12); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(20); Sleep(10); pr=3; Mytrain.SetTrainPriorityNumber(pr); loko1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; loko1.Uncouple(two1); // отцепились Mytrain=two1.GetMyTrain(); trainout=loko1.GetMyTrain(); Mytrain.SetHandBrake(true); Sleep(10); ChangeJunc("y2", 0); ChangeJunc("y126", 0); ChangeJunc("y122", 0); PostMessage(Router.GetGameObject("1y"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("6ya"), "CTRL", "ShuntMode.true", 1); junin="y120"; text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(trainout,junin,4); Interface.Print ("Junstion "+junin+" OK"); Sleep(10); br.SetWindowVisible(false); World.SetCamera(train0.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в электровоз Sleep(10); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); ChangeJunc("y122", 2); PostMessage(Router.GetGameObject("0y"), "CTRL", "ShuntMode.true", 1); Sleep(2); text=strTable.GetString("w6"); var=18; Window(); dsp="s1"; DSP3Thread(); // сцепляемся Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(train0,Mytrain); br.SetWindowVisible(false); Sleep(10); // сцепились one=train0.GetVehicles()[0]; Mytrain=one.GetMyTrain(); World.DeleteTrain(trainout); Mytrain.SetTrainPriorityNumber(1); ChangeJunc("y2", 2); PostMessage(Router.GetGameObject("1y"), "CTRL", "MayOpen^true",5); Interface.Print("razd=1"); pr=1; ii=7; im=1; razd=1; st=ii; speed=80; okno=true; pu=4; goto RAZD1; } else if (np==97){ br.SetWindowVisible(false); ChangeJunc("e21", 2); while (!Mytrain.IsStopped()) Sleep(20); Sleep(25); veh0=Mytrain.GetVehicles(); tt=veh0.size(); one=Mytrain.GetVehicles()[tt-3]; two=Mytrain.GetVehicles()[tt-2]; one.Uncouple(two); Mytrain=one.GetMyTrain(); traint5=two.GetMyTrain(); traint5.SetHandBrake(true); // отцепились text=strTable.GetString("w12"); var=18; Window(); Sleep(10); World.Play2DSound(SCN_dir,"ob_na_vokz_150.wav"); train3.SetAutopilotMode(2); while (puout!=1) Sleep(10); Interface.Print ("razd=2"); ii=0; im=7; razd=2; st=ii; okno=true; goto RAZD2; } else if (np==615){ sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(14), sostav[1]=GetAsset().LookupKUIDTable(15); train0=World.CreateTrain(sostav,"SYP5",true); train0.GetVehicles()[1].Reverse(); train0.SetHeadlightState(true); train0.SetTrainPriorityNumber(3); ChangeJunc("y2", 0); // dcl[3].SetLocation(train0.GetFrontmostLocomotive()); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); Interface.Print ("2TE116 OK"); Interface.Print ("wait Junction y124"); OnJunction(Mytrain,"y124",0); Interface.Print ("Junction y124 OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Sleep(10); Mytrain.SetTrainPriorityNumber(3); ChangeJunc("y52", 0); loko1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; loko1.Uncouple(two1); // отцепились сами Mytrain=loko1.GetMyTrain(); trainout=two1.GetMyTrain(); trainout.SetHandBrake(true); Sleep(10); trig="c17y", junin="y52"; // маневрируем PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 5); Sleep(10); text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junstion "+junin+" OK"); br.SetWindowVisible(false); // "отцепляем" 310-й loko1=train2.GetVehicles()[0]; two1=train2.GetVehicles()[1]; loko1.Uncouple(two1); Sleep(1); train2.SetDecouplingMask(Vehicle.COUPLE_BOTH); train2.SetCouplingMask(Vehicle.COUPLE_BOTH); World.DeleteVehicle(loko1); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); World.DeleteTrain(Mytrain); sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(232); Mytrain=World.CreateTrain(sostav,"SY4C",true); Mytrain.SetTrainPriorityNumber(3); Mytrain.SetPantographState(1); Mytrain.SetHeadlightState(true); Mytrain.SetHandBrake(true); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); br.SetWindowVisible(false); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в электровоз ChangeJunc("y2", 2); Sleep(10); ChangeJunc("y111",2); PostMessage(Router.GetGameObject("2y"), "CTRL", "ShuntMode.true", 2); text=strTable.GetString("w6"); var=18; Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); // сцепляемся Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); trainout.SetDecouplingMask(Vehicle.COUPLE_BOTH); trainout.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,trainout); br.SetWindowVisible(false); // сцепились Mytrain.SetTrainPriorityNumber(1); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Interface.Print ("wait couple to 310"); ChangeJunc("y126", 0); // для 310-го готовим прицепку локомотива PostMessage(Router.GetGameObject("0y"), "CTRL", "ShuntMode.true", 2); train1Schedule = new Schedule(); train1Schedule.CoupleVehicle(two1); train0.RunSchedule(train1Schedule,false,15); text=strTable.GetString("w26"); var=18; Window(); Sleep(90); poput=true; Interface.Print ("razd=1"); ii=7; im=16; razd=1; st=7; okno=true; pu=17; nap=true; speed=70; goto RAZD1; } else if (ii==14 and np==6757 or np==6759 or np==6761) { br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); pr=3; Mytrain.SetTrainPriorityNumber(pr); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train3=two1.GetMyTrain(); train3.SetHandBrake(true); Sleep(10); ChangeJunc("a1", 0); PostMessage(Router.GetGameObject("m4a"), "CTRL", "ShuntMode.true", 2); junout="a1"; text=strTable.GetString("w11"); var=18; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); ChangeJunc("a1", 2), ChangeJunc("a3", 0), ChangeJunc("a4", 2), ChangeJunc("a2", 0), junout="a2", trig="c2a"; World.Play2DSound(SCN_dir,"ob_na_vokz_80.wav"); PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 15); PostMessage(Router.GetGameObject("m2a"), "CTRL", "ShuntMode.true", 2); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); JunThread(); PostMessage(Router.GetGameObject("m1a"), "CTRL", "ShuntMode.true", 7); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); Sleep(10); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train3); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); ++np; if (np==6762) im=9; else im=10; nap=false; st=ii; okno=true; if (np==6760) World.SetGameTime (0.1132); pr=1; Mytrain.SetTrainPriorityNumber(pr); Mytrain.Turnaround(); ChangeJunc("c3", 0); ChangeJunc("e15", 2); goto RAZD3; } else if (np==6758) { if (vstr2==true) {PostMessage(Router.GetGameObject("nd"), "CTRL", "MayOpen^true", 0); PostMessage(Router.GetGameObject("n3d"), "CTRL", "MayOpen^true", 5);} br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); pr=3; Mytrain.SetTrainPriorityNumber(pr); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); Sleep(30); junout="e2", trig="c1e"; puout=pu; JunThread(); // теперь создаём 98-й sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(Math.Rand(1,7)*2); for (is=1; is<12; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(204,211)); CreateTrain("SP4"); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.SetTrainPriorityNumber(1); dcl[2].SetLocation(train1.GetFrontmostLocomotive()); vstr=true; train1Schedule = new Schedule(); train1Schedule.StopAtTrigger("TE4C",10); train1.RunSchedule(train1Schedule,false,200); PostMessage(Router.GetGameObject("c2p"), "CTRL", "MayOpen^true", 5); PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m11e"), "CTRL", "ShuntMode.true", 4); text=strTable.GetString("w11"); var=18; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); puin=4, puout=4; JunThread(); junout="e1", trig="n4e"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 20); PostMessage(Router.GetGameObject("m3e"), "CTRL", "ShuntMode.true", 4); World.Play2DSound(SCN_dir,"ob_na_vokz_105.wav"); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); puin=1; puout=3; JunThread(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); ChangeJunc("e29", 0); PostMessage(Router.GetGameObject("с3с"), "CTRL", "MayOpen^true", 9); PostMessage(Router.GetGameObject("m6e"), "CTRL", "ShuntMode.true", 4); PostMessage(Router.GetGameObject("m20e"), "CTRL", "ShuntMode.true", 5); text=strTable.GetString("w20"); var=18; Window(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); ChangeJunc("e15", 0); ++np; im=14; nap=true; st=ii; okno=true; Mytrain.SetTrainPriorityNumber(1); Mytrain.Turnaround(); text=strTable.GetString("w26"); var=3; Window(); PostMessage(Router.GetGameObject("c0e"), "CTRL", "MayOpen^true", 2); Interface.Print ("wait 98 on Junction e7"); OnJunction(train1,"e7",0); Interface.Print ("Junction e7 OK"); World.Play2DSound(SCN_dir,"ob_na_vokz_50.wav"); Interface.Print ("wait time 11.35"); trig="c3e"; Flash(); PostMessage(Router.GetGameObject(trig), "CTRL", "MayOpen^true", 1); while(time<0.98264) {time=World.GetGameTime(); Sleep(0.1);} Sleep(10), train3.SoundHorn(), Sleep(5), train3.SetAutopilotMode(2); // отправили 6746 Interface.Print ("wait 6746 on Trigger TECH"); OnTrigger(train3,"TECH",0); Interface.Print ("Trigger TECH OK"); Flash(); World.DeleteTrain(train3); sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(0); sostav[1]=GetAsset().LookupKUIDTable(220); sostav[2]=GetAsset().LookupKUIDTable(219); train3=World.CreateTrain(sostav,"SD6",true); train3.SetTrainPriorityNumber(1); dcl[3].SetLocation(train3.GetFrontmostLocomotive()); Schedule Sched212 = new Schedule(); Sched212.StopAtTrigger("TE6C",10); train3.RunSchedule(Sched212,false,60); Interface.Print ("train 212 OK"); PostMessage(Router.GetGameObject("c3d"), "CTRL", "MayOpen^true", 20); PostMessage(Router.GetGameObject("ce"), "CTRL", "MayOpen^true", 3); Interface.Print ("wait 212 on Junction e1"); OnJunction(train3,"e1",0); Interface.Print ("Junction e1 OK"); World.Play2DSound(SCN_dir,"ob_na_vokz_51.wav"); man=true; pr=1; goto RAZD3; } else if (ii==10 or ii==9){ br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); pr=3; Mytrain.SetTrainPriorityNumber(pr); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train3=two1.GetMyTrain(); train3.SetHandBrake(true); if (np==6762) {Interface.Print ("wait time 19.16"); while(time<0.3028) {time=World.GetGameTime(); Sleep(0.1);} sig = GetNextSignal(train2.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",5); train2.SoundHorn(); Sleep(2); train2.SetAutopilotMode(2);} // ждём отправки 97-го Sleep(10); if (ii==10) {junout="e4", trig="c3e", ChangeJunc("e22", 0); PostMessage(Router.GetGameObject("m11e"), "CTRL", "ShuntMode.true", 2);} else {junout="f4", trig="c3f"; ChangeJunc(junout, 2); sig = GetNextSignal(Mytrain.GetVehicles()[0]); PostMessage(sig,"CTRL","ShuntMode.true",9);} text=strTable.GetString("w11"); var=18; Window(); dsp="s8"; DSP3Thread(); PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 10); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); puin=1; puout=1; JunThread(); if (ii==10) trig="m9e"; else trig="m9f"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 2); if (ii==10) junout="e15", trig="n1e"; else junout="f3", trig="n1f"; World.Play2DSound(SCN_dir,"ob_na_vokz_80.wav"); PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 20); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); puin=3; JunThread(); if (ii==10) trig="m20e"; else trig="m4f"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 2); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); Sleep(10); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train3); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); ++np; im=14; nap=true; st=ii; okno=true; Mytrain.SetTrainPriorityNumber(1); Mytrain.Turnaround(); ChangeJunc("e22", 2); ChangeJunc("c4", 2); if (np==6761) World.SetGameTime (0.2034); ChangeJunc("b4", 0); if (ii==10) Sleep(10), World.Play2DSound(SCN_dir,"ob_na_vokz_138.wav"); pr=1; goto RAZD3; } else if (np==870 or np==6750) { Interface.Print ("wait Junction y1"); OnJunction(Mytrain,"y1",4); Interface.Print ("Junction y1 OK"); br.SetWindowVisible(false); ii=7, im=1, okno=true, razd=6; Interface.Print ("goto RAZD6"); goto RAZD6; } else if (pr==1) { if (vstr==false and vstr2==false) {Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,0); Interface.Print ("Junstion "+junin+" OK");} if (np==6749) World.Play2DSound(SCN_dir,"ob_na_vokz_6749_.wav"); text=strTable.GetString("w19"); var=0; Window(); } Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep(5); } // конец раздела 3 if (razd==2) { //-------------------------------это раздел Владиславовка - Керчь-------------------------- t6744h [0]= 23; t6744h [1]= 23; t6744h [2]= 22; t6744h [3]= 22; t6744h [4]= 21; t6744h [5]= 21; t6744h [6]= 21; t6744h [7]= 20; t6744m [0]= 50; t6744m [1]= 2; t6744m [2]= 33; t6744m [3]= 8; t6744m [4]= 46; t6744m [5]= 27; t6744m [6]= 10; t6744m [7]= 45; t6746h [0]= 11; t6746h [1]= 10; t6746h [2]= 10; t6746h [3]= 9; t6746h [4]= 9; t6746h [5]= 9; t6746h [6]= 8; t6746h [7]= 8; t6746m [0]= 35; t6746m [1]= 42; t6746m [2]= 10; t6746m [3]= 51; t6746m [4]= 31; t6746m [5]= 14; t6746m [6]= 59; t6746m [7]= 35; //-------------------------------создаём наш поезд-------------------------------------- if (pr==2 and ii==7 and np!=3446) pu=Math.Rand(3,7), stand[pu]=false; else if (np==615) pu=2; else pu=1; if (np==3442) mark="SZD1"; else if (np==3440) mark="SZD3", ChangeJunc("z67", 2); else if (np==3446) pu=Math.Rand(1,6), stand[pu]=false, mark="SX"+(pu*2-1); else mark="SZ"+(pu*2); if (pr==1) mark=mark+"C"; // else if (nap==false) mark="S"+stan[ii]+(pu*2); else mark="S"+stan[ii]+(pu*2-1); sostav=new KUID[0]; if (np==870) Mytrain=World.CreateTrain(np870,mark,true); else if (pr==1) {sostav[0]=GetAsset().LookupKUIDTable(12); if (Math.Rand(0,10)>7) sostav[1]=GetAsset().LookupKUIDTable(13), lk=1; else lk=0; if (np==98) { // пассажирский for (is=sostav.size()+1; is<7; ++is) sostav[is]=GetAsset().LookupKUIDTable(215); for (is=7; is<14; ++is) sostav[is]=GetAsset().LookupKUIDTable(216); sostav[14]=GetAsset().LookupKUIDTable(176); } else for (is=sostav.size()+1; is<7; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(200,205));} // пригородный else if (np==3440 or np==3442) sostav[0]=GetAsset().LookupKUIDTable(14), sostav[1]=GetAsset().LookupKUIDTable(15); // грузовой else if (np==3446) {it=Math.Rand(2,8)*2; sostav[0]=GetAsset().LookupKUIDTable(it), sostav[1]=GetAsset().LookupKUIDTable(it+1); for (is=2; is<11; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(117,123));} else {sostav[0]=GetAsset().LookupKUIDTable(12); sostav[1]=GetAsset().LookupKUIDTable(13); for (is=2; is<57; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28));} Interface.Print ("train "+np+" on "+mark); if (np!=870) Mytrain=World.CreateTrain(sostav,mark,true); if (np==870) Mytrain.GetVehicles()[2].Reverse(); else Mytrain.GetVehicles()[1].Reverse(); if (pr==1) Mytrain.SetTrainPriorityNumber(1); else if (np==3440) Mytrain.SetTrainPriorityNumber(3); else Mytrain.SetTrainPriorityNumber(2); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив if (np!=98 and np!=3446 and ii==7) SoundThread(); if (pr==1) {if (np==870) is=0; else is=2; ProductThread(Mytrain,is,true); Sleep(2);} //-----------------------------создаём недвижимость------------------------------------ RAZD2: // станции маршрута Крым-Владиславовка stan [9]="R"; stan [8]="N"; stan [7]="Z"; stan [6]="W"; stan [5]= "V"; stan [4]= "U"; stan [3]= "T"; stan [2]= "S"; stan [1]= "P"; stan [0]= "E"; // стрелки jun [1]="p"; jun [2]="s"; jun [3]="t"; jun [4]="u"; jun [5]="v"; jun [6]="w"; jun [7]="z"; jun [8]="n"; jun [9]="r"; jun [0]="e"; // номер главного пути stang [9] = 3; stang [8] = 2; stang [7] = 2; stang [6] = 3; stang [5] = 3; stang [4] = 2; stang [3] = 2; stang [2] = 3; stang [1] = 2; stang [0] = 2; // кол-во путей stanput [9] = 4; stanput [8] = 4; stanput [7] = 7; stanput [6] = 3; stanput [5] = 4; stanput [4] = 3; stanput [3] = 2; stanput [2] = 6; stanput [1] = 3; stanput [0] = 10; // кол-во тупиков stantup [0] = 0; stantup [1] = 0; stantup [2] = 6; stantup [3] = 0; stantup [4] = 1; stantup [5] = 2; stantup [6] = 0; stantup [7] = 3; stantup [8] = 2; stantup [9] = 0; int [] leng = new int [10]; // длина путей leng[0]=900; leng[1]=800; leng[2]=800; leng[3]=800; leng[4]=860; leng[5]=860; leng[6]=830; leng[7]=800; leng[8]=850; leng[9]=860; if (ii==7) { // заполняем тупики Керчи sostav=new KUID[0]; for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); //Mytrain.SetTrainPriorityNumber(2); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(20); pu=3; puout=pu; PostMessage(Router.GetGameObject("c0z"), "CTRL", "MayOpen^true", 4); // PostMessage(Router.GetGameObject("5q"), "CTRL", "MayOpen^true", 3); lg="c2ez"; lgw="2zc"; pu=2; puout=pu, puin=pu; JunThread(); PostMessage(Router.GetGameObject(lg), "CTRL", "MayOpen^true", 13); PostMessage(Router.GetGameObject(lgw), "CTRL", "MayOpen^true", 12); } else if (np==3440){ dsp="s9"; DSP3Thread(); ChangeJunc("z55", 2); puin=10; JunThread(); Sleep(6); PostMessage(Router.GetGameObject("m32z"), "CTRL", "ShuntMode.true", 20); junin="z5"; text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junction z5"); OnJunction(Mytrain,"z5",4); Interface.Print ("Junction z5 OK"); br.SetWindowVisible(false); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); pu=tt; puin=pu; JunThread(); if (pu==3) lg="m16z"; else lg="m18z"; PostMessage(Router.GetGameObject(lg), "CTRL", "ShuntMode.true", 7); text=strTable.GetString("w20"); var=18; Window(); dsp="s2"; DSP3Thread(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); traint.SetDecouplingMask(Vehicle.COUPLE_BOTH); traint.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,traint); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.SetTrainPriorityNumber(2); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(20); PostMessage(Router.GetGameObject(pu+"z"), "CTRL", "MayOpen^true", 15); PostMessage(Router.GetGameObject("0z"), "CTRL", "MayOpen^true", 12); PostMessage(Router.GetGameObject("nn"), "CTRL", "MayOpen^true", 30); PostMessage(Router.GetGameObject("1n"), "CTRL", "MayOpen^true", 40); PostMessage(Router.GetGameObject("nr"), "CTRL", "MayOpen^true", 50); ChangeJunc("n2", 0); ChangeJunc("n1", 2); ChangeJunc("r2", 0); ChangeJunc("r6", 0); sound=false; Sleep(20); DSP1Thread(); Interface.Print ("wait Junction q23"); OnJunction(Mytrain,"q23",4); Interface.Print ("Junction q23 OK"); Sleep(20); World.Play2DSound(SCN_prs,"1a"+Math.Rand(1,6)+".wav"); Interface.Print ("wait Junction r6"); OnJunction(Mytrain,"r6",4); Interface.Print ("Junction r6 OK"); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep (5); Sleep(20); one1=Mytrain.GetVehicles()[1]; two1=Mytrain.GetVehicles()[2]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); train0.SetTrainBrakes(4.0); Sleep(10); Mytrain.SetTrainPriorityNumber(3); ChangeJunc("r1", 2); ChangeJunc("r3", 2); ChangeJunc("r5", 0); junin="r1"; PostMessage(Router.GetGameObject("4r"), "CTRL", "ShuntMode.true", 3); text=strTable.GetString("w12")+strTable.GetString("w18")+junin; var=18; Window(); ChangeJunc("r6", 2); dsp="s3"; DSP3Thread(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); Sleep(15); one=train3.GetVehicles()[0]; two=train3.GetVehicles()[1]; one.Uncouple(two); train3=one.GetMyTrain(); traint=two.GetMyTrain(); traint.SetHandBrake(true); traint.SetTrainBrakes(4.0); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); Schedule Train1Schedule = new Schedule(); // задаём команды маневровому локу Train1Schedule.StopAtTrigger("TRCH1",10); Train1Schedule.ReverseTrain(); Train1Schedule.StopTrain(10); Train1Schedule.TakeJunction ("r6", 0); Train1Schedule.CoupleVehicle(two1); Train1Schedule.StopTrain(120); Train1Schedule.StopAtTrigger("TR8P",10); train3.RunSchedule(Train1Schedule,false,12); PostMessage(Router.GetGameObject("3rc"), "CTRL", "ShuntMode.true", 10); PostMessage(Router.GetGameObject("m1r"), "CTRL", "ShuntMode.true", 60); PostMessage(Router.GetGameObject("4r"), "CTRL", "ShuntMode.true", 90); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); ChangeJunc("r1", 0); ChangeJunc("r4", 0); junin="r2"; PostMessage(Router.GetGameObject("m10r"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m16r"), "CTRL", "ShuntMode.true", 3); text=strTable.GetString("w18")+junin; var=18; Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_79.wav"); Interface.Print ("wait man loc on Junction r6"); OnJunction(train3,"r6",4); Interface.Print ("man loc on Junction r6 OK"); Sleep(10); Interface.Print ("wait man loc on Junction r6"); OnJunction(train3,"r6",4); Interface.Print ("man loc on Junction r6 OK"); ChangeJunc("r2", 2); ChangeJunc("r1", 2); PostMessage(Router.GetGameObject("2rc"), "CTRL", "ShuntMode.true", 15); Interface.Print ("wait Junction r2"); OnJunction(Mytrain,"r2",4); Interface.Print ("Junction r2 OK"); Sleep(15); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); ChangeJunc("r2", 0); ChangeJunc("r6", 2); Sleep(10); text=strTable.GetString("w21"); var=18; Window(); PostMessage(Router.GetGameObject("m1r"), "CTRL", "ShuntMode.true", 2); dsp="s2"; DSP3Thread(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); traint.SetDecouplingMask(Vehicle.COUPLE_BOTH); traint.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,traint); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); Mytrain.SetTrainPriorityNumber(2); Sleep(20); poput=true; ii=9; pu=3; puout=3; st=ii; Sleep(30); traint=null; oknotext=""; } else if (np==3446) { while (stand[it]==false) it=Math.Rand(3,8); mark="SZ"+(it*2)+"C"; sostav=new KUID[0]; // вагоны для прицепки for (is=0; is1) ChangeJunc("z114", 0); Interface.Print ("wait Junction z114"); OnJunction(Mytrain,"z114",4); Interface.Print ("Junction z114 OK"); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); ChangeJunc("z114", 2); Mytrain.SetTrainPriorityNumber(3); Sleep(15); puin=pu; JunThread(); Sleep(7); PostMessage(Router.GetGameObject(pu+"z"), "CTRL", "ShuntMode.true", 1); if (pu<3) lg="m14z", jm="z1", PostMessage(Router.GetGameObject("m2z"), "CTRL", "ShuntMode.true", 5); else lg="mz", jm="z5"; PostMessage(Router.GetGameObject(lg), "CTRL", "ShuntMode.true", 3); dsp="s8"; DSP3Thread(); // едем за разворотную стрелку text=strTable.GetString("w18")+jm; var=18; Window(); SoundThread(); Interface.Print ("wait Junction "+jm); OnJunction(Mytrain,jm,4); Interface.Print ("Junction "+jm+" OK"); br.SetWindowVisible(false); pu=it; Sleep(15); puin=pu; JunThread(); if (jm=="z1") PostMessage(Router.GetGameObject("c2ez"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m8z"), "CTRL", "ShuntMode.true", 6); if (pu==3) lg="m16z"; else lg="m18z"; PostMessage(Router.GetGameObject(lg), "CTRL", "ShuntMode.true", 7); Sleep(7); text=strTable.GetString("w21"); var=18; Window(); dsp="s2"; DSP3Thread(); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep (30); // сцепились puout=2; puin=2; JunThread(); one=Mytrain.GetVehicles()[1]; two=Mytrain.GetVehicles()[2]; one.Uncouple(two); Mytrain=one.GetMyTrain(); train0=two.GetMyTrain(); train0.SetHandBrake(true); text=strTable.GetString("w12"); var=18; Window(); // отцепились Sleep (40); PostMessage(Router.GetGameObject(pu+"z"), "CTRL", "ShuntMode.true", 3); Sleep (4); text=strTable.GetString("w18")+"z5"; var=18; Window(); dsp="s9"; DSP3Thread(); // поехали за разворотную стрелку Interface.Print ("wait Junction z5"); OnJunction(Mytrain,"z5",4); Interface.Print ("Junction z5 OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(5); ChangeJunc("z5", 0); oknotext=""+HTMLWindow.StartTable(); // теперь меняем кабину oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сменили кабину ChangeJunc("z77", 0); Sleep(5); dsp="s8"; DSP3Thread(); text=strTable.GetString("w18")+"z2"; var=18; Window(); PostMessage(Router.GetGameObject("2zc"), "CTRL", "ShuntMode.true", 30); PostMessage(Router.GetGameObject("m16z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m30z"), "CTRL", "ShuntMode.true", 6); PostMessage(Router.GetGameObject("m45z"), "CTRL", "ShuntMode.true", 31); Interface.Print ("wait Junction z2"); OnJunction(Mytrain,"z2",4); Interface.Print ("Junction z2 OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); Sleep(15); puout=pu; JunThread(); PostMessage(Router.GetGameObject("m43z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 3); if (pu==3) lg="m67z"; else if (pu==4) lg="m65z"; else {lg="m57z"; PostMessage(Router.GetGameObject("m63z"), "CTRL", "ShuntMode.true", 6);} PostMessage(Router.GetGameObject(lg), "CTRL", "ShuntMode.true", 3); dsp="s2"; DSP3Thread();; text=strTable.GetString("w21"); var=18; Window(); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); Sleep (30); // сцепились Mytrain.SetTrainPriorityNumber(2); Sleep(60); } if (np==869) npw=870; else if (np==615) npw=616; else npw=np; if (pr==2) speed=80; if (ii==0) junout="e7"; else if (nap==true) junout=jun[ii]+"1"; else junout=jun[ii]+"2"; t98h [7]= 9; t98h [6]= 9; t98h [5]= 9; t98h [4]= 10; t98h [3]= 10; t98h [2]= 10; t98h [1]= 11; t98h [0]= 12; t98m [7]= 15; t98m [6]= 40; t98m [5]= 58; t98m [4]= 16; t98m [3]= 16; t98m [2]= 51; t98m [1]= 15; t98m [0]= 30; t97h [6]= 21; t97h [5]= 21; t97h [4]= 21; t97h [3]= 20; t97h [2]= 20; t97h [1]= 20; t97h [0]= 19; t97m [6]= 41; t97m [5]= 41; t97m [4]= 10; t97m [3]= 54; t97m [2]= 39; t97m [1]= 20; t97m [0]= 50; t869h [0]= 21; t869h [5]= 23; t869h [2]= 22; t869m [0]= 47; t869m [5]= 5; t869m [2]= 24; t870h [7]= 6; t870h [5]= 6; t870h [3]= 6; t870h [2]= 7; t870h [0]= 7; t870m [7]= 0; t870m [5]= 26; t870m [3]= 51; t870m [2]= 5; t870m [0]= 40; t616h [1]= 4; t616h [2]= 5; t616h [3]= 5; t616h [4]= 5; t616h [5]= 5; t616h [6]= 6; t616h [0]= 4; t616m [1]= 29; t616m [2]= 2; t616m [3]= 18; t616m [4]= 40; t616m [5]= 58; t616m [6]= 18; t616m [0]= 5; t615h [1]= 15; t615h [2]= 14; t615h [3]= 14; t615h [4]= 14; t615h [5]= 13; t615h [6]= 13; t615h [7]= 13; t615h [0]= 16; t615m [1]= 27; t615m [2]= 55; t615m [3]= 36; t615m [4]= 16; t615m [5]= 58; t615m [6]= 43; t615m [7]= 20; t615m [0]= 0; t6743h [1]= 9; t6743h [2]= 10; t6743h [3]= 10; t6743h [4]= 10; t6743h [5]= 11; t6743h [6]= 11; t6743h [0]= 9; t6743m [1]= 38; t6743m [2]= 13; t6743m [3]= 33; t6743m [4]= 53; t6743m [5]= 11; t6743m [6]= 26; t6743m [0]= 8; t6745h [1]= 17; t6745h [2]= 17; t6745h [3]= 18; t6745h [4]= 18; t6745h [5]= 18; t6745h [6]= 19; t6745h [0]= 16; t6745m [1]= 13; t6745m [2]= 51; t6745m [3]= 13; t6745m [4]= 34; t6745m [5]= 52; t6745m [6]= 7; t6745m [0]= 47; if (pr==1) ZeroThread(); else {okno=false, oknotext=""; br.LoadHTMLString(oknotext); br.SetWindowVisible(false);} while(ii!=im) { //--------------------- этот блок работает при выезде со станции----------------------------------- if (np==97) iHours=t97h[ii], iMins=t97m[ii]; else if (np==98) iHours=t98h[ii], iMins=t98m[ii]; else if (np==869) iHours=t869h[ii], iMins=t869m[ii]; else if (np==870) iHours=t870h[ii], iMins=t870m[ii]; else if (np==615) iHours=t615h[ii], iMins=t615m[ii]; else if (np==616) iHours=t616h[ii], iMins=t616m[ii]; else if (np==6743) iHours=t6743h[ii], iMins=t6743m[ii]; else if (np==6744) iHours=t6744h[ii], iMins=t6744m[ii]; else if (np==6745) iHours=t6745h[ii], iMins=t6745m[ii]; else if (np==6746) iHours=t6746h[ii], iMins=t6746m[ii]; if (np==97 and (ii==3 or ii==4)) speed=80; else if (np==97) speed=60; if (okno==true) { if (ii==6) side=nap; else if (nap==false) side=true; else side=false; if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); if (ii==st) Flash(); Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep(2); if (np==869 or np==870) is=0; else is=lk+1; if (is) DoorsThread(Mytrain,is,true); Sleep(1); if (puout!=pu and vstr==true) {text=strTable.GetString("w26"); var=18; Window(); while (puout!=pu) Sleep(1);} if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); Interface.Print ("wait time="+iHours+"."+iMins); if (iHours==12 and iMins==0) iHours=11, iMins=59, iSecs=50; else if (ii==st) --iMins, iSecs=45; else iSecs=0; time=World.GetGameTime (); // сравниваем время if (iHours < 12) fTime = 0.5 + (iHours / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); else fTime = ((iHours - 12) / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); if (time<(fTime-0.5)) fTime=fTime+0.5; while(time6) tt=0; else tt=4; if (ii==0) junout="e7"; else if (ii==7 and nap==false) junout="z120"; else if (nap==true) junout=jun[ii]+"1"; else junout=jun[ii]+"2"; Interface.Print ("wait Junction "+junout+", "+tt); OnJunction(Mytrain,junout,tt); Interface.Print ("Junction "+junout+" OK"); del=true; DelThread(); while (del==true) Sleep(1); if (np==97 and ii==1) World.DeleteTrain(trainout); // удаляем поезда if (man==true) World.DeleteTrain(train3), man=false; if (ii<7) {puin=stang [ii], puout=stang[ii]; JunThread(); Sleep(7);} // возвращаем стрелки на проход по главному for (it=1; it<13; ++it) stand[it]=true; // освобождаем ячейки путей if (nap==true) ++ii; else --ii; // теперь обрабатываем следующую станцию if (stantup[ii]>0) { // сначала тупики sostav=new KUID[0]; if (stantup[ii]>1) it=Math.Rand(1,stantup[ii]); else it=1; if (ii==2 or (ii==8 and it==2)) for (is=0; is2) {CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: traint1=loko0.GetMyTrain();} traint1.SetHandBrake(true);} } // теперь отстой if (ii==2) { sostav=new KUID[0]; for (is=0; is5) { sostav=new KUID[0]; for (is=0; is3 and ii!=0 and Math.Rand(0,10)<5) poput=true; // вероятность попутного (для обгона грузового) else if (np==6746 and ii==0) poput=true, vstr=false, vstr2=false; if (ii==7 and nap==false) poput=false; if (ii>7) vstr=false, vstr2=false; else if ((okno==false and pr==1) or (np==98 and ii==0) or np==870) vstr=false; else if (vstr==true and prvs==1) vstr2=false; // запретили встречные if (np==615 and ii==0) pu=1; else if (ii==8) pu=3; else if (ii==0 and np==870) pu=2; // если поезд пассажирский (кроме Владиславовки) - на первый путь, a груз - главный else if (pr==1 and (okno==true or ii==im)) pu=1; else if (ii==7 and ii==im) pu=Math.Rand(3,7); else pu=stang[ii], prvs=2; stand[pu]=false; if (vstr==true and pr==2 and ii!=7 and Math.Rand(0,10)<6) prvs=1; else if (ii==0 and np==6746) pupop=2, pu=3, puvs=1; if (vstr==true or vstr2==true) { // если есть встречные - задаём пути приёма для них if ((np==870 and ii==6) or (np==98 and ii==3) or (np==97 and ii==5)) puvsw=1; else if (prvsw==1) puvsw=2; else if (vstr==false and pr==1 and okno==true) puvsw=stang[ii]; else puvsw=stanput[ii]; pupop=stanput[ii]; if (vstr2==false and pr==1 and (prvs==2 or np==6744)) puvs=stang[ii]; else if (np==616 and ii==6) puvs=3, vstr2=false; else if (pr==2 and prvs==1) puvs=1; else if (prvs==1 and pr==2) puvs=1; else if (prvs==1) puvs=2; else if (ii==0 and pr==1) puvs=2; else puvs=stanput[ii]; if (ii==0) { if (pr==2 or np==98) pu=2; if (np!=98) puvsw=Math.Rand(4,7); if (vstr2==true) {while (stand[puvsw]==false) puvsw=Math.Rand(4,7); stand[puvsw]=false;} else puvsw=0; if (poput==true) {pupop=Math.Rand(4,10); while (stand[pupop]==false) pupop=Math.Rand(4,10);} else pupop=0; } else if (ii==3) { if (pu==1) puvs=2, puvsw=2; else puvs=1, puvsw=1;} else if (ii==7) { if (im==7 and pr==2) {puvs=2; while (stand[pu]==false) pu=Math.Rand(3,7); stand[pu]=false;} if (vstr2==true) {while (puvsw>1 and stand[puvsw]==false) --puvsw; stand[puvsw]=false;} if (vstr==true) {while (puvs>1 and stand[puvs]==false) --puvs; stand[puvs]=false;} if (puvs==1) poput=false; else if (poput==true) while (stand[pupop]==false) --pupop; } else if (ii==9) { if (vstr2==true) {while (puvsw>1 and stand[puvsw]==false) --puvsw; stand[puvsw]=false;} else puvsw=0; if (poput==true) while (pupop>1 and stand[pupop]==false) --pupop; else pupop=0; } else { if (vstr2==true) {while (puvsw>1 and stand[puvsw]==false) --puvsw; stand[puvsw]=false;} else puvsw=0; if (vstr==true) {while (puvs>1 and stand[puvs]==false) --puvs; stand[puvs]=false;} else puvs=0; if (poput==true) {if (puvs==1) poput=false; else while (stand[pupop]==false) --pupop;} else pupop=0; } } if (puvs==pu and prvs==2) vstr=false; if (puvsw==0) vstr2=false; if (pupop<=0) poput=false; // маленький предохранитель от ошибки if (pr==2 and vstr==true and ii!=im and prvs==2){ // для разнoобразия меняем местами пути if (vstr2==true and Math.Rand(0,10)>5) tt=puvs, puvs=puvsw, puvsw=tt; if (stanput[ii]>2 and Math.Rand(0,10)>5) tt=pu, pu=puvs, puvs=tt; } else if (pr==1 and vstr==true and ii!=im) { if (vstr2==true and Math.Rand(0,10)>5 and prvs==2 and prvsw==2) tt=puvs, puvs=puvsw, puvsw=tt; if (poput==true and Math.Rand(0,10)>5) tt=pupop, pupop=puvsw, puvsw=tt; } puin=pu; if (vstr==true) puout=puvs; else if (ii==7 and im==7) puout=2; else if (ii==8) puout=1; else if (np==98 and ii==0) puout=3, puvsw=0; else if (np==6746 and ii==0) puout=8; else puout=pu; JunThread(); // если нет встречного - номер пути на выход тот же, что и на вход if (poput==true and ii!=im and Math.Rand(0,10)>7) order=true; else order=false; // вероятность того, что попутный нас обгонит // открываем входной светофор if (ii==0) PostMessage(Router.GetGameObject("c0e"), "CTRL", "MayOpen^true", 15); else if (nap==true) PostMessage(Router.GetGameObject("n"+jun[ii]), "CTRL", "MayOpen^true", 15); else PostMessage(Router.GetGameObject("c"+jun[ii]), "CTRL", "MayOpen^true", 15); if (nap==false and ii==7) PostMessage(Router.GetGameObject("c2ez"), "CTRL", "MayOpen^true", 12); else if (ii==7) {PostMessage(Router.GetGameObject("n20z"), "CTRL", "MayOpen^true", 11); PostMessage(Router.GetGameObject("n02z"), "CTRL", "MayOpen^true", 10);} //---------------------------------это блок встречных поездов------------------------------------- Sleep(2); Interface.Print ("ii="+ii+", pu="+pu+", pupop="+pupop+", junout="+junout+", junin="+junin); if (vstr==true) { // первый встречный if (ii==0) mark="SF1"; else if (nap==true) mark="S"+stan[ii+1]+stang[ii+1]*2; else mark="S"+stan[ii-1]+(stang[ii-1]*2-1); sostav=new KUID[0]; is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is), sostav[1]=GetAsset().LookupKUIDTable(is+1); if (np==616 and prvs==1) sostav[0]=GetAsset().LookupKUIDTable(195), sostav[1]=GetAsset().LookupKUIDTable(196), sostav[2]=GetAsset().LookupKUIDTable(197); else if ((np==6743 and ii==3) or (np==6744 and ii==5)) for (is=2; is<15; ++is) {sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(203,208));} else if (prvs==1) for (is=2; is<7; ++is) {sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(200,205));} // встречные пригородные else { sostavsize=38; its=0; tt=Math.Rand(1,10); // длина двухсекционного локомотива for (is=2; is<65; ++is) { sostavsize=sostavsize+its; if (sostavsize>leng[ii]) break; // если длина состава превысит длину путей станции, больше вагонов не добавляем if (ii==5 and (puvs==1 or puvs==2) and sostavsize>750) break; if (tt==1) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28)), its=13; else if (tt==2) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(38,46)), its=15; else if (tt==3) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(46,50)), its=12; else if (tt==4) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(50,66)), its=15; else if (tt==5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(79,86)), its=15; else if (tt==6) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(90,92)), its=15; else if (tt==7) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(92,106)), its=15; else if (tt==8) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(106,116)), its=19; else sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(123,128)), its=25; } } CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.SetTrainPriorityNumber(prvs); dcl[2].SetLocation(train1.GetFrontmostLocomotive()); TrainThread(); if (np==616 and prvs==1) train1.GetVehicles()[2].Reverse(); else train1.GetVehicles()[1].Reverse(); sig = GetNextSignal(train1.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",2); // выходной светофор со станции отправления встречного if (nap==true) PostMessage(Router.GetGameObject("c"+jun[ii]), "CTRL", "MayOpen^true",30); // входной светофор нашей станции else PostMessage(Router.GetGameObject("n"+jun[ii]), "CTRL", "MayOpen^true",30); Sleep(1); if (nap==true) { if (ii==7) PostMessage(Router.GetGameObject("c2ez"), "CTRL", "MayOpen^true",10); else if (ii==6) {PostMessage(Router.GetGameObject("c2z"), "CTRL", "MayOpen^true",30); PostMessage(Router.GetGameObject("c20z"), "CTRL", "MayOpen^true",20);} } else if (ii==7) {PostMessage(Router.GetGameObject("n02z"), "CTRL", "MayOpen^true",30); PostMessage(Router.GetGameObject("n20z"), "CTRL", "MayOpen^true",20);} Interface.Print ("vstrech on "+mark+" "+is+" vag"); train1Schedule = new Schedule(); if (nap==true) lg="T"+stan[ii]+puvs*2+"C"; else lg="T"+stan[ii]+(puvs*2-1)+"C"; if (pr==2 and prvs==1) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,10);} else if (np==869 and ii==2) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,630);} else if (prvs==1 and ii==2) {train1Schedule.StopAtTrigger(lg,120); train1.RunSchedule(train1Schedule,false,60);} } if (vstr2==true) { // второй встречный sostav=new KUID[0]; Sleep(5); if (nap==true) mark="S"+stan[ii]+(puvsw*2); else mark="S"+stan[ii]+(puvsw*2-1); if (prvsw==1 and np!=870) mark=mark+"C"; if (np==98 and ii==0) mark="SE6C"; is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); if (np==6744 and ii==2) sostav[0]=GetAsset().LookupKUIDTable(195), sostav[1]=GetAsset().LookupKUIDTable(196), sostav[2]=GetAsset().LookupKUIDTable(197); else if (prvsw==1) for (is=2; is<8; ++is) {sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(200,205));} // встречные пригородные else { sostavsize=38; tt=Math.Rand(1,10); for (is=2; isleng[ii]) break; if (ii==5 and (puvsw==1 or puvsw==2) and sostavsize>750) break; if (tt==1) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28)), its=13; else if (tt==2) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(38,46)), its=15; else if (tt==3) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(46,50)), its=12; else if (tt==4) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(92,106)), its=15; else if (tt==5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(50,66)), its=15; else if (tt==6) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(79,86)), its=15; else if (tt==7) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(88,90)), its=15; else if (tt==8) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(106,116)), its=19; else sostav[is]=GetAsset().LookupKUIDTable(88), its=15; sostavsize=sostavsize+its; } } CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train2=loko0.GetMyTrain();} if (np==6744 and ii==2) train2.GetVehicles()[2].Reverse(); else train2.GetVehicles()[1].Reverse(); dcl[1].SetLocation(train2.GetFrontmostLocomotive()); train2.SetHeadlightState(true); train2.SetTrainPriorityNumber(prvsw); Interface.Print ("vstrech 2 on "+mark+" "+is+" vag"); sig = GetNextSignal(train2.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); // Отрываем выходной светофор } if (poput==true) { // попутный sostav=new KUID[0]; Sleep (5); if (nap==true) mark="S"+stan[ii-1]+(stang[ii-1]*2-1); else mark="S"+stan[ii+1]+(stang[ii+1]*2); is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); if (np==6746 and ii==0) for (is=2; is<13; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(205,211)); else {itt=Math.Rand(0,10); Sleep(5); for (is=2; is<40; ++is) { if (itt>5) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(117,123)); else sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(28,38)); } } CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: train3=loko0.GetMyTrain();} train3.SetTrainPriorityNumber(1); dcl[1].SetLocation(train3.GetFrontmostLocomotive()); train3.GetVehicles()[1].Reverse(); train3.SetHeadlightState(false); Interface.Print ("poputn on "+mark+", order="+order); sig = GetNextSignal(train3.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); if (pr==2) train3.SetAutopilotMode(2); else {train1Schedule = new Schedule(); train1Schedule.StopAtTrigger("TE4C",10); train3.RunSchedule(train1Schedule,false,1360);} } if (np==6746 and ii==0) { // поезд 6758 для фона sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(0); sostav[1]=GetAsset().LookupKUIDTable(214); sostav[2]=GetAsset().LookupKUIDTable(213); sostav[3]=GetAsset().LookupKUIDTable(214); vstr=true; CreateTrain("SD6C"); wait() {on "CreateTrain", "ok", msg: train1=loko0.GetMyTrain();} train1.SetTrainPriorityNumber(1); dcl[3].SetLocation(train1.GetFrontmostLocomotive()); Interface.Print ("6758 OK"); sig = GetNextSignal(train1.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); } //------------------------------этот блок работает при въезде на станцию-------------------- if (nap==false and ii==7) lgz=pu+"zc"; else if (nap==true) lgz="n"+pu+jun[ii], lgp="n"+pupop+jun[ii]; else lgz="c"+pu+jun[ii], lgp="c"+pupop+jun[ii]; if (ii==0) trig="TENCHK"; Interface.Print ("wait sound on Trigger "+trig); // это триггер сообщения дежурного на вход OnTrigger(Mytrain,trig,0); if (ii==7) SoundThread(); glav=stang[ii]; DSP2Thread(); if ((np==616 and ii==6) or (np==6743 and ii==3) or (np==6744 and ii==5)) train1.SetAutopilotMode(2); else if (ii==8) train3.SetAutopilotMode(2); // запускаем маневровый в Керчь-завод для прицепки к 3440-му if (ii==0 and pr==2) PostMessage(Router.GetGameObject("c2e"), "CTRL", "MayOpen^true", 10); else if (vstr==true or vstr2==true) { // если есть встречныe, после проезда нами входной стрелки им соберётся маршрут на выход // если встречный один - собираем себе выходной маршрут if (vstr==false and ii!=im) {puout=pu; JunThread(); PostMessage(Router.GetGameObject(lgz), "CTRL", "MayOpen^true", 15);} Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); if (np==98 and ii==0) br.SetWindowVisible(false); Interface.Print ("Junction "+junin+" OK"); if (!okno) Flash(); Sleep(15); // задержка для проезда всех входных стрелок if (np==6743 and ii==2) {train1Schedule = new Schedule(); train1Schedule.DriveForever(); train2.RunSchedule(train1Schedule,false,140);} if (poput==true) { puin=pupop; br.SetWindowVisible(false); JunThread(); // входной светофор для попутного if (nap==true) junin=jun[ii]+"2"; else junin=jun[ii]+"1"; if (nap==true) {PostMessage(Router.GetGameObject("n"+jun[ii]), "CTRL", "MayOpen^true", 5); lg="n"+pupop+jun[ii];} else {PostMessage(Router.GetGameObject("c"+jun[ii]), "CTRL", "MayOpen^true", 5); lg="c"+pupop+jun[ii];} if (ii==7) {PostMessage(Router.GetGameObject("n20z"), "CTRL", "MayOpen^true", 11); PostMessage(Router.GetGameObject("n02z"), "CTRL", "MayOpen^true", 10);} if (order==true){ Interface.Print ("wait poput on Junction "+junin); OnJunction(train3,junin,4); Sleep(20); Interface.Print ("poput on Junction "+junin+" OK"); } } // на выход встречному2 собираем маршрут if (vstr2==true and (poput==false or (poput==true and order==true))) { puin=puvsw; JunThread(); sig=GetNextSignal(train2.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",3); if (prvsw==2 or (np==6744 and ii==2)) Sleep(10), train2.SoundHorn(), train2.SetAutopilotMode(2); } else if (poput==false or (poput==true and order==true)) {puin=puvs; JunThread();} // выгоняем встречный со станции if (ii!=7) { if (nap==true) PostMessage(Router.GetGameObject("c"+puin+jun[ii]), "CTRL", "MayOpen^true", 5); else if (np==6746 and ii==0) Sleep(1); else PostMessage(Router.GetGameObject("n"+puin+jun[ii]), "CTRL", "MayOpen^true", 5); } else { if (nap==true) PostMessage(Router.GetGameObject(pu+"zc"), "CTRL", "MayOpen^true", 5); else PostMessage(Router.GetGameObject(pu+"z"), "CTRL", "MayOpen^true", 5); } } else if (ii==8) { // прицепка в Керчь-заводе junin="n7"; Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(20); ChangeJunc("n1", 2); Sleep(20); one1=Mytrain.GetVehicles()[1]; two1=Mytrain.GetVehicles()[2]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); PostMessage(Router.GetGameObject("3nc"), "CTRL", "ShuntMode.true", 10); text=strTable.GetString("w10"); var=18; Window(); junin="n6"; dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); br.SetWindowVisible(false); text=strTable.GetString("w26"); var=18; Window(); Flash(); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); train3.SetAutopilotMode(0); Schedule Train1Schedule = new Schedule(); Train1Schedule.CoupleVehicle(two1); train3.RunSchedule(Train1Schedule,false,30); // задаём команды маневровому локу ChangeJunc("n6", 2); PostMessage(Router.GetGameObject("m4n"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m14n"), "CTRL", "ShuntMode.true", 2); Sleep(200); while (!train3.IsStopped()) Sleep(60); train3.Turnaround(); one2=train3.GetVehicles()[0]; two2=train3.GetVehicles()[1]; one2.Uncouple(two2); train3=one2.GetMyTrain(); train0=two2.GetMyTrain(); train0.SetHandBrake(true); Sleep(30); PostMessage(Router.GetGameObject("3n"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("n3n"), "CTRL", "ShuntMode.true", 6); PostMessage(Router.GetGameObject("m11n"), "CTRL", "ShuntMode.true", 8); Sleep(10); train3.SetAutopilotMode(2); Sleep(10); ChangeJunc("n6", 0); text=strTable.GetString("w21"); var=18; Window(); dsp="s2"; DSP3Thread(); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train0.SetDecouplingMask(Vehicle.COUPLE_BOTH); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train0); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (10); Sleep(20); man=true; PostMessage(Router.GetGameObject("3nc"), "CTRL", "MayOpen^true",25); PostMessage(Router.GetGameObject("cz"), "CTRL", "MayOpen^true",24); puout=pu; JunThread(); Sleep(30); World.Play2DSound(SCN_prs,"2d3.wav"); PostMessage(Router.GetGameObject("c2ez"), "CTRL", "MayOpen^true",22); } // открываем выходные светофоры себе else {Interface.Print ("lgz="+lgz); if (puout==pu) PostMessage(Router.GetGameObject(lgz), "CTRL", "MayOpen^true", 15);} if (puvsw==4 and puin==4) World.Play2DSound(SCN_dir,"ob_na_vokz_146.wav"); } // конец цикла ii Interface.Print ("cycle ii the end"); if (vstr2==true and poput==false and np!=98) Sleep(1), train2.SoundHorn(), train2.SetAutopilotMode(2); if (np==98){ // будем цеплять 212 к 98-му br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); text=strTable.GetString("w26"); var=18; Window(); puout=3; JunThread(); ChangeJunc("e15", 0); ChangeJunc("e3", 2); PostMessage(Router.GetGameObject("c3e"), "CTRL", "MayOpen^true",20); pr=3; Interface.Print ("wait time 11.35"); while(time<0.98264) {time=World.GetGameTime(); Sleep(0.1);} dsp="3d4"; DSP3Thread(); Sleep(10), train2.SoundHorn(), train2.SetAutopilotMode(2); // отправили 6746 Sleep(15); one1=Mytrain.GetVehicles()[lk]; two1=Mytrain.GetVehicles()[lk+1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train0=two1.GetMyTrain(); train0.SetHandBrake(true); train0.Turnaround(); text=strTable.GetString("w5"); var=18; Window(); Flash(); Sleep (100); PostMessage(Router.GetGameObject("c3d"), "CTRL", "MayOpen^true",1); PostMessage(Router.GetGameObject("ce"), "CTRL", "MayOpen^true",0); Schedule train1Schedule = new Schedule(); train1Schedule.StopAtTrigger("TE6C",10); train3.RunSchedule(train1Schedule,false,60); // запустили 212-й dsp="3b5"; DSP3Thread(); Interface.Print ("wait train3 on Junction e15"); OnJunction(train3,"e15",0); Interface.Print ("Junction e15 OK"); World.Play2DSound(SCN_dir,"ob_na_vokz_51.wav"); Sleep (60); ChangeJunc("e15", 2); PostMessage(Router.GetGameObject("n1e"), "CTRL", "MayOpen^true",20); PostMessage(Router.GetGameObject("nd"), "CTRL", "MayOpen^true",10); Interface.Print ("wait while 212 is stopped"); while (!train3.IsStopped()) Sleep(20); train3.SetTrainPriorityNumber(3); // ждём прибытия 212-го Interface.Print ("wait time 11.45"); while(time<0.98958) {time=World.GetGameTime(); Sleep(0.1);} World.Play2DSound(SCN_dir,"ob_na_vokz_28.wav"); Sleep(10); dsp="1d1"; DSP3Thread(); train1.SoundHorn(); train1.SetAutopilotMode(2); Sleep (80); // отправили 6758 one=train3.GetVehicles()[0]; two=train3.GetVehicles()[1]; one.Uncouple(two); train3=one.GetMyTrain(); trainout=two.GetMyTrain(); trainout.SetHandBrake(true); trainout.Turnaround(); // расцепили 212 ChangeJunc("e4", 2); ChangeJunc("e22", 0); ChangeJunc("e3", 0); PostMessage(Router.GetGameObject("m11e"), "CTRL", "ShuntMode.true",1); PostMessage(Router.GetGameObject("c3e"), "CTRL", "ShuntMode.true",1); Sleep (3); train3.SoundHorn(); // ЧМЭ3 готов к манёврам train0.SetCouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); trainout.SetCouplingMask(Vehicle.COUPLE_BOTH); Schedule Sched212 = new Schedule(); // задаём команды маневровому локу Sched212.StopAtTrigger("TE24",10); Sched212.ReverseTrain(); Sched212.StopTrain(35); //Sched212.TakeJunction ("e4", 0); Sched212.StopAtTrigger("AG1",5); Sched212.ReverseTrain(); Sched212.StopTrain(5); Sched212.CoupleVehicle(two1); Sched212.StopAtTrigger("TE4C",1); Sched212.ReverseTrain(); Sched212.StopTrain(30); Sched212.StopAtTrigger("AG3",1); Sched212.ReverseTrain(); Sched212.StopTrain(12); Sched212.CoupleVehicle(two); Sched212.StopAtTrigger("TE6C",10); train3.RunSchedule(Sched212,false,1); // запускаем манёвры Interface.Print ("wait train3 on Junction e22"); OnJunction(train3,"e22",4); Interface.Print ("Junction e22 OK"); Sleep(30); ChangeJunc("e4", 0); PostMessage(Router.GetGameObject("m1e"), "CTRL", "ShuntMode.true",5); PostMessage(Router.GetGameObject("m9e"), "CTRL", "ShuntMode.true",6); // заново создаём фоновые поезда veh0=train1.GetVehicles(); for (is=0; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); ChangeJunc("z55", 2); ChangeJunc("z11", 2); ChangeJunc("z21", 2); PostMessage(Router.GetGameObject("m18z"), "CTRL", "ShuntMode.true", 6); if (pu==3) ChangeJunc("z5", 2); // депо Керчь dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); Sleep(10); text=strTable.GetString("w7"); var=18; Window(); dsp="s6"; DSP3Thread(); Interface.Print ("wait Junstion z67"); OnJunction(Mytrain,"z67",Navigate.JUNCTION_LEAVE); text=strTable.GetString("w13"); var=1; Window(); } else if (pr==1) { if (vstr==false and vstr2==false) {Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4);Interface.Print ("Junction "+junin+" OK");} text=strTable.GetString("w19"); var=0; Window(); } Interface.Print ("wait stop"); while (!Mytrain.IsStopped()) Sleep(5); } // конец раздела 2 if (razd==4) { //-------------------------------это раздел Крым - Керчь Южная-------------------------- int [] t6729h = new int [4]; t6729h [2]= 5; t6729h [3]= 5; int [] t6729m = new int [4]; t6729m [2]= 15; t6729m [3]= 33; int [] t6732h = new int [5]; t6732h [4]= 6; t6732h [3]= 7; t6732h [2]= 7; int [] t6732m = new int [5]; t6732m [4]= 40; t6732m [3]= 21; t6732m [2]= 40; int [] t6733h = new int [5]; t6733h [1]= 8; t6733h [2]= 8; t6733h [3]= 9; int [] t6733m = new int [5]; t6733m [1]= 25; t6733m [2]= 53; t6733m [3]= 11; int [] t6736h = new int [5]; t6736h [4]= 10; t6736h [3]= 10; int [] t6736m = new int [5]; t6736m [4]= 10; t6736m [3]= 52; int [] t6735h = new int [4]; t6735h [2]= 17; t6735h [3]= 17; int [] t6735m = new int [4]; t6735m [2]= 5; t6735m [3]= 23; int [] t6738h = new int [5]; t6738h [4]= 18; t6738h [3]= 19; t6738h [2]= 19; int [] t6738m = new int [5]; t6738m [4]= 20; t6738m [3]= 2; t6738m [2]= 20; int [] t6739h = new int [5]; t6739h [1]= 20; t6739h [2]= 20; t6739h [3]= 20; int [] t6739m = new int [5]; t6739m [1]= 4; t6739m [2]= 30; t6739m [3]= 44; int [] t6742h = new int [5]; t6742h [4]= 21; t6742h [3]= 22; int [] t6742m = new int [5]; t6742m [4]= 45; t6742m [3]= 27; string [] stank = new string [0]; stank [4]="R"; stank [3]="N"; stank [2]="Z"; stank [1]="M"; stank [0]= "X"; string [] junk = new string [0]; junk [4]="r"; junk [3]="n"; junk [2]="z"; junk [1]="m"; junk [0]="x"; //-------------------------------создаём наш поезд-------------------------------------- pu=11; ii=st; sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(0); sostav[1]=GetAsset().LookupKUIDTable(204), sostav[2]=GetAsset().LookupKUIDTable(204); Mytrain=World.CreateTrain(sostav,"STZ6729",true); Mytrain.SetTrainPriorityNumber(1); dcl[3].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив ProductThread(Mytrain,1,true); Sleep(2); Interface.Print ("sostav "+np+" OK"); //-----------------------------создаём недвижимость------------------------------------ // заполняем тупики Керчи for (it=5; it<9; ++it) { sostav=new KUID[0]; for (is=0; is5) { // отстой Керчь Южная sostav=new KUID[0]; for (is=0; is5) { // отстой Керчь Завод sostav=new KUID[0]; for (is=0; is5) it=1; else it=2; mark="STN"+it; traint1=World.CreateTrain(sostav,mark,true); Sleep (0.1); traint1.SetHandBrake(true); } if (Math.Rand(0,10)>4) { // отстой Крым sostav=new KUID[0]; for (is=0; is5) mark=mark+"C"; Interface.Print ("sostav on "+mark); traint=World.CreateTrain(sostav,mark,true); Sleep (0.1); traint.SetHandBrake(true); traint.EnablePhysics(false); } // ------------------------начинается работа цикла движения---------------------------------------- junout="z3"; ZeroThread(); while(ii!=im) { if (np==6732 and ii<3) npw=6731; else if (np==6733 and ii>1) npw=6734; else if (np==6738 and ii<3) npw=6737; else if (np==6739 and ii>1) npw=6740; else npw=np; if (ii==2) SoundThread(); if (nap==true) lgz="1"+junk[ii]; else lgz="1"+junk[ii]+"c"; //--------------------- этот блок работает при выезде со станции----------------------------------- if (np==6729) iHours=t6729h[ii], iMins=t6729m[ii]; else if (np==6732) iHours=t6732h[ii], iMins=t6732m[ii]; else if (np==6733) iHours=t6733h[ii], iMins=t6733m[ii]; else if (np==6736) iHours=t6736h[ii], iMins=t6736m[ii]; else if (np==6735) iHours=t6735h[ii], iMins=t6735m[ii]; else if (np==6738) iHours=t6738h[ii], iMins=t6738m[ii]; else if (np==6739) iHours=t6739h[ii], iMins=t6739m[ii]; else if (np==6742) iHours=t6742h[ii], iMins=t6742m[ii]; if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); // сравниваем время time=World.GetGameTime (); Interface.Print ("wait time="+iHours+"."+iMins); if (ii==st or puout!=pu) --iMins, iSecs=35; else iSecs=0; if (iHours < 12) fTime = 0.5 + (iHours / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); else fTime = ((iHours - 12) / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); if (time<(fTime-0.5)) fTime=fTime+0.5; while(time7) { // вероятность встречного sostav=new KUID[0]; is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); if (ii<2) for (is=2; is<20; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(117,123)); else for (is=2; is<45; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,28)); vstr=true; puvs=2; if (ii==2 and nap==false) mark="SW5"; else if (ii==1 and nap==true) mark="SZ2"; else if (ii==3 and nap==true) mark="SR2", ChangeJunc("r2", 2), ChangeJunc("r4", 2); else if (nap==true) mark="S"+stank[ii+1]+4; else mark="S"+stank[ii-1]+3; Interface.Print ("vstrech on "+mark+" "+is+" vag"); CreateTrain(mark); wait() {on "CreateTrain", "ok", msg: break;} train1=loko0.GetMyTrain(); train1.SetTrainPriorityNumber(2); dcl[2].SetLocation(train1.GetFrontmostLocomotive()); train1.GetVehicles()[1].Reverse(); Sleep(Math.Rand(1,15)); if (mark=="SW5") puout=pu; else {puout=puvs; TrainThread();} if ((ii==3 and nap==false) or (nap==true and ii==2)) Sleep(1); else train1.SetAutopilotMode(2); sig = GetNextSignal(train1.GetVehicles()[0]); PostMessage(sig,"CTRL","MayOpen^true",1); // Открываем выходной светофор встречному if (nap==false and ii==3) PostMessage(Router.GetGameObject("0z"), "CTRL", "MayOpen^true",30); PostMessage(Router.GetGameObject(lgw), "CTRL", "MayOpen^true",10); // входной светофор нашей станции для встречного if (ii==2) { // светофоры Керчи if (nap==false) { PostMessage(Router.GetGameObject("n20z"), "CTRL", "MayOpen^true",29); PostMessage(Router.GetGameObject("n02z"), "CTRL", "MayOpen^true",28); } else { PostMessage(Router.GetGameObject("c2ez"), "CTRL", "MayOpen^true",12); Interface.Print ("Signal c2e OK"); PostMessage(Router.GetGameObject("2zc"), "CTRL", "MayOpen^true",9); } } } else if (ii!=im) { // выходной светофор следующей станции для нас puout=pu; if (ii==2) { if (nap==false) { PostMessage(Router.GetGameObject("1zc"), "CTRL", "MayOpen^true",15); PostMessage(Router.GetGameObject("c10z"), "CTRL", "MayOpen^true",13); PostMessage(Router.GetGameObject("c1z"), "CTRL", "MayOpen^true",12); } else {PostMessage(Router.GetGameObject("0z"), "CTRL", "MayOpen^true",19); PostMessage(Router.GetGameObject("1z"), "CTRL", "MayOpen^true",20);} } else PostMessage(Router.GetGameObject(lgz), "CTRL", "MayOpen^true",3); } puin=pu; if (ii==im) puout=2; JunThread(); if (nap==true and ii==2) PostMessage(Router.GetGameObject("n10z"), "CTRL", "MayOpen^true",4); PostMessage(Router.GetGameObject(lg), "CTRL", "MayOpen^true",4); // входной светофор след.станции if (ii==2) { if (nap==false) PostMessage(Router.GetGameObject("c2ez"), "CTRL", "MayOpen^true",4); else {PostMessage(Router.GetGameObject("n11z"), "CTRL", "MayOpen^true",4); PostMessage(Router.GetGameObject("n01z"), "CTRL", "MayOpen^true",3);} } else if (ii==1) PostMessage(Router.GetGameObject("n0m"), "CTRL", "MayOpen^true",5); //------------------------------этот блок работает при въезде на станцию-------------------- Interface.Print ("wait sound on Trigger "+trig); OnTrigger(Mytrain,trig,0); Interface.Print ("Trigger "+trig+" OK"); if (vstr==true and (((ii==3 or ii==1) and nap==false) or (nap==true and ii==2))) train1.SetAutopilotMode(2); glav=2; DSP2Thread(); // дежурный сообщает о готовности маршрута на приём Interface.Print ("wait Junction "+junin); OnJunction(Mytrain,junin,4); Interface.Print ("Junction "+junin+" OK"); if (vstr==true) {Sleep(10); puin=puvs; JunThread(); lgw="2"+junk[ii]; if (nap==true) lgw=lgw+"c"; PostMessage(Router.GetGameObject(lgw), "CTRL", "MayOpen^true",10);} else if (ii==im) { br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.SetTrainPriorityNumber(3); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train3=two1.GetMyTrain(); train3.SetHandBrake(true); puin=1, puout=1; JunThread(); if (ii==4) junout="r3"; else if (ii==2) {junout="z4"; ChangeJunc("z4", 2);} // первый разворот if (im==4) trig="1r"; else if (im==2) trig="1zc"; else trig="1mc"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 5); text=strTable.GetString("w11"); var=18; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); if (ii==2) ChangeJunc("z4", 0); puin=2, puout=2; JunThread(); // едем на второй разворот if (im==4) junout="r2", trig="m16r", trigw="2rc"; else if (im==2) junout="z3", trig="m49z", trigw="2z"; else if (im==1) junout="m1", trig="m2m", trigw="2m"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject(trigw), "CTRL", "ShuntMode.true", 6); if (im==4) World.Play2DSound(SCN_dir,"ob_na_vokz_80.wav"); else World.Play2DSound(SCN_dir,"ob_na_vokz_79.wav"); // второй разворот Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Flash(); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); Mytrain.Turnaround(); puin=1; JunThread(); Sleep(5); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); // на сцепку if (im==4) trig="m1r"; else if (im==2) trig="m30z"; else trig="n0m"; PostMessage(Router.GetGameObject(trig), "CTRL", "ShuntMode.true", 5); Mytrain.SetDecouplingMask(Vehicle.COUPLE_BOTH); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); train3.SetDecouplingMask(Vehicle.COUPLE_BOTH); train3.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,train3); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep (5); if (im==2) { Sleep(10); Mytrain.Turnaround(); junin="z89"; sig = GetNextSignal(Mytrain.GetVehicles()[0]); PostMessage(sig,"CTRL","ShuntMode.true",5); Sleep(10); text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); Interface.Print ("Junstion z89 OK"); while (!Mytrain.IsStopped()) Sleep(15); Sleep(5); ChangeJunc("z89", 0); Mytrain.Turnaround(); // sig = GetNextSignal(Mytrain.GetVehicles()[0]); PostMessage(sig,"CTRL","ShuntMode.true",5); Sleep(10); text=strTable.GetString("w14"); var=18; Window(); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); Interface.Print ("Junstion z89 OK"); while (!Mytrain.IsStopped()) Sleep(20); one1=Mytrain.GetVehicles()[2]; two1=Mytrain.GetVehicles()[1]; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train3=two1.GetMyTrain(); train3.SetHandBrake(true); Sleep(10); Mytrain.Turnaround(); junin="z1"; PostMessage(Router.GetGameObject("11z"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m14z"), "CTRL", "ShuntMode.true", 4); Sleep(10); text=strTable.GetString("w18")+junin; var=18; Window(); Interface.Print ("wait Junstion "+junin); OnJunction(Mytrain,junin,4); br.SetWindowVisible(false); ChangeJunc("z1",2); ChangeJunc("z5",2); ChangeJunc("z11", 2); ChangeJunc("z21", 2); ChangeJunc("z55", 2); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("m8z"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m18z"), "CTRL", "ShuntMode.true", 4); Sleep(10); text=strTable.GetString("w7"); var=18; Window(); Interface.Print ("wait Junstion z67"); OnJunction(Mytrain,"z67",4); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(10); } else { if (np==6729) np=6732, im=1, nap=false; else if (np==6732) np=6733, im=4, nap=true; else if (np==6733) np=6736, im=2, nap=false; else if (np==6735) np=6738, im=1, nap=false; else if (np==6738) np=6739, im=4, nap=true; else if (np==6739) np=6742, im=2, nap=false; st=ii; Interface.Print ("np="+np); } } } // конец цикла ii } // конец раздела 4 if (razd==5){ // раздел 5 t667h [7]= 9; t667m [7]= 13; t6678h [6]= 5; t6678h [5]= 5; t6678h [4]= 5; t6678h [3]= 5; t6678h [2]= 6; t6678h [1]= 6; t6678h [7]= 5; t6678m [6]= 11; t6678m [5]= 29; t6678m [4]= 42; t6678m [3]= 52; t6678m [2]= 4; t6678m [1]= 14; t6678m [7]= 0; t6680h [6]= 7; t6680h [5]= 8; t6680h [4]= 8; t6680h [3]= 9; t6680h [2]= 9; t6680h [1]= 9; t6680h [7]= 7; t6680m [6]= 57; t6680m [5]= 11; t6680m [4]= 45; t6680m [3]= 0; t6680m [2]= 34; t6680m [1]= 44; t6680m [7]= 50; t6686h [6]= 12; t6686h [5]= 12; t6686h [4]= 13; t6686h [3]= 13; t6686h [2]= 13; t6686h [1]= 13; t6686h [7]= 12; t6686m [6]= 28; t6686m [5]= 47; t6686m [4]= 2; t6686m [3]= 13; t6686m [2]= 25; t6686m [1]= 35; t6686m [7]= 20; t6694h [6]= 17; t6694h [5]= 17; t6694h [4]= 18; t6694h [3]= 18; t6694h [2]= 18; t6694h [1]= 18; t6694h [7]= 17; t6694m [6]= 38; t6694m [5]= 52; t6694m [4]= 9; t6694m [3]= 20; t6694m [2]= 35; t6694m [1]= 45; t6694m [7]= 30; if (np==667) npw=668; else npw=np; // отстой в Евпатории sostav=new KUID[0]; for (is=0; is6600) { Mytrain=World.CreateTrain(er2,"szz13*",true); Mytrain.GetVehicles()[6].Reverse(); pu=13; Mytrain.GetVehicles()[7].Reverse(); // электричка } else if (np==667) { sostav=new KUID[0]; if (tt<234) sostav[0]=GetAsset().LookupKUIDTable(tt), lk=0; else {sostav[0]=GetAsset().LookupKUIDTable(tt); sostav[1]=GetAsset().LookupKUIDTable(tt+1), lk=1;} // локомотив is=lk+1; for (is; is<5; ++is) sostav[is]=GetAsset().LookupKUIDTable(204); sostav[is]=GetAsset().LookupKUIDTable(168); Mytrain=World.CreateTrain(sostav,"szz1*",true); pu=1; if (lk==1) Mytrain.GetVehicles()[1].Reverse(); } if (pr==1) Mytrain.SetTrainPriorityNumber(1); else Mytrain.SetTrainPriorityNumber(2); dcl[0].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив if (pr==1) { ZeroThread(); if (np>6000) is=0; else is=lk+1; side=false; DoorsThread(Mytrain,is,true); Sleep(2); ProductThread(Mytrain,is,true); Sleep(2); } puout=0; Sleep(5); World.Play2DSound(SCN_dir,Math.Rand(81,87)+".wav"); RAZD5: stan [0]="tt"; stan [7]="zz"; stan [6]="yy"; stan [5]= "xp"; stan [4]= "ww"; stan [3]= "vv"; stan [2]= "ua"; stan [1]= "qp"; t6634h [6]= 6; t6634h [5]= 6; t6634h [4]= 6; t6634h [3]= 6; t6634h [2]= 6; t6634h [1]= 5; t6634h [0]= 5; t6634m [6]= 59; t6634m [5]= 46; t6634m [4]= 33; t6634m [3]= 19; t6634m [2]= 6; t6634m [1]= 49; t6634m [0]= 34; t6642h [6]= 10; t6642h [5]= 10; t6642h [4]= 9; t6642h [3]= 9; t6642h [2]= 9; t6642h [1]= 9; t6642h [0]= 9; t6642m [6]= 24; t6642m [5]= 11; t6642m [4]= 58; t6642m [3]= 45; t6642m [2]= 33; t6642m [1]= 21; t6642m [0]= 7; t6648h [6]= 16; t6648h [5]= 15; t6648h [4]= 15; t6648h [3]= 15; t6648h [2]= 15; t6648h [1]= 15; t6648h [0]= 14; t6648m [6]= 13; t6648m [5]= 59; t6648m [4]= 41; t6648m [3]= 26; t6648m [2]= 13; t6648m [1]= 1; t6648m [0]= 46; t6654h [6]= 19; t6654h [5]= 19; t6654h [4]= 18; t6654h [3]= 18; t6654h [2]= 18; t6654h [1]= 18; t6654h [0]= 18; t6654m [6]= 24; t6654m [5]= 11; t6654m [4]= 58; t6654m [3]= 46; t6654m [2]= 34; t6654m [1]= 23; t6654m [0]= 10; while(ii!=im) { if (np==6634) iHours=t6634h[ii], iMins=t6634m[ii]; else if (np==6642) iHours=t6642h[ii], iMins=t6642m[ii]; else if (np==6648) iHours=t6648h[ii], iMins=t6648m[ii]; else if (np==6654) iHours=t6654h[ii], iMins=t6654m[ii]; else if (np==6678) iHours=t6678h[ii], iMins=t6678m[ii]; else if (np==6680) iHours=t6680h[ii], iMins=t6680m[ii]; else if (np==6686) iHours=t6686h[ii], iMins=t6686m[ii]; else if (np==6694) iHours=t6694h[ii], iMins=t6694m[ii]; if (np==667) iHours=t667h[ii], iMins=t667m[ii], speed=80; else if (np==668) speed=80; else if ((nap==true and ii>5) or ii==7) speed=40; else if (nap==true and ii>4) speed=70; else if (ii<6) speed=60; else speed=70; if (ii==st or np>6000) okno=true; else okno=false; if (okno==true) { if (vstr==true and ii!=7 and ii!=0) { text=strTable.GetString("w26"); var=18; Window(); if (nap==true and ii==4) junout="ww18"; else if (ii==4) junout="ww13"; Interface.Print ("wait train 1 on Junction "+junout); OnJunction(train1,junout,4); Interface.Print ("Junction "+junout+" OK"); train1.SoundHorn(); Sleep(10); puout=pu; JunThread(); Sleep(7); if (nap==true) lg="n"+pu+stan[ii]; else lg="c"+pu+stan[ii]; PostMessage(Router.GetGameObject(lg), "CTRL", "MayOpen^true", 10); } if (iMins<10) text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+".0"+iMins; else text=strTable.GetString("w1")+npw+strTable.GetString("w3")+iHours+"."+iMins; var=3; Window(); if (ii==st) Flash(); Interface.Print ("wait time="+iHours+"."+iMins); if (np==6680 and ii==2) { while (!train1.IsStopped()) Sleep(2); side=true, DoorsThread(train1,0,true); Interface.Print ("Sleep(177)"); Sleep(177); train1.SoundHorn(); DoorsThread(train1,0,false); } if (puout!=pu) --iMins, iSecs=45; else iSecs=0; time=World.GetGameTime (); // сравниваем время if (iHours < 12) fTime = 0.5 + (iHours / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); else fTime = ((iHours - 12) / 24.0) + (iMins / 1440.0) + (iSecs / 86400.0); if (time<(fTime-0.5)) fTime=fTime+0.5; while(time6000) pu=13; else if (ii==4) pu=2; else if (ii==6) pu=3; else pu=1; puin=pu; if (vstr==true) puout=puvs; else puout=pu; JunThread(); // собираем входной маршрут Interface.Print ("ii="+ii+", okno="+okno+", pu="+pu); Sleep (7); if (ii==2) { // Ярка sostav=new KUID[0]; for (is=0; is5) for (is; is5) {for (is=0; is3 and ii!=7)) or pr==2) okno=false; else okno=true; // задаём путь прибытия if (ii==1 and pr==1) pu=4; else if (ii==2 and okno==true) pu=3; else if (ii==3 and np==6749) pu=9, puvs=1, vstr=true; else if (ii==3 and pr==2) pu=3; else if (ii==5 and okno==true) pu=2; else if ((ii==6 or ii==4) and okno==true) pu=3; else if (ii==7 and np==869) pu=2; else if (ii==7 and np==309) pu=5, vstr=true, puvs=0; else if (ii==7 and np==6749) pu=17; else if (ii==7) pu=Math.Rand(6,10); else pu=1; if (ii==6 and np<311) vstr=true, puvs=1; puin=pu; if (vstr==true) puout=puvs; else if (ii!=im) puout=pu; JunThread(); // собираем входной маршрут Interface.Print ("ii="+ii+", okno="+okno+", pu="+pu); Sleep (7); if (ii==3) { // Красноперекопск sostav=new KUID[0]; for (is=0; is5) { // сборный sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(2); sostav[1]=GetAsset().LookupKUIDTable(3); for (is=2; is<48; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(46,66)); is=Math.Rand(2,12); tt=Math.Rand(is,is+15); for (is; is5) for (is; is"+strTable.GetString("w25")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_EXTERNAL); Mytrain.Turnaround(); World.SetCamera(train0.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); train0.SetTrainPriorityNumber(3); ChangeJunc("y109", 0); ChangeJunc("y45", 2); ChangeJunc("y83", 0); PostMessage(Router.GetGameObject("4yc"), "CTRL", "ShuntMode.true", 4); PostMessage(Router.GetGameObject("m26y"), "CTRL", "ShuntMode.true", 4); dcl[0].SetLocation(train0.GetFrontmostLocomotive()); Sleep(10); Mytrain.SetAutopilotMode(2); junin="y53"; text=strTable.GetString("w18")+junin; var=18; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junstion "+junin); OnJunction(train0,junin,4); Interface.Print ("Junstion "+junin+" OK"); br.SetWindowVisible(false); ChangeJunc("y53", 2); Sleep(20); // это для попутного ChangeJunc("y104", 2); ChangeJunc("y84", 2); PostMessage(Router.GetGameObject("ny"), "CTRL", "MayOpen^true", 4); PostMessage(Router.GetGameObject("m50y"), "CTRL", "ShuntMode.true", 4); text=strTable.GetString("w21"); var=18; Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); train0.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(train0,trainout); br.SetWindowVisible(false); // сцепились ChangeJunc("y53", 0); ChangeJunc("y83", 2); ChangeJunc("y37", 0); Sleep(10); World.DeleteTrain(Mytrain); loko1=train0.GetVehicles()[0]; Mytrain=loko1.GetMyTrain(); Mytrain.SetTrainPriorityNumber(1); razd=1; im=16; SoundThread(); Interface.Print ("goto RAZD1"); goto RAZD1; } else if (np==6750) {text=strTable.GetString("w19"); var=0; Window(); while (!Mytrain.IsStopped()) Sleep(3);} else if (pr==2 or ii==1) while (!Mytrain.IsStopped()) Sleep(3); else if (nap==true) {razd=3; ii=1; im=10; Interface.Print ("goto RAZD3"); goto RAZD3; } else {text=strTable.GetString("w16"); var=0; Window(); while (!Mytrain.IsStopped()) Sleep(3);} } // конец раздела 6 if (razd==0){ // раздел 0 (маневровый в Керчи) RAZD0: Train trainman, traint6, traint7, traint8, traint9, traint10, traint11, traint12, traint13, traint14; Train tr0, tr1, tr2, tr3, tr4, tr5, tr6, tr7, tr8, tr9, tr10, tr11; int [] vag = new int [0]; razd=2; ii=7; nap=false; var=18; br1.SetWindowVisible(false); stang[0]=1; stang[1]=2; stang[2]=4; stang[3]=6; its=Math.Rand(0,7); if(Math.Rand(1,11)>5) order=true; if (its==0) iHours=7, iMins=40; else if(its<3) iHours=11, iMins=15; else if(its<5) iHours=9, iMins=15; else iHours=15, iMins=0; if (iHours<12) fTime=0.5+(iHours/24.0)+(iMins/1440.0)+(iSecs/86400.0); else fTime=((iHours-12)/24.0)+(iMins/1440.0)+(iSecs/86400.0); World.SetGameTime(fTime); mark="SZD2"; sostav=new KUID[0]; sostav[0]=GetAsset().LookupKUIDTable(0); Mytrain=World.CreateTrain(sostav,mark,false); Mytrain.SetTrainPriorityNumber(3); if (its!=3 and its<5) Mytrain.Turnaround(); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); Interface.Print ("man lok OK"); dcl[3].SetLocation(Mytrain.GetFrontmostLocomotive()); World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); // сели в локомотив // назначаем пути для поездов puvs=Math.Rand(3,7); stand[puvs]=false; puvsw=3; while (stand[puvsw]==false) puvsw=Math.Rand(3,7); stand[puvsw]=false; for (is=3; is<6; ++is) if (stand[is]==true) break; pupop=is; stand[pupop]=false; for (is=3; is<6; ++is) if (stand[is]==true) break; pu=is; um=is; // pu оставляем для train1 ip=Math.Rand(7,10); // путь для отстоя Interface.Print ("puvs="+puvs+", puvsw="+puvsw+", pupop="+pupop+", its="+its); // ставим поезда sostav=new KUID[0]; it=Math.Rand(4,8); if (its==5) for (is=0; is"+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} depo7.Turnaround(); World.SetCamera(depo7.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); ChangeJunc("z46",0); ChangeJunc("z79",2); PostMessage(Router.GetGameObject("m71z"), "CTRL", "ShuntMode.true", 3); junout="z46"; text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!depo7.IsStopped()) Sleep(20); ChangeJunc("z46",2); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m35z"), "CTRL", "ShuntMode.true", 5); Sleep(10); junout="z6"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(15); br.SetWindowVisible(false); while (!depo7.IsStopped()) Sleep(2); ChangeJunc("z118",0); PostMessage(Router.GetGameObject("m61z"), "CTRL", "ShuntMode.true", 0); junout="z118"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); Sleep(15); ChangeJunc("z118",2); PostMessage(Router.GetGameObject("m49z"), "CTRL", "ShuntMode.true", 5); Sleep(10); text=strTable.GetString("w21"); Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); TrainUtil.DoCoupleUp(depo7,traint5); br.SetWindowVisible(false); Sleep(1); one1=depo7.GetVehicles()[0]; train1=one1.GetMyTrain(); vstr=true; oknotext=""+HTMLWindow.StartTable(); // теперь меняем локомотив oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); PostMessage(Router.GetGameObject("m15z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m33z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m39z"), "CTRL", "ShuntMode.true", 5); junout="z42"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,0); Interface.Print ("Junction "+junout+" OK"); text=strTable.GetString("w26"); Window(); iHours=8; iMins=33; puout=2; DopManThread(); // управление пассажирским уходит в другую нить while (train1.IsStopped()) Sleep(20); // ждём отправления пассажирского PostMessage(Router.GetGameObject("m51z"), "CTRL", "ShuntMode.true", 1); Sleep(5); text=strTable.GetString("w5"); Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_118.wav"); Interface.Print ("wait Trigger TZ1C"); OnTrigger(Mytrain,"TZ1C",0); Interface.Print ("Junction Trigger TZ1C OK"); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(20); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; // отцепка one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint5=two1.GetMyTrain(); traint5.SetHandBrake(true); traint5.SetCouplingMask(Vehicle.COUPLE_BOTH); text=strTable.GetString("w12"); Window(); Sleep(10); if(order==true) { // цепляем почтовый PostMessage(Router.GetGameObject("1z"), "CTRL", "ShuntMode.true", 0); junout="z89"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(15); ChangeJunc("z89",0); text=strTable.GetString("w20"); Window(); TrainUtil.DoCoupleUp(Mytrain,traint14); br.SetWindowVisible(false); // сцепка while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); PostMessage(Router.GetGameObject("11z"), "CTRL", "ShuntMode.true", 1); junout="z89"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(15); ChangeJunc("z89",2); text=strTable.GetString("w20"); Window(); TrainUtil.DoCoupleUp(Mytrain,traint5); br.SetWindowVisible(false); // сцепка while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; // отцепка one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint5=two1.GetMyTrain(); traint5.SetHandBrake(true); traint5.SetCouplingMask(Vehicle.COUPLE_BOTH); text=strTable.GetString("w12"); Window(); Sleep(10); } junout="z5"; text=strTable.GetString("w18")+junout; Window(); ChangeJunc("z3",0); ChangeJunc("z77",0); PostMessage(Router.GetGameObject("1z"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(10); ChangeJunc("z82",2); ChangeJunc("z73",0); ChangeJunc("z65",2); ChangeJunc("z3",2); ChangeJunc("z77",2); ChangeJunc("z5",2); ChangeJunc("z21",2); ChangeJunc("z55",2); ChangeJunc("z11",2); Sleep(10); PostMessage(Router.GetGameObject("m8z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m18z"), "CTRL", "ShuntMode.true", 5); Sleep(7); junout="z69"; text=strTable.GetString("w18")+junout; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); depo4.SetTrainPriorityNumber(3); dcl[0].SetLocation(depo4.GetFrontmostLocomotive()); //сажаем машиниста в бот 98 oknotext=""+HTMLWindow.StartTable(); // пересаживаемся сами oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(depo4.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); ChangeJunc("z48",0); PostMessage(Router.GetGameObject("m71z"), "CTRL", "ShuntMode.true", 3); junout="z46"; text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(depo4,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!depo4.IsStopped()) Sleep(20); ChangeJunc("z48",2); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m35z"), "CTRL", "ShuntMode.true", 5); Sleep(10); junout="z6"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo4,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(15); br.SetWindowVisible(false); while (!depo4.IsStopped()) Sleep(2); ChangeJunc("z118",0); PostMessage(Router.GetGameObject("m61z"), "CTRL", "ShuntMode.true", 0); junout="z118"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo4,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); Sleep(15); ChangeJunc("z118",2); ChangeJunc("z4",2); PostMessage(Router.GetGameObject("m49z"), "CTRL", "ShuntMode.true", 5); Sleep(10); text=strTable.GetString("w6"); Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); TrainUtil.DoCoupleUp(depo4,traint5); br.SetWindowVisible(false); Sleep(10); one1=depo4.GetVehicles()[0]; train1=one1.GetMyTrain(); vstr=true; PostMessage(Router.GetGameObject("1zc"), "CTRL", "MayOpen^true", 100); oknotext=""+HTMLWindow.StartTable(); // возвращаемся в маневровый oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); iHours=9; iMins=8; puout=1; DopManThread(); // управление пассажирским уходит в другую нить Sleep(30); okno=false; its=Math.Rand(4,6); if (its==5) Mytrain.Turnaround(); } // end 0 if (its==4){ ChangeJunc("z76",0); ChangeJunc("z80",2); ChangeJunc("z108",0); ChangeJunc("z106",0); ChangeJunc("z10",0); ChangeJunc("z30",2); ChangeJunc("z32",0); ChangeJunc("z74",2); ChangeJunc("z64",2); ChangeJunc("z79",0); PostMessage(Router.GetGameObject("m71z"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m7z"), "CTRL", "ShuntMode.true", 5); Sleep(10); junout="z106"; // это первый раскат вагонов text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); ChangeJunc("z76",2); ChangeJunc("z108",2); ChangeJunc("z80",0); PostMessage(Router.GetGameObject("m3z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 3); Sleep(10); text=strTable.GetString("w20"); Window(); dsp="s1"; DSP3Thread(); TrainUtil.DoCoupleUp(Mytrain,train0); // сцепка text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 3); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[4]; two1=Mytrain.GetVehicles()[3]; // отцепка 0 на 9 путь it=16; World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr0=two1.GetMyTrain(); tr0.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr0.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr0,"z32",4); ChangeJunc("z32",2); // следующая отцепка на 8 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[3]; two1=Mytrain.GetVehicles()[2]; // отцепка 1 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr1=two1.GetMyTrain(); tr1.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr1.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr1,"z30",4); ChangeJunc("z30",0); // следующая отцепка на 10 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[2]; two1=Mytrain.GetVehicles()[1]; // отцепка 2 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr2=two1.GetMyTrain(); tr2.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr2.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr2,"z30",4); ChangeJunc("z30",2); ChangeJunc("z32",0); // следующая отцепка на 9 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[1]; two1=Mytrain.GetVehicles()[0]; // отцепка 3 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr3=two1.GetMyTrain(); tr3.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr3.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr3,"z30",4); ChangeJunc("z30",0); // следующая отцепка на 10 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); tr2.SetHandBrake(true); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[2]; two1=Mytrain.GetVehicles()[1]; // отцепка 4 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr4=two1.GetMyTrain(); tr4.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr4.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr4,"z30",4); ChangeJunc("z30",2); ChangeJunc("z32",0); // следующая отцепка на 9 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[2]; two1=Mytrain.GetVehicles()[1]; // отцепка 5 World.Play2DSound(SCN_prs,"md"+it+".wav"); one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr5=two1.GetMyTrain(); tr5.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr5.SetCouplingMask(Vehicle.COUPLE_BOTH); while (!Mytrain.IsStopped()) Sleep(15); Mytrain.Turnaround(); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); // конец первого раската вагонов if(order==true){ // второй раскат вагонов Sleep(15); PostMessage(Router.GetGameObject("m9z"), "CTRL", "ShuntMode.true", 3); text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.false", 2); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); ChangeJunc("z104",0); ChangeJunc("z106",2); ChangeJunc("z68",0); ChangeJunc("z64",2); ChangeJunc("z28",0); ChangeJunc("z32",0); PostMessage(Router.GetGameObject("m3z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 15); Sleep(10); text=strTable.GetString("w20"); Window(); dsp="s1"; DSP3Thread(); TrainUtil.DoCoupleUp(Mytrain,traint12); // сцепка text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[3]; two1=Mytrain.GetVehicles()[2]; // отцепка 0 на 9 путь it=19; World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr6=two1.GetMyTrain(); tr6.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr6.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr6,"z32",4); ChangeJunc("z32",2); // следующая отцепка на 8 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[3]; two1=Mytrain.GetVehicles()[2]; // отцепка 1 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr7=two1.GetMyTrain(); tr7.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr7.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr7,"z30",4); ChangeJunc("z30",0); ChangeJunc("z54",0); // следующая отцепка на 10 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[4]; two1=Mytrain.GetVehicles()[3]; // отцепка 2 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr8=two1.GetMyTrain(); tr8.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr8.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr8,"z30",4); ChangeJunc("z30",2); ChangeJunc("z32",0); // следующая отцепка на 9 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[3]; two1=Mytrain.GetVehicles()[2]; // отцепка 3 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr9=two1.GetMyTrain(); tr9.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr9.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr9,"z30",4); ChangeJunc("z30",0); // следующая отцепка на 10 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[3]; two1=Mytrain.GetVehicles()[2]; // отцепка 4 World.Play2DSound(SCN_prs,"md"+it+".wav"); ++it; one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr10=two1.GetMyTrain(); tr10.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr10.SetCouplingMask(Vehicle.COUPLE_BOTH); OnJunction(tr10,"z30",4); ChangeJunc("z30",2); ChangeJunc("z32",0); // следующая отцепка на 9 путь while (!Mytrain.IsStopped()) Sleep(5); text=strTable.GetString("w27"); Window(); PostMessage(Router.GetGameObject("gz"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Trigger TGZ"); OnTrigger(Mytrain,"TGZ",0); Interface.Print ("Junction Trigger TGZ OK"); one1=Mytrain.GetVehicles()[4]; two1=Mytrain.GetVehicles()[3]; // отцепка 5 World.Play2DSound(SCN_prs,"md"+it+".wav"); one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); tr11=two1.GetMyTrain(); tr11.SetCouplingMask(Vehicle.COUPLE_NONE); text=strTable.GetString("w23"); Window(); Sleep(2); tr11.SetCouplingMask(Vehicle.COUPLE_BOTH); while (!Mytrain.IsStopped()) Sleep(5); Mytrain.SetCouplingMask(Vehicle.COUPLE_BOTH); ChangeJunc("z74",2); Sleep(12); Mytrain.Turnaround(); } junout="z76"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); Sleep(12); Mytrain.Turnaround(); ChangeJunc("z76",0); junout="z79"; text=strTable.GetString("w18")+junout; Window(); dsp="s6"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(12); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); Sleep(30); if (okno==false) its=10; else {its=Math.Rand(3,6); okno=false; if (its==4) its=5;} } // end 4 if (its==3){ // с прицепкой к грузовому sostav=new KUID[0]; is=Math.Rand(1,7)*2; sostav[0]=GetAsset().LookupKUIDTable(is); sostav[1]=GetAsset().LookupKUIDTable(is+1); for (is=2; is<40; ++is) sostav[is]=GetAsset().LookupKUIDTable(Math.Rand(16,30)); train1=World.CreateTrain(sostav,"SN4",true); train1.SetTrainPriorityNumber(2); pr=2; train1.GetVehicles()[1].Reverse(); vstr=true; sostav=new KUID[0]; for (is=0; is3) {ChangeJunc("z5",2); junout="z5";} else junout="z99"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z77",0); ChangeJunc("z33",0); ChangeJunc("z5",0); PostMessage(Router.GetGameObject("m16z"), "CTRL", "ShuntMode.true", 2); junout="z85"; text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z85",2); PostMessage(Router.GetGameObject("m28z"), "CTRL", "ShuntMode.true", 5); junout="z22"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z22",0); text=strTable.GetString("w20"); Window(); dsp="s1"; DSP3Thread(); TrainUtil.DoCoupleUp(Mytrain,traint); br.SetWindowVisible(false); // сцепка while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); junout="z22"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z22",2); ChangeJunc("z1",0); PostMessage(Router.GetGameObject("m22z"), "CTRL", "ShuntMode.true", 1); junout="z85"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z85",0); ChangeJunc("z77",2); PostMessage(Router.GetGameObject("m28z"), "CTRL", "ShuntMode.true", 1); PostMessage(Router.GetGameObject("m14z"), "CTRL", "ShuntMode.true", 1); junout="z1"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); puin=puvs; JunThread(); ChangeJunc("z33",2); ChangeJunc("z77",2); Mytrain.Turnaround(); Sleep(20); PostMessage(Router.GetGameObject("m8z"), "CTRL", "ShuntMode.true", 1); if (puin==3) {PostMessage(Router.GetGameObject("m16z"), "CTRL", "ShuntMode.true", 1);} else PostMessage(Router.GetGameObject("m18z"), "CTRL", "ShuntMode.true", 1); text=strTable.GetString("w20"); Window(); dsp="s1"; DSP3Thread(); TrainUtil.DoCoupleUp(Mytrain,train2); br.SetWindowVisible(false); // сцепка while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; // отцепка one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); train2=two1.GetMyTrain(); train2.SetHandBrake(true); Sleep(20); PostMessage(Router.GetGameObject(puin+"z"), "CTRL", "ShuntMode.true", 6); junout="z5"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); puin=10; JunThread(); PostMessage(Router.GetGameObject("m18z"), "CTRL", "ShuntMode.true", 6); junout="z69"; text=strTable.GetString("w18")+junout; Window(); dsp="s5"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(10); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); depo4.SetTrainPriorityNumber(3); dcl[0].SetLocation(depo4.GetFrontmostLocomotive()); //сажаем машиниста в бот oknotext=""+HTMLWindow.StartTable(); // пересаживаемся сами oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(depo4.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); ChangeJunc("z48",0); ChangeJunc("z73",0); ChangeJunc("z79",2); ChangeJunc("z76",0); ChangeJunc("z74",0); PostMessage(Router.GetGameObject("m71z"), "CTRL", "ShuntMode.true", 3); junout="z46"; text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(depo4,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!depo4.IsStopped()) Sleep(20); Sleep(20); puout=puvs; JunThread(); Sleep(10); ChangeJunc("z48",2); ChangeJunc("z2",2); ChangeJunc("z4",2); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m35z"), "CTRL", "ShuntMode.true", 5); if (puout==3) PostMessage(Router.GetGameObject("m67z"), "CTRL", "ShuntMode.true", 5); else if (puout==4) PostMessage(Router.GetGameObject("m65z"), "CTRL", "ShuntMode.true", 5); else {PostMessage(Router.GetGameObject("m57z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m63z"), "CTRL", "ShuntMode.true", 5);} Sleep(10); text=strTable.GetString("w21"); Window(); TrainUtil.DoCoupleUp(depo4,train2); br.SetWindowVisible(false); Sleep(60); one1=depo4.GetVehicles()[0]; train1=one1.GetMyTrain(); vstr=true; oknotext=""+HTMLWindow.StartTable(); // возвращаемся в маневровый oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); puout=puvs; JunThread(); Sleep(60); PostMessage(Router.GetGameObject(puvs+"zc"), "CTRL", "MayOpen^true", 6); PostMessage(Router.GetGameObject("c20z"), "CTRL", "MayOpen^true", 6); PostMessage(Router.GetGameObject("c2z"), "CTRL", "MayOpen^true", 6); Sleep(10); DSP1Thread(); train1.SetTrainPriorityNumber(2); Sleep(10); train1.SoundHorn(); train1.SetAutopilotMode(2); np=3; DopManThread(); if (okno==false) its=10; else {its=Math.Rand(4,6); okno=false; Sleep(60); if (its==5) Mytrain.Turnaround();} } // end 3 if (its==1){ // c прибытием 6743 sostav=new KUID[0]; for (is=0; is5) is=0; else is=2; ChangeJunc("z27",is); PostMessage(Router.GetGameObject("m28z"), "CTRL", "ShuntMode.true", 2); Sleep(10); junout="z27"; text=strTable.GetString("w14"); Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(25); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(2); Sleep(15); Mytrain.Turnaround(); one=Mytrain.GetVehicles()[0]; two=Mytrain.GetVehicles()[1]; // отцепка one.Uncouple(two); Mytrain=one.GetMyTrain(); train3=two.GetMyTrain(); text=strTable.GetString("w12"); Window(); Sleep(15); PostMessage(Router.GetGameObject("m40z"), "CTRL", "ShuntMode.true", 3); PostMessage(Router.GetGameObject("m22z"), "CTRL", "ShuntMode.true", 3); junout="z85"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); text=strTable.GetString("w26"); Window(); junout="z77"; Interface.Print ("wait Junction "+junout); OnJunction(train1,junout,4); Interface.Print ("Junction "+junout+" OK"); ChangeJunc("z33",0); ChangeJunc("z85",0); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("m28z"), "CTRL", "ShuntMode.true", 2); junout="z33"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); Sleep(15); ChangeJunc("z33",2); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("1zc"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m30z"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m25z"), "CTRL", "ShuntMode.true", 2); PostMessage(Router.GetGameObject("m41z"), "CTRL", "ShuntMode.true", 2); Sleep(10); text=strTable.GetString("w20"); Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_118.wav"); TrainUtil.DoCoupleUp(Mytrain,traint4); br.SetWindowVisible(false); // сцепка ChangeJunc("z82",0); ChangeJunc("z86",2); ChangeJunc("z88",2); junout="z88"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(5); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(2); Sleep(40); Mytrain.Turnaround(); one=Mytrain.GetVehicles()[0]; two=Mytrain.GetVehicles()[1]; // отцепка one.Uncouple(two); Mytrain=one.GetMyTrain(); traint4=two.GetMyTrain(); text=strTable.GetString("w12"); Window(); Sleep(15); Sleep(10); PostMessage(Router.GetGameObject("m23z"), "CTRL", "ShuntMode.true", 2); junout="z88"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(5); br.SetWindowVisible(false); ChangeJunc("z88",0); ChangeJunc("z90",2); ChangeJunc("z100",0); Sleep(10); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("m25z"), "CTRL", "ShuntMode.true", 2); text=strTable.GetString("w20"); Window(); TrainUtil.DoCoupleUp(Mytrain,traint5); br.SetWindowVisible(false); // сцепка Sleep(40); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("m33z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m39z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m19z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m51z"), "CTRL", "ShuntMode.true", 9); Sleep(10); junout="z34"; text=strTable.GetString("w5"); Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); World.Play2DSound(SCN_dir,"ob_na_vokz_118.wav"); Interface.Print ("wait Trigger TZ3C"); OnTrigger(Mytrain,"TZ1C",0); Interface.Print ("Junction Trigger TZ3C OK"); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(20); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; // отцепка one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint4=two1.GetMyTrain(); traint4.SetHandBrake(true); traint4.SetCouplingMask(Vehicle.COUPLE_BOTH); text=strTable.GetString("w12"); Window(); Sleep(20); junout="z3"; text=strTable.GetString("w18")+junout; Window(); PostMessage(Router.GetGameObject("1z"), "CTRL", "ShuntMode.true", 0); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(20); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z3",2); ChangeJunc("z98",0); ChangeJunc("z86",0); PostMessage(Router.GetGameObject("m30z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("2zc"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m45z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m41z"), "CTRL", "ShuntMode.true", 9); Sleep(10); World.Play2DSound(SCN_dir,"ob_na_vokz_80.wav"); junout="z86"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); text=strTable.GetString("w20"); Window(); traint2.SetCouplingMask(Vehicle.COUPLE_BOTH); TrainUtil.DoCoupleUp(Mytrain,traint2); br.SetWindowVisible(false); // сцепка Sleep(40); Mytrain.Turnaround(); PostMessage(Router.GetGameObject("m29z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m39z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("m43z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject(um+"z"), "CTRL", "ShuntMode.true", 9); PostMessage(Router.GetGameObject("mz8z"), "CTRL", "ShuntMode.true", 40); PostMessage(Router.GetGameObject("mz6z"), "CTRL", "ShuntMode.true", 120); if(um==4) PostMessage(Router.GetGameObject("m65z"), "CTRL", "ShuntMode.true", 5); else if(um==3) {PostMessage(Router.GetGameObject("m67z"), "CTRL", "ShuntMode.true", 5); ChangeJunc("z93",0);} else { PostMessage(Router.GetGameObject("m63z"), "CTRL", "ShuntMode.true", 5); ChangeJunc("z7",0); PostMessage(Router.GetGameObject("m57z"), "CTRL", "ShuntMode.true", 5); } if (um==6) ChangeJunc("z9",20), ChangeJunc("z19",0); puin=um; puout=um; JunThread(); Sleep(40); ChangeJunc("z15",0); ChangeJunc("z5",0); if(um<4) ChangeJunc("z93",2); junout="z37"; text=strTable.GetString("w18")+junout; Window(); if (pu==5) World.Play2DSound(SCN_dir,"ob_na_vokz_112.wav"); else World.Play2DSound(SCN_dir,"ob_na_vokz_105.wav"); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(2); ChangeJunc("z37",2); ChangeJunc("z98",2); ChangeJunc("z86",2); ChangeJunc("z2",2); ChangeJunc("z15",2); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(2); Sleep(40); Mytrain.Turnaround(); Sleep(20); ChangeJunc("z93",0); junout="z49"; text=strTable.GetString("w7"); Window(); ChangeJunc("z41",2); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(10); br.SetWindowVisible(false); dsp="s7"; DSP3Thread(); while (!Mytrain.IsStopped()) Sleep(40); Mytrain.Turnaround(); one1=Mytrain.GetVehicles()[0]; two1=Mytrain.GetVehicles()[1]; // отцепка one1.Uncouple(two1); Mytrain=one1.GetMyTrain(); traint2=two1.GetMyTrain(); traint2.SetHandBrake(true); text=strTable.GetString("w12"); Window(); Sleep(20); junout="z49"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(40); Mytrain.Turnaround(); ChangeJunc("z25",0); ChangeJunc("z49",0); ChangeJunc("z65",2); dsp="s6"; DSP3Thread(); junout="z69"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(Mytrain,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!Mytrain.IsStopped()) Sleep(10); ChangeJunc("z25",2); ChangeJunc("z49",2); depo7.SetTrainPriorityNumber(3); dcl[1].SetLocation(depo7.GetFrontmostLocomotive()); //сажаем машиниста в бот oknotext=""+HTMLWindow.StartTable(); // теперь меняем локомотив oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} depo7.Turnaround(); World.SetCamera(depo7.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); ChangeJunc("z46",0); ChangeJunc("z79",2); PostMessage(Router.GetGameObject("m71z"), "CTRL", "ShuntMode.true", 3); junout="z46"; text=strTable.GetString("w18")+junout; Window(); dsp="s8"; DSP3Thread(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); while (!depo7.IsStopped()) Sleep(20); ChangeJunc("z46",2); ChangeJunc("z2",2); ChangeJunc("z8",2); ChangeJunc("z118",2); ChangeJunc("z6",2); PostMessage(Router.GetGameObject("m47z"), "CTRL", "ShuntMode.true", 5); PostMessage(Router.GetGameObject("m35z"), "CTRL", "ShuntMode.true", 5); Sleep(10); junout="z6"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); Sleep(15); br.SetWindowVisible(false); while (!depo7.IsStopped()) Sleep(2); ChangeJunc("z118",0); PostMessage(Router.GetGameObject("m61z"), "CTRL", "ShuntMode.true", 0); junout="z118"; text=strTable.GetString("w18")+junout; Window(); Interface.Print ("wait Junction "+junout); OnJunction(depo7,junout,4); Interface.Print ("Junction "+junout+" OK"); br.SetWindowVisible(false); Sleep(15); ChangeJunc("z118",2); ChangeJunc("z4",2); PostMessage(Router.GetGameObject("m49z"), "CTRL", "ShuntMode.true", 5); Sleep(10); text=strTable.GetString("w21"); Window(); World.Play2DSound(SCN_dir,"ob_na_vokz_72.wav"); TrainUtil.DoCoupleUp(depo7,traint4); br.SetWindowVisible(false); Sleep(1); one1=depo7.GetVehicles()[0]; train1=one1.GetMyTrain(); vstr=true; np=0; iHours=13; iMins=20; puout=1; nap=false; DopManThread(); // управление ботом передаём в другую нить oknotext=""+HTMLWindow.StartTable(); // теперь меняем локомотив oknotext=oknotext+HTMLWindow.MakeRow(HTMLWindow.MakeCell(""+strTable.GetString("w28")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); wait() {on "Browser-URL", "live://clc": br.SetWindowVisible(false);} World.SetCamera(Mytrain.GetFrontmostLocomotive(), World.CAMERA_INTERNAL); okno=false; Sleep(30); its=Math.Rand(2,6); if (its==3 or its==5) Mytrain.Turnaround(); } // end 1 if (its==2){ // с поездкой на Южную sostav=new KUID[0]; for (is=0; is"+strTable.GetString("w17")+"")); oknotext=oknotext+HTMLWindow.EndTable()+""; br.LoadHTMLString(oknotext); br.SetWindowVisible(true); Flash(); } // конец нити сценария public void RunInDriver(){ if (World.GetCurrentModule()!=World.DRIVER_MODULE) return; FerstThread(); SecondThread(); // сразу запускаем только две нити } public void RunInSurveyor() { if (World.GetCurrentModule()!=World.SURVEYOR_MODULE ) return;} void ModuleInitHandler(Message msg){ if (objectRunningDriver) return; if (World.GetCurrentModule() == World.DRIVER_MODULE) { objectRunningDriver=true; RunInDriver(); } } public void Init(Asset self) { inherited(self); AddHandler(me, "World", "ModuleInit", "ModuleInitHandler"); RunInSurveyor(); } }; // конец класса