- Рег
- 7 Дек 2015
- Сообщения
- 125
- Реакции
- 0
В общем,начиная интересоваться скриптами,я решил попробовать написать квест на 1 профу всех персонажей.В общем,решил с светлого эльфа начать.У меня в скрипте встречаются проблема при проверке итемов.Бот должен набить 20 итемов и юзнуть сое,он убивает 1-2 моба и юзает сое,при этом не проверяя нужное кол-во итемов.Вот сам скрипт.Помогите и форум будет забит новыми скриптами:3
Uses SysUtils, Classes;
var Item: TL2Item; Npc: TL2Npc; obj: TL2NPC; L2Skill: TL2Skill; Control: TL2Control;
function CheckStatus: Boolean;
begin
Result:= true;
if User.Dead then begin
Print('Dead. Pressing to vellage.');
Delay(1000);
Engine.FaceControl(0, false);
Engine.GoHome;
Delay(10000);
end;
Result := false;
end;
function CheckItemCount (const itemID: Integer; const quest: Boolean = False) : Integer;
var tempItem: TL2Item;
begin
if quest then Inventory.Quest.ByID(itemID, tempItem)
else Inventory.User.ByID(itemID, tempItem);
Result := tempItem.Count;
end;
begin
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(3);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-12718,122669,-3112);
Engine.Settarget(30256); // Таргет Bella
Engine.Dlgopen;
Engine.DlgSel(2);
Delay(1500);
Engine.DlgSel(16);
Delay(1500);
Engine.MoveTo(-41917,122481,-3056);
Engine.MoveTo(-42554,119859,-3528);
Engine.MoveTo(-43125,118517,-3560);
Engine.Settarget(20060); //Таргет Raging Spartoi
Engine.Attack(50);
while CheckItemCount(1205, True) < 20 then
Engine.FaceControl(0, True);
Engine.UseItem(736);
Engine.MoveTo(-14102,122827,-3112);
Engine.MoveTo(-13502,122756,-3104);
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-12718,122669,-3112);
Engine.Settarget(30256); // Таргет Bella
Engine.Dlgopen;
Engine.DlgSel(2);
Delay(1500);
Engine.DlgSel(9);
Delay(1500);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-83032,155307,-3176);
Engine.MoveTo(-83038,155441,-3176);
Engine.Settarget(30317); // Таргет Kluto
Engine.Dlgopen;
Engine.DlgSel(9);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-82993,154956,-3168);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-80812,149996,-3040);
Engine.Settarget(30320); // Таргет Richlin
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(14);
Delay(1500);
Engine.MoveTo(-50345,148577,-2744);
Engine.MoveTo(-48694,151299,-2936);
Engine.Settarget(20782); //Таргет Ol-Mahum Novices
Engine.Attack(50);
while CheckItemCount(1206, True) < 20 then
Engine.FaceControl(0, True);
Engine.UseItem(736);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-83032,155307,-3176);
Engine.MoveTo(-83038,155441,-3176);
Engine.Settarget(30317); // Таргет Kluto
Engine.Dlgopen;
Engine.DlgSel(9);
Delay(1500);
Engine.MoveTo(-82993,154956,-3168);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-80812,149996,-3040);
Engine.Settarget(30320); // Таргет Richlin
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-12718,122669,-3112);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-13502,122756,-3104);
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
end.
var Item: TL2Item; Npc: TL2Npc; obj: TL2NPC; L2Skill: TL2Skill; Control: TL2Control;
function CheckStatus: Boolean;
begin
Result:= true;
if User.Dead then begin
Print('Dead. Pressing to vellage.');
Delay(1000);
Engine.FaceControl(0, false);
Engine.GoHome;
Delay(10000);
end;
Result := false;
end;
function CheckItemCount (const itemID: Integer; const quest: Boolean = False) : Integer;
var tempItem: TL2Item;
begin
if quest then Inventory.Quest.ByID(itemID, tempItem)
else Inventory.User.ByID(itemID, tempItem);
Result := tempItem.Count;
end;
begin
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(3);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-12718,122669,-3112);
Engine.Settarget(30256); // Таргет Bella
Engine.Dlgopen;
Engine.DlgSel(2);
Delay(1500);
Engine.DlgSel(16);
Delay(1500);
Engine.MoveTo(-41917,122481,-3056);
Engine.MoveTo(-42554,119859,-3528);
Engine.MoveTo(-43125,118517,-3560);
Engine.Settarget(20060); //Таргет Raging Spartoi
Engine.Attack(50);
while CheckItemCount(1205, True) < 20 then
Engine.FaceControl(0, True);
Engine.UseItem(736);
Engine.MoveTo(-14102,122827,-3112);
Engine.MoveTo(-13502,122756,-3104);
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-12718,122669,-3112);
Engine.Settarget(30256); // Таргет Bella
Engine.Dlgopen;
Engine.DlgSel(2);
Delay(1500);
Engine.DlgSel(9);
Delay(1500);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-83032,155307,-3176);
Engine.MoveTo(-83038,155441,-3176);
Engine.Settarget(30317); // Таргет Kluto
Engine.Dlgopen;
Engine.DlgSel(9);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-82993,154956,-3168);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-80812,149996,-3040);
Engine.Settarget(30320); // Таргет Richlin
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(14);
Delay(1500);
Engine.MoveTo(-50345,148577,-2744);
Engine.MoveTo(-48694,151299,-2936);
Engine.Settarget(20782); //Таргет Ol-Mahum Novices
Engine.Attack(50);
while CheckItemCount(1206, True) < 20 then
Engine.FaceControl(0, True);
Engine.UseItem(736);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-83032,155307,-3176);
Engine.MoveTo(-83038,155441,-3176);
Engine.Settarget(30317); // Таргет Kluto
Engine.Dlgopen;
Engine.DlgSel(9);
Delay(1500);
Engine.MoveTo(-82993,154956,-3168);
Engine.MoveTo(-82996,151749,-3120);
Engine.MoveTo(-80812,149996,-3040);
Engine.Settarget(30320); // Таргет Richlin
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
Engine.DlgSel(1);
Delay(1500);
Engine.MoveTo(-12718,122669,-3112);
Engine.MoveTo(-13300,122669,-3048);
Engine.MoveTo(-13302,122409,-2984);
Engine.MoveTo(-14080,122141,-2984);
Engine.MoveTo(-14116,122776,-3112);
Engine.MoveTo(-13693,122772,-3104);
Engine.MoveTo(-13502,122756,-3104);
Engine.Settarget(30327); //Таргет Sorius
Engine.Dlgopen;
Engine.DlgSel(1);
Delay(1500);
end.