- Рег
- 17 Сен 2016
- Сообщения
- 14
- Реакции
- 0
Всем привет. Ребята помогите решить эту задачку, 2 часа писал и теперь более часа не могу врубиться что не так сделал.
Результат сего деяния таков, запускаю скрипт, он делает проверку мобов в зоне где стою (условно в городе) и останавливает скрипт, точка.
ЗЫ. Старт в Орене, далее делает с глобал ГК с тп в апостаты и условно должен фармить первые 3 комнаты
Результат сего деяния таков, запускаю скрипт, он делает проверку мобов в зоне где стою (условно в городе) и останавливает скрипт, точка.
uses SysUtils, Classes;
var Fight_Flag:Boolean;
Item: TL2Item;
obj: TL2Npc;
Npc: TL2Npc;
obj2: TL2Effect;
var L2Skill: TL2Skill;
Enemy: TL2Live;
var i, n: Integer;
function mobsInZone : Boolean;
var i: Integer;
MobCaunt: Integer;
begin
MobCaunt:= 0;
for i := 0 to NpcList.Count - 1 do begin
if NpcList.Items(i).InZone and NpcList.Items(i).Attackable then begin
Result := True;
exit;
end;
end;
Result := False;
end;
begin
if mobsInZone
then begin
print('мобы ЕСТЬ');
end else begin
print('мобов НЕТ');
end;
end.
procedure go Buff(1);
begin
Print('Идем к Бафферу');
delay(155);
if User.inrange(80334,54400,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80334,54400,-1552);
Engine.MoveTo(80969,53698,-1558);
Engine.MoveTo(81540,53454,-1494);
Engine.MoveTo(82480,53340,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82323,55466,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82323,55466,-1520);
Engine.MoveTo(82403,54498,-1523);
Engine.MoveTo(82589,53861,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82123,53535,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82123,53535,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80304,56241,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80304,56241,-1552);
Engine.MoveTo(81470,55682,-1523);
Engine.MoveTo(82256,55294,-1523);
Engine.MoveTo(82510,54035,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82445,56012,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82445,56012,-1520);
Engine.MoveTo(82341,54950,-1523);
Engine.MoveTo(82574,53833,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80054,53209,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80054,53209,-1552);
Engine.MoveTo(80624,53611,-1558);
Engine.MoveTo(81772,53468,-1494);
Engine.MoveTo(82289,53472,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80513,52980,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80513,52980,-1552);
Engine.MoveTo(80165,53065,-1558);
Engine.MoveTo(80630,53610,-1558);
Engine.MoveTo(81688,53447,-1494);
Engine.MoveTo(82303,53338,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80267,55497,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80267,55497,-1552);
Engine.MoveTo(80359,54536,-1558);
Engine.MoveTo(80792,53785,-1558);
Engine.MoveTo(81495,53421,-1494);
Engine.MoveTo(82323,53362,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(79933,55752,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(79933,55752,-1552);
Engine.MoveTo(80349,55208,-1558);
Engine.MoveTo(80470,54217,-1558);
Engine.MoveTo(81053,53602,-1558);
Engine.MoveTo(81974,53465,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80594,55837,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80594,55837,-1552);
Engine.MoveTo(81899,55492,-1523);
Engine.MoveTo(82240,55142,-1523);
Engine.MoveTo(82531,53946,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82213,53964,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82213,53964,-1488);
Engine.MoveTo(82668,53709,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(83327,55410,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(83327,55410,-1520);
Engine.MoveTo(82607,55592,-1523);
Engine.MoveTo(82184,54809,-1523);
Engine.MoveTo(82563,53882,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(79706,52986,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(79706,52986,-1552);
Engine.MoveTo(80427,53549,-1558);
Engine.MoveTo(80812,53655,-1558);
Engine.MoveTo(81979,53439,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82880,55390,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82880,55390,-1520);
Engine.MoveTo(82375,55524,-1523);
Engine.MoveTo(82367,54313,-1493);
Engine.MoveTo(82651,53734,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82552,53447,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82552,53447,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82638,53885,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82638,53885,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
procedure Buff(2);
begin
Print('Баффаемся');
delay(155);
if User.inrange(82951, 53459, -1480, 450, 250)
then begin // с етим бегином сцепленно если!
Engine.MoveTo(82951, 53459, -1480);
Engine.Settarget(31360); //Таргет Баффера
Engine.Dlgopen;
delay(2111);
Engine.DlgSel(16);
delay(2111);
Engine.Dlgopen;
delay(1111);
Engine.DlgSel(1);
delay(2222);
end;
procedure go TP(3);
begin
Print('Идем к ТП, ТПшимся');
delay(155);
Engine.MoveTo(83076, 53115, -1490);
Engine.SetTarget(31031); // Gatekeeper
delay(1111);
Engine.DlgOpen;
delay(1111);
Engine.DlgSel(17);
delay(7000);
Engine.MoveTo(-20209, -250622, -8158);
Engine.MoveTo(-20040, -250734, -8157);
Engine.MoveTo(-19667, -250791, -8159);
Engine.MoveTo(-19139, -250705, -8159);
Engine.MoveTo(-18993, -250447, -8159);
Engine.MoveTo(-18573, -250465, -8157);
Engine.MoveTo(-17934, -250467, -8157);
end;
procedure go ap1(4);
begin
Print('Идем в 1-ю комнату');
delay(155);
if User.inrange(-17934, -250467, -8157, 1000, 450) // AP1
then begin
engine.loadzone('ap1');
Print('Загрузил зону AP-1');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap1');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap1');
Engine.FaceControl(0,false);
Engine.MoveTo(-17754, -250447, -8157);
Engine.MoveTo(-16675, -250454, -8159);
Engine.MoveTo(-16658, -249739, -8159);
end;
procedure go ap2(5);
begin
if User.inrange(-16658, -249739, -8159, 1300, 450) // ap2
then begin
engine.loadzone('ap2');
Print('Загрузил зону ap2');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap2');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap2');
Engine.FaceControl(0,false);
Engine.MoveTo(-16685, -249819, -8159);
Engine.MoveTo(-16631, -250455, -8159);
Engine.MoveTo(-16580, -250804, -8159);
Engine.MoveTo(-15914, -250794, -8157);
end;
procedure go ap3(6);
begin
if User.inrange(-16658, -249739, -8159, 800, 450) // ap3
then begin
engine.loadzone('ap3');
Print('Загрузил зону ap3');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap3');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap3');
Engine.FaceControl(0,false);
Engine.MoveTo(-16048, -250788, -8159);
Engine.MoveTo(-16642, -250727, -8159);
Engine.MoveTo(-16784, -250466, -8159);
Engine.MoveTo(-17223, -250478, -8157);
Engine.MoveTo(-17934, -250467, -8157);
end;
procedure proverka(7);
begin
if User.Dead // умер - бот офф, тп город пауза 12 сек
then begin
Print('Этого Пердуна постигла АНАЛЬНАЯ кара');
Delay(500);
Engine.FaceControl(0,false);
Delay(6111); // полежать чутка а то палевно моментально в город тп
Engine.gohome;
Delay(6000);
end;
begin
while 1<>2 do begin // бесконечный цикл
begin
go Buff(1);
Buff(2);
go TP(3);
go ap1(4);
go ap2(5);
go ap3(6);
proverka(7);
end;
end;
end;
end;
end;
end;
end;
end.
var Fight_Flag:Boolean;
Item: TL2Item;
obj: TL2Npc;
Npc: TL2Npc;
obj2: TL2Effect;
var L2Skill: TL2Skill;
Enemy: TL2Live;
var i, n: Integer;
function mobsInZone : Boolean;
var i: Integer;
MobCaunt: Integer;
begin
MobCaunt:= 0;
for i := 0 to NpcList.Count - 1 do begin
if NpcList.Items(i).InZone and NpcList.Items(i).Attackable then begin
Result := True;
exit;
end;
end;
Result := False;
end;
begin
if mobsInZone
then begin
print('мобы ЕСТЬ');
end else begin
print('мобов НЕТ');
end;
end.
procedure go Buff(1);
begin
Print('Идем к Бафферу');
delay(155);
if User.inrange(80334,54400,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80334,54400,-1552);
Engine.MoveTo(80969,53698,-1558);
Engine.MoveTo(81540,53454,-1494);
Engine.MoveTo(82480,53340,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82323,55466,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82323,55466,-1520);
Engine.MoveTo(82403,54498,-1523);
Engine.MoveTo(82589,53861,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82123,53535,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82123,53535,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80304,56241,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80304,56241,-1552);
Engine.MoveTo(81470,55682,-1523);
Engine.MoveTo(82256,55294,-1523);
Engine.MoveTo(82510,54035,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82445,56012,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82445,56012,-1520);
Engine.MoveTo(82341,54950,-1523);
Engine.MoveTo(82574,53833,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80054,53209,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80054,53209,-1552);
Engine.MoveTo(80624,53611,-1558);
Engine.MoveTo(81772,53468,-1494);
Engine.MoveTo(82289,53472,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80513,52980,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80513,52980,-1552);
Engine.MoveTo(80165,53065,-1558);
Engine.MoveTo(80630,53610,-1558);
Engine.MoveTo(81688,53447,-1494);
Engine.MoveTo(82303,53338,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80267,55497,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80267,55497,-1552);
Engine.MoveTo(80359,54536,-1558);
Engine.MoveTo(80792,53785,-1558);
Engine.MoveTo(81495,53421,-1494);
Engine.MoveTo(82323,53362,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(79933,55752,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(79933,55752,-1552);
Engine.MoveTo(80349,55208,-1558);
Engine.MoveTo(80470,54217,-1558);
Engine.MoveTo(81053,53602,-1558);
Engine.MoveTo(81974,53465,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(80594,55837,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(80594,55837,-1552);
Engine.MoveTo(81899,55492,-1523);
Engine.MoveTo(82240,55142,-1523);
Engine.MoveTo(82531,53946,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82213,53964,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82213,53964,-1488);
Engine.MoveTo(82668,53709,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(83327,55410,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(83327,55410,-1520);
Engine.MoveTo(82607,55592,-1523);
Engine.MoveTo(82184,54809,-1523);
Engine.MoveTo(82563,53882,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(79706,52986,-1552, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(79706,52986,-1552);
Engine.MoveTo(80427,53549,-1558);
Engine.MoveTo(80812,53655,-1558);
Engine.MoveTo(81979,53439,-1494);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82880,55390,-1520, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82880,55390,-1520);
Engine.MoveTo(82375,55524,-1523);
Engine.MoveTo(82367,54313,-1493);
Engine.MoveTo(82651,53734,-1486);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82552,53447,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82552,53447,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
if User.inrange(82638,53885,-1488, 650, 450) then begin
Engine.FaceControl(0, false);
Engine.MoveTo(82638,53885,-1488);
Engine.MoveTo(82950,53186,-1494);
Engine.MoveTo(82936, 53112, -1488);
Engine.MoveTo(82951, 53459, -1480);
end;
procedure Buff(2);
begin
Print('Баффаемся');
delay(155);
if User.inrange(82951, 53459, -1480, 450, 250)
then begin // с етим бегином сцепленно если!
Engine.MoveTo(82951, 53459, -1480);
Engine.Settarget(31360); //Таргет Баффера
Engine.Dlgopen;
delay(2111);
Engine.DlgSel(16);
delay(2111);
Engine.Dlgopen;
delay(1111);
Engine.DlgSel(1);
delay(2222);
end;
procedure go TP(3);
begin
Print('Идем к ТП, ТПшимся');
delay(155);
Engine.MoveTo(83076, 53115, -1490);
Engine.SetTarget(31031); // Gatekeeper
delay(1111);
Engine.DlgOpen;
delay(1111);
Engine.DlgSel(17);
delay(7000);
Engine.MoveTo(-20209, -250622, -8158);
Engine.MoveTo(-20040, -250734, -8157);
Engine.MoveTo(-19667, -250791, -8159);
Engine.MoveTo(-19139, -250705, -8159);
Engine.MoveTo(-18993, -250447, -8159);
Engine.MoveTo(-18573, -250465, -8157);
Engine.MoveTo(-17934, -250467, -8157);
end;
procedure go ap1(4);
begin
Print('Идем в 1-ю комнату');
delay(155);
if User.inrange(-17934, -250467, -8157, 1000, 450) // AP1
then begin
engine.loadzone('ap1');
Print('Загрузил зону AP-1');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap1');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap1');
Engine.FaceControl(0,false);
Engine.MoveTo(-17754, -250447, -8157);
Engine.MoveTo(-16675, -250454, -8159);
Engine.MoveTo(-16658, -249739, -8159);
end;
procedure go ap2(5);
begin
if User.inrange(-16658, -249739, -8159, 1300, 450) // ap2
then begin
engine.loadzone('ap2');
Print('Загрузил зону ap2');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap2');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap2');
Engine.FaceControl(0,false);
Engine.MoveTo(-16685, -249819, -8159);
Engine.MoveTo(-16631, -250455, -8159);
Engine.MoveTo(-16580, -250804, -8159);
Engine.MoveTo(-15914, -250794, -8157);
end;
procedure go ap3(6);
begin
if User.inrange(-16658, -249739, -8159, 800, 450) // ap3
then begin
engine.loadzone('ap3');
Print('Загрузил зону ap3');
delay(555);
if mobsInZone
then begin
print('мобы ЕСТЬ ap3');
Engine.FaceControl(0,true);
delay(1111);
end;
if not mobsInZone
then begin
print('мобов НЕТ ap3');
Engine.FaceControl(0,false);
Engine.MoveTo(-16048, -250788, -8159);
Engine.MoveTo(-16642, -250727, -8159);
Engine.MoveTo(-16784, -250466, -8159);
Engine.MoveTo(-17223, -250478, -8157);
Engine.MoveTo(-17934, -250467, -8157);
end;
procedure proverka(7);
begin
if User.Dead // умер - бот офф, тп город пауза 12 сек
then begin
Print('Этого Пердуна постигла АНАЛЬНАЯ кара');
Delay(500);
Engine.FaceControl(0,false);
Delay(6111); // полежать чутка а то палевно моментально в город тп
Engine.gohome;
Delay(6000);
end;
begin
while 1<>2 do begin // бесконечный цикл
begin
go Buff(1);
Buff(2);
go TP(3);
go ap1(4);
go ap2(5);
go ap3(6);
proverka(7);
end;
end;
end;
end;
end;
end;
end;
end.
ЗЫ. Старт в Орене, далее делает с глобал ГК с тп в апостаты и условно должен фармить первые 3 комнаты