Форум работает в тестовом режиме. Все данные были перенесены со старого сайта 2018 года. Некоторая информация может быть недоступна, например вложения или хайды. Просьба сообщать о данных случаях через функционал "Жалоба", прямо под постом, где отсуствуют данные из хайда или проблемы с вложением.
Могут быть проблемы в "выкидыванием" с форума (слетевшей авторизацией). Нужно собрать статистику таких случаев.
Есть Тема, куда можете сообщить о проблемах с сайтом либо просто передать привет.

Подборка готовых, полу-готовых скриптов

Рег
12 Авг 2015
Сообщения
13
Реакции
0
Давно не играю и бота нет под рукой чтобы проверить. Однако мимо проходил и кое что интересное нарыл...
Разгребайте))

//------------------------------------------------------
// Процедуры
//------------------------------------------------------
procedure Dead();
begin
// умер- вырубаем интерфейс, возврат в город и пауза 1.5 секунд
if User.Dead then
begin
//Town();
Engine.FaceControl(0,false);
Engine.gohome;
delay(1500);
end;
end;


//---------------------------------------------------
//Точки спавна + путь к ГК
//---------------------------------------------------
procedure Town1();
begin
//---------------------------------------------------
//Бежать на Спот
//---------------------------------------------------
//В Engine.inrange пишем Стартовую координату(примерную) и
//маршрут куда бежать вписываем в Engine.MoveTo
//(Меняем и\или Добавляем\Удаляем строки с точками маршрута
//---------------------------------------------------------------
//Engine.FaceControl - НЕ ТРОГАЕМ
//---------------------------------------------------
if User.inrange(116878,77197,-2688,500,500) then
begin
Engine.MoveTo(115518,77664,-2734);
//delay (3000);
Engine.MoveTo(114135,78172,-2618);
//delay (3000);
Engine.MoveTo(112292,78540,-2597);
//delay (3000);
Engine.MoveTo(109516,77508,-2064);
//delay (3000);
Engine.MoveTo(106505,77443,-1597);
//delay (3000);
Engine.MoveTo(105581,79859,-2430);
// Врубаем Интерфейс
//------------------------------------------------------
if User.inrange(105581,79859,-2430,500,500) then
begin
Engine.FaceControl(0,true);
end;
end;
end;
//------------------------------------------------------
// Town2
//------------------------------------------------------
procedure Town2();
begin

if User.inrange(147255,25846,-2039,500,500) then
begin
Engine.MoveTo(148101,27638,-2240);
//delay (3000);
Engine.MoveTo(149852,27610,-2295);
//delay (3000);
Engine.MoveTo(149906,25155,-2167);
//delay (3000);
Engine.MoveTo(151897,25144,-2172);
//delay (3000);
Engine.MoveTo(153705,25829,-2253);
//delay (3000);
Engine.MoveTo(154781,23200,-3160);
//delay (3000);
Engine.MoveTo(154809,20732,-3686);
//delay (3000);
Engine.MoveTo(156202,19764,-3723);
//delay (3000);
Engine.MoveTo(158095,20469,-3714);
//delay (3000);
Engine.MoveTo(160894,21790,-3737);
// Врубаем Интерфейс
//------------------------------------------------------
if User.inrange(160894,21790,-3737,500,500) then
begin
Engine.FaceControl(0,true);
end;
end;
end;

//------------------------------------------------------
// Town3
//------------------------------------------------------
procedure Town3();
begin

if User.inrange(147255,25846,-2039,500,500) then
begin
Engine.MoveTo(146822,25833,-2008);
if User.inrange(146822,25833,-2008,500,500) then
begin
engine.SetTarget(30848);
Engine.DlgOpen;
Engine.DlgSel(1);
Engine.DlgSel(20);
ConfirmDialog(accept)
Engine.CancelTarget;
delay(5000);
end;

if User.inrange(183533,-14981,-2776,500,500) then
begin

Engine.MoveTo(183688,-14745,-2824);

Engine.MoveTo(183792,-14493,-2845);

Engine.MoveTo(183982,-14195,-2867);

Engine.MoveTo(184100,-13857,-2899);

Engine.MoveTo(184211,-13162,-2990);

Engine.MoveTo(184008,-12452,-3032);

Engine.MoveTo(183688,-12151,-3084);

Engine.MoveTo(183189,-11740,-3208);

Engine.MoveTo(182697,-11282,-3336);

Engine.MoveTo(182039,-10645,-3396);

Engine.MoveTo(181489,-9943,-3384);
// Врубаем Интерфейс
//------------------------------------------------------
if User.inrange(181489,-9943,-3384,500,500) then
begin
Engine.FaceControl(0,true);
end;
end;
end;

//------------------------------------------------------
// Подбегаем к баферу и Бафаемся
//------------------------------------------------------
procedure buff1();
begin

if User.inrange(118268,74807,-2575,500,500)
or
User.inrange(115856,75170,-2592,500,500)
or
User.inrange(115668,77610,-2694,500,500)
or
User.inrange(116122,76015,-2720,500,500)

then
begin
Engine.MoveTo(116595,76165,-2755);
Engine.MoveTo(116878,77197,-2688);

//В User.inrange пишем координаты Бафера(примерные)
if User.inrange(116878,77197,-2688,750,750) then
begin
Buffer();
Town1();
end;
end;
end;

//------------------------------------------------------
// buff2
//------------------------------------------------------

procedure buff2();
begin

if User.inrange(147464,20164,-2008,500,500)
//or
//User.inrange(115856,75170,-2592,500,500)
//or
//User.inrange(115668,77610,-2694,500,500)
//or
//User.inrange(116122,76015,-2720,500,500)

then
begin
Engine.MoveTo(149844,22753,-2167);
Engine.MoveTo(149852,27610,-2295);
Engine.MoveTo(148101,27638,-2240);
Engine.MoveTo(147255,25846,-2039);

//В User.inrange пишем координаты Бафера(примерные)
if User.inrange(147255,25846,-2039,750,750) then
begin
Buffer();
Town2();
end;
end;
end;

//------------------------------------------------------
// buff3
//------------------------------------------------------
procedure buff3();
begin

if User.inrange(147464,20164,-2008,500,500)
//or
//User.inrange(115856,75170,-2592,500,500)
//or
//User.inrange(115668,77610,-2694,500,500)
//or
//User.inrange(116122,76015,-2720,500,500)

then
begin
Engine.MoveTo(149844,22753,-2167);
Engine.MoveTo(149852,27610,-2295);
Engine.MoveTo(148101,27638,-2240);
Engine.MoveTo(147255,25846,-2039);

//В User.inrange пишем координаты Бафера(примерные)
if User.inrange(147255,25846,-2039,750,750) then
begin
Buffer();
Town2();
end;
end;
end;

//------------------------------------------------------
// Функции
//------------------------------------------------------

//------------------------------------------------------
// Buff\ТТ
//------------------------------------------------------
function Buff(value:string):boolean;
var
s:string;
bypass:string;
i:integer;
b:boolean;
mass:array [1..100] of string;
Obj: TL2Buff;
begin
//---------------------------------------------------------------
//В Engine.Settarget пишем ID Баффера
//---------------------------------------------------------------
Engine.Settarget(32327);
Engine.DlgOpen();
s:=Engine.DlgText;
b:=true;
i:=1;
while b do
begin
Delete(s,1,Pos(' mass:=Copy(s,1,Pos('>',s));
Delete(s,1,Length(mass));
inc(i);
if Pos(' b:=false;
end;
for i:=1 to 100 do
if mass <> '' then
if Pos(value,mass) <> 0 then
begin
bypass := mass;
delete(bypass,1,pos('action="',bypass)+17);
bypass:=Copy(bypass,1,pos('"',bypass)-1);
break;
end;
Engine.ByPassToServer(bypass);
end;
procedure Buffer();
begin
//---------------------------------------------------------------
//В engine.SetTarget пишем ID Бафера
//(не меняется с местом), в Engine.DlgSel Пункты меню
//---------------------------------------------------------------
engine.SetTarget(32327);
Engine.DlgOpen;
Engine.DlgSel(1);
Engine.DlgSel(1);
Engine.CancelTarget;
delay(5000);
end;

var obj: TL2NPC;
obj2: TL2Effect;

Enemy: TL2Live;
Begin
while 1<>2 do begin // бесконечный цикл
Dead();
//------------------------------------------------------
// Точки респа

//------------------------------------------------------
delay(300);
//------------------------------------------------------
// Подбегаем к баферу и Бафаемся
//------------------------------------------------------
// 35-47
begin
buff1();
Buffer();
Town1();
end;

//------------------------------------------------------
//47-55
begin
buff2();
Buffer();
Town2();
end;

//------------------------------------------------------
//55-63
begin
buff3();
Buffer();
Town3();
end;
end;
//------------------------------------------------------
// Условия
//------------------------------------------------------
if (User.Level>=35) and (User.Level<47) then
begin
buff1();
end;

if (User.Level>=47) and (User.Level<55) then
begin
buff2();
end;

if (User.Level>=55) and (User.Level<63) then
begin
buff3();
end;
//------------------------------------------------------
//---------------------------------------------------------------
end.


// Script crafts up all materials available for lunargent and helfire oil craft.
// Script made to work and is tested only on l2Neo server.
// It may or may not work in other servers with same mixing urn's dialogs.
var
vDelay: Integer = 800;
item: TL2Item;

function countReagents(vWhat: String): Integer; begin
case vWhat of
'Moonstone Shard': Inventory.User.ByID(6013, item);
'Volcanic Ash': Inventory.User.ByID(6018, item);
'Quicksilver': Inventory.User.ByID(6019, item);
'Lava Stone': Inventory.User.ByID(6012, item);
'Demon Blood': Inventory.User.ByID(6015, item);
'Blood Root': Inventory.User.ByID(6017, item);
'Sulfur': Inventory.User.ByID(6020, item);

'Moon Dust': Inventory.User.ByID(6023, item);
'Magma Dust': Inventory.User.ByID(6022, item);
'Demonplasm': Inventory.User.ByID(6025, item);

'Fire Essence': Inventory.User.ByID(6028, item);
'Demonic Essence': Inventory.User.ByID(6031, item);
'Lunargent': Inventory.User.ByID(6029, item);

'Helfire Oil': Inventory.User.ByID(6033, item);
else print(vWhat + ' not supported in countReagents');
end;
Result := item.Count();
end;
function hasEnoughFor(vWhat: String): Boolean; begin
case vWhat of
'Moon Dust': Result := (countReagents('Moonstone Shard') >= 10) and (countReagents('Volcanic Ash') >= 1);
'Magma Dust': Result := (countReagents('Lava Stone') >= 10) and (countReagents('Volcanic Ash') >= 1);
'Demonplasm': Result := (countReagents('Demon Blood') >= 10) and (countReagents('Blood Root') >= 1);
'Fire Essence': Result := (countReagents('Magma Dust') >= 10) and (countReagents('Sulfur') >= 1);
'Demonic Essence': Result := (countReagents('Demonplasm') >= 10) and (countReagents('Sulfur') >= 1);
'Lunargent': Result := (countReagents('Moon Dust') >= 10) and (countReagents('Quicksilver') >= 1);
'Helfire Oil': Result := (countReagents('Fire Essence') >= 1) and (countReagents('Demonic Essence') >= 1);
end;
if not Result then print('Not enough to craft ' + vWhat + '.');
end;
function mix(vWhat: String): Boolean; begin
case vWhat of
'Helfire Oil': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_I_6028'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6031'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Lunargent': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6023'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6019'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Demonic Essence': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6025'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6020'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Fire Essence': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6022'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6020'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Magma Dust': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6012'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6018'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Demonplasm': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6015'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6017'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
'Moon Dust': begin
Engine.ByPassToServer('Quest 373_SupplierOfReagents U_I_Insert'); delay(vDelay);// Insert1
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_2_I_6013'); delay(vDelay);// 10x MS
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents U_C_Insert'); delay(vDelay); // Insert2
Engine.ByPassToServer('Quest 373_SupplierOfReagents x_1_C_6018'); delay(vDelay); // 1x Volcanic Ash
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-5.htm'); delay(vDelay); // select temperature
Engine.ByPassToServer('Quest 373_SupplierOfReagents tmp_1'); delay(vDelay); // tmp_1
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.

Engine.ByPassToServer('Quest 373_SupplierOfReagents 31149-6.htm'); delay(vDelay); // Mix Ingredients
Engine.ByPassToServer('Quest 373_SupplierOfReagents urn'); delay(vDelay);// back to urn.
end;
end;
end;
begin
while hasEnoughFor('Moon Dust') do mix('Moon Dust');
while hasEnoughFor('Lunargent') do mix('Lunargent');

while hasEnoughFor('Magma Dust') do mix('Magma Dust');
while hasEnoughFor('Demonplasm') do mix('Demonplasm');

while hasEnoughFor('Fire Essence') do mix('Fire Essence');
while hasEnoughFor('Demonic Essence') do mix('Demonic Essence');

while hasEnoughFor('Helfire Oil') do mix('Helfire Oil');
end.

// Условие: необходимо призвать суммона и бафнуть ему рефлект
// Change nick1, nick2 values to both tank names.
// Change BUFF_ID, TRIGGER_ID, SOS_ID for respective Pheonix Knight skills if it is used, otherwise do not change.
const
nick1: String = 'sosas1'; // tank1 name
nick2: String = 'sosas2'; // tank2 name
SOS_ID = 789; // Spirit of Shilen ID
BUFF_ID = 788; // Pain of Shilen ID
TRIGGER_ID = 5564; // Pain of Shilen trigger ID


//
// Do not change anything after this point.
//
var
sosSkill: TL2skill;
sosBuff, buffBuff, triggerBuff: TL2buff;
part: String;
Control: TL2Control;
vUser: TL2User;
tempInt: Integer;
function min(x: Integer; y: Integer): Integer; begin
if x<=y then Result := x
else Result := y;
end;
function Charge(Control: TL2Control): Boolean; begin
Result := false;
while not Result do begin // while not 3lv BUFF_ID
if (Control.GetPetList().Items(0) = nil) or Control.GetPetList().Items(0).Dead then
begin
Control.EnterText('#There is no summon to hit!');
break;
end else begin
Control.GetUser.Buffs.ByID(BUFF_ID, buffBuff);
Control.GetUser.Buffs.ByID(TRIGGER_ID, triggerBuff);
if (triggerBuff.EndTime + buffBuff.EndTime = 0) then // jei nera nei 0lvl nei charginamo bufo dar uzmesto
Control.UseSkill(BUFF_ID);
Control.SetTarget(Control.GetPetList().Items(0)); // Target summon
Control.Attack(2000, true); // AttackForce the summon
Delay(100);
Result := triggerBuff.level >= 3;
if Result then begin // jei 3 lvl bufas, nustoti musti sumona
vUser := Control.GetUser;
Control.MoveTo(vUser.X, vUser.Y, vUser.Z);
end;
end;
end;
end;
function doSOSNext(nick: String): Boolean; begin
Control:= GetControl(nick);
if Control = nil then Print('There is no such nick ' + nick)
else begin
while Control.GetSkillList.ByID(SOS_ID, sosSkill) and (sosSkill.EndTime > 30000) do delay(500);
while Control.GetUser.Buffs.ByID(SOS_ID, sosBuff) and (sosBuff.EndTime > 25000) do delay(100); // wait SOS to be less than 25 seconds
Control.UseSkill(BUFF_ID); // uses BUFF_ID in advance to save time.
while Control.GetUser.Buffs.ByID(SOS_ID, sosBuff) and (sosBuff.EndTime > 20000) do delay(100); // waits SOS to be less than 20 seconds before starting
Charge(Control); // Charge up BUFF_ID to 3lv
if Control.GetSkillList.ByID(SOS_ID, sosSkill) and (sosSkill.EndTime > 20000) then begin // if sos wont reuse in 20 seconds, starts all over again.
Control.Dispel(TRIGGer_ID);// remove 3lv buff
Result := doSOSNext(nick);// start all over again (same char)
end else begin
while(sosSkill.EndTime>0) do delay(50); // Wait for sosSkill to reuse.
while Control.GetUser.Buffs.ByID(TRIGGER_ID, triggerBuff) and Control.GetUser.Buffs.ByID(SOS_ID, sosBuff) and (min(sosBuff.EndTime, triggerBuff.EndTime) > 1000) do
delay(50);
Control.UseSkill(SOS_ID); delay(1000);
end;
end;
end;

begin
Control := GetControl(nick1);
Control.GetSkillList.ByID(SOS_ID, sosSkill);
tempInt := sosSkill.EndTime;
Control := GetControl(nick2);
Control.GetSkillList.ByID(SOS_ID, sosSkill);
if sosSkill.EndTime < tempInt then begin // starts with tank2 if it's SOS reuse is shorter.
doSOSNext(nick2); delay(500);
end;
while true do begin
doSOSNext(nick1);
doSOSNext(nick2);
end;
end.

{*******************************************************
Copyright (c) 2015 Immortal Pony
Tested on 4Game Classic
*******************************************************}
uses SysUtils, Classes;

type
TPoint = packed record
X: Longint;
Y: Longint;
end;

PPoint = ^TPoint;

function GetKeyState(nVirtKey: Integer): byte; stdcall;
external 'user32.dll' name 'GetKeyState';

function KeyDown(K: byte): Boolean;
begin
Result := (K = 128) or (K = 129)
end;

function SHIFT: Boolean;
begin
Result := KeyDown(GetKeyState($10));
end;

function CTRL: Boolean;
begin
Result := KeyDown(GetKeyState($11));
end;

function ALT: Boolean;
begin
Result := KeyDown(GetKeyState($12));
end;

function GetPosForNewBorder(ZMap: TStringList): Integer;
begin
if Pos('', ZMap.Text) = 0 then
begin
ZMap.Insert(0, '');
ZMap.Insert(0, '');
ZMap.Insert(0, '');
ZMap.Insert(0, '');
ZMap.Insert(0, '');
ZMap.Insert(0, '');
ZMap.Insert(0, '');
end;
Result := 4;
end;

function GetPosForNewObstruction(ZMap: TStringList): Integer;
var
i, Line: Integer;

begin
for i:=0 to ZMap.Count - 1 do
if Pos('', ZMap) <> 0 then break;
Line := i + 1;
if Pos('', ZMap.Text) = 0 then
begin
ZMap.Insert(Line, '');
ZMap.Insert(Line, '');
end;
Line := Line + 1;
ZMap.Insert(Line, '');
ZMap.Insert(Line, '');
ZMap.Insert(Line, '');
ZMap.Insert(Line, '');
Result := Line + 2;
end;

procedure ZMapperProcedure(p: pointer); // ����� ��� ��������/��������� �������
var
KeyCode, I: Integer;
Obstruction: TList;
Border: TList;
ZMap: TStringList;
FileName: string;
Point: PPoint;
Line: Integer;
begin
FileName := './Settings/test.zmap';
ZMap := TStringList.Create;
Border := TList.Create;
Obstruction := TList.Create;
while Engine.Status = lsOnline do
begin // ���� ��������� ���� ��� � ���� (Online)
Engine.WaitAction([laKey], KeyCode, I);
// **
if SHIFT and (KeyCode = $43) then // Shift + "C"
begin
New(Point);
Point.X := User.X;
Point.Y := User.Y;
Print('New obstruction point: ' + IntToStr(Point.X) + ' ' + IntToStr(Point.Y));
Obstruction.Add(Point);
end;
// **
if CTRL and (KeyCode = $53) then // Ctrl + "S"
begin
ZMap.Clear;
if FileExists(FileName) then ZMap.LoadFromFile(FileName);
Line := GetPosForNewBorder( ZMap );
for I := 0 to Border.Count - 1 do
begin
Point := PPoint(Border);
ZMap.Insert(Line, '');
Dispose(Border);
Inc(Line);
end;
Border.Clear;
if Obstruction.Count > 0 then Line := GetPosForNewObstruction( ZMap );

for I := 0 to Obstruction.Count - 1 do
begin
Point := PPoint(Obstruction);
ZMap.Insert(Line, '');
Dispose(Obstruction);
Inc(Line);
end;
Obstruction.Clear;

ZMap.SaveToFile(FileName);
Print('ZMap updated: ' + FileName);
end;
// **
if SHIFT and (KeyCode = $58) then // Shift + "X"
begin
New(Point);
Point.X := User.X;
Point.Y := User.Y;
Print('New border point: ' + IntToStr(Point.X) + ' ' + IntToStr(Point.Y));
Border.Add(Point);
end;
// **
if CTRL and (KeyCode = $44) then // Ctrl + "D"
begin
Engine.LoadZone(FileName);
Print('ZMap reloaded: ' + FileName);
end;
end;
Dispose(Point);
ZMap.Free;
Border.Free;
Obstruction.Free;
end;

begin
Script.NewThread(@ZMapperProcedure);
Delay(-1); // ����������� �����

end.


{*******************************************************
Copyright (c) 2015 Immortal Pony
Tested on 4Game Classic
*******************************************************}

uses SysUtils, Classes;

type
TPoint = packed record
X: Longint;
Y: Longint;
end;

PPoint = ^TPoint;

function ExtractIntegerValue(ZMap: string; var Start: Integer): Integer;
var
Finish: Integer;
begin
Start := PosEx('="', ZMap, Start) + Length('="');
Finish := PosEx('"', ZMap, Start);
Result := StrToInt(Copy(ZMap, Start, Finish - Start));
end;

function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer;
var
I, X: Integer;
Len, LenSubStr: Integer;
begin
if Offset = 1 then
Result := Pos(SubStr, S)
else
begin
I := Offset;
LenSubStr := Length(SubStr);
Len := Length(S) - LenSubStr + 1;
while I <= Len do
begin
if S = SubStr[1] then
begin
X := 1;
while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do
Inc(X);
if (X = LenSubStr) then
begin
Result := I;
exit;
end;
end;
Inc(I);
end;
Result := 0;
end;
end;

procedure GetPolies(ZMap: string; Polies: TList);
var
Offset: Integer;
OffsetInner: Integer;
CloseTag: Integer;
PointTag: Integer;
Poly: TList;
Point: PPoint;
begin
Offset := PosEx('', ZMap, 1);
while Offset <> 0 do
begin
CloseTag := PosEx('', ZMap, Offset);
Poly := TList.Create;
OffsetInner := PosEx('', ZMap, Offset + Length(''));
end;
end;

var
Polies: TList;
I, j: Integer;
Strings: TStringList;
Point: PPoint;

begin
Strings := TStringList.Create;
Polies := TList.Create;
Strings.LoadFromFile('./Settings/1.zmap');
GetPolies(Strings.Text, Polies);
for I := 0 to Polies.Count - 1 do
begin
Print('Poly # ' + IntToStr(I + 1));
for j := 0 to TList(Polies).Count - 1 do
begin
Point := PPoint(TList(Polies)[j]);
Print(IntToStr(Point.X) + ' ' + IntToStr(Point.Y));
Dispose(Point);
end;
end;
Strings.Free;
Polies.Free;
end.


{*******************************************************
Copyright (c) 2016 Immortal Pony
Tested on 4Game Classic
*******************************************************}
unit ZMapParser;

interface

uses SysUtils, Classes;

type
TPoint = packed record
X: Longint;
Y: Longint;
end;
PPoint = ^TPoint;

function ExtractIntegerValue( ZMap : string; var Start : Integer ) : Integer;
function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer;

implementation

function ExtractIntegerValue( ZMap : string; var Start : Integer ) : Integer;
var
Finish : Integer;
begin
Start := PosEx( '="', ZMap, Start ) + Length('="');
Finish := PosEx( '"', ZMap, Start );
Result := StrToInt( Copy( ZMap, Start, Finish - Start ) );
end;

function PosEx(const SubStr, S: string; Offset: Integer = 1): Integer;
var
I,X: Integer;
Len, LenSubStr: Integer;
begin
if Offset = 1 then
Result := Pos(SubStr, S)
else
begin
I := Offset;
LenSubStr := Length(SubStr);
Len := Length(S) - LenSubStr + 1;
while I <= Len do
begin
if S = SubStr[1] then
begin
X := 1;
while (X < LenSubStr) and (S[I + X] = SubStr[X + 1]) do
Inc(X);
if (X = LenSubStr) then
begin
Result := I;
exit;
end;
end;
Inc(I);
end;
Result := 0;
end;
end;

procedure GetPolies( ZMap : string; Polies : TList );
var
Offset : Integer;
OffsetInner : Integer;
CloseTag : Integer;
PointTag : Integer;
Poly : TList;
Point : PPoint;
begin
Offset := PosEx( '', ZMap, 1 );
while Offset <> 0 do
begin
CloseTag := PosEx( '', ZMap, Offset );
Poly := TList.Create;
OffsetInner := PosEx( '', ZMap, Offset + Length( '' ) );
end;
end;


{*******************************************************
Copyright (c) 2016 Immortal Pony
Tested on Lineage2.com Classic
*******************************************************}

unit Pathfinder;

interface

uses SysUtils, Classes;

function MoveTo( X, Y : Integer ) : Boolean;
function GpsMoveTo(x, y, z: integer): boolean; // GPS движение
procedure RecordPath(p: pointer);

type
TPoint = packed record
X: Integer;
Y: Integer;
Z: Integer;
end;

PPoint = ^TPoint;

TRange = packed record
X : Integer;
Y : Integer;
Z : Integer;
Range : Cardinal;
ZRange : Cardinal;
end;

const
Cedric : TRange = ( X : -72018; Y : 258963; Z : -3141; Range : 5000; ZRange : 5000 );

function UserInRange( Range : TRange ) : Boolean;
function GetMyLocation : string;

implementation

function UserInRange( Range : TRange ) : Boolean;
var
Loaction : string;
begin
Result := User.InRange(Range.X, Range.Y, Range.Z, Range.Range, Range.ZRange);
end;

function GetMyLocation : string;
begin
Result := 'Unknown Location';
if UserInRange(Cedric) then begin Result := 'Cedric Training Hall'; exit; end;
end;

function GetLastId( SQL : TStringList ) : Integer;
var
Start, Finish, Last : Integer;
Str : string;
begin
Result := -1;
Start := 0;
Last := SQL.Count;
while Last > 0 do
begin
Dec(Last);
if Pos('Point',SQL[Last]) <> 0 then
begin
Start := Pos('VALUES (',SQL[Last]);
break;
end;
end;
if Start = 0 then exit;
Start := Start + Length('VALUES (');
Str := Copy(SQL[Last], Start, Length(SQL[Last]));
Finish := Pos(',',Str) - 1;
Str := Copy(SQL[Last], Start, Finish);
Result := StrToInt(Str);
end;

procedure RecordPath(p: pointer);
var
SQL : TStringList;
FileName, PointName : string;
PointLast, PointNew : PPoint;
IdLast, IdNew, Radius : Integer;
FistRecord : Boolean;
begin
FileName := './sql.txt';
SQL := TStringList.Create;
New(PointLast);
New(PointNew);
PointLast.X := 0;
PointLast.Y := 0;
PointLast.Z := 0;
Radius := 250;
IdLast := -1;
FistRecord := true;
if FileExists(FileName) then
begin
SQL.LoadFromFile(FileName);
IdLast := GetLastId(SQL);
end;
IdNew := IdLast + 1;
while Engine.Status = lsOnline do
begin
PointNew.X := User.ToX;
PointNew.Y := User.ToY;
PointNew.Z := User.ToZ;
if (PointNew.X <> PointLast.X) or (PointNew.Y <> PointLast.Y) or (PointNew.Z <> PointLast.Z) then
begin
PointName := GetMyLocation;
SQL.Add('INSERT INTO Point (id,x,y,z,name,radius) VALUES ('+ IntToStr(IdNew) +','+ IntToStr(PointNew.X) + ',' + IntToStr(PointNew.Y) + ',' + IntToStr(PointNew.Z) + ',''' + PointName + ''',' + IntToStr(Radius) + ');');
if not FistRecord then
SQL.Add('INSERT INTO Link (start_point_id,End_point_id, one_way) VALUES ('+ IntToStr(IdLast) +','+ IntToStr(IdNew) +',0);');
SQL.SaveToFile(FileName);
PointLast.X := PointNew.X;
PointLast.Y := PointNew.Y;
PointLast.Z := PointNew.Z;
IdLast := IdNew;
Inc(IdNew);
FistRecord := false;
end;
end;
Dispose(PointLast);
Dispose(PointNew);
Sql.Free;
end;

function MoveTo( X, Y : Integer ) : Boolean;
var
j: Integer;
Point: PPoint;
PathList : TList;
Path : TList;
begin
PathList := TList.Create;
Path := TList.Create;
if not Engine.FindPath(User.X, User.Y, X, Y, PathList) then
Print('Path not found.');
j := 0;
while j < PathList.Count do
begin
New(Point);
Point.X := Integer(PathList[j]);
Point.Y := Integer(PathList[j+1]);
Path.Add(Point);
j := j + 2;
end;
for j := 0 to Path.Count - 1 do
begin
Point := PPoint(Path[j]);
Print(IntToStr(Point.X) + ' ' + IntToStr(Point.Y));
Engine.MoveTo(Point.X, Point.Y, User.Z);
Dispose(Point);
end;
PathList.Free;
Path.Free;
end;

function GpsMoveTo(x, y, z: integer): boolean; // GPS движение
var dist: integer; i: integer;
begin
dist:= trunc(GPS.GetPath((user.x), (user.y), (user.z), (x), (y), (z)));
engine.msg('[GpsMoveTo]',format('Mowing to the point %d (x=%d y=%d z=%d), distance: %d m',[i,x,y,z,dist]), 4210752);
if (GPS.count > 0) then
begin
for i:= 0 to GPS.count-1 do
begin
if not Engine.MoveTo(trunc(GPS.items(i).x), trunc(GPS.items(i).y), trunc(GPS.items(i).z)) then
begin
engine.msg('[GpsMoveTo]',format('Error while moving to № %d : (%d, %d, %d)',[i,trunc(GPS.items(i).x), trunc(GPS.items(i).y), trunc(GPS.items(i).z)]), 222);
result:= false;
break;
end;
end;
result:= Engine.MoveTo(x, y, z) or (user.distto(x, y, z) < 150);
end
else engine.msg('[GpsMoveTo]','Path not found.', 128);
end;

end.

const
SOS_ID = 785;//Flame Icon
POS_ID = 784;//Spirit of Phoenix
TRIGGER_ID = 5562;//Spirit of Phoenix trigger
ATTACK_PET = false;
var
sosSkill,posSkill: TL2skill;
sosBuff,triggerBuff: TL2buff;
begin
while true do begin
if not user.buffs.byid(SOS_ID,sosBuff) then begin
if (skilllist.byid(SOS_ID,sosSkill) and (sosSkill.endtime = 0)) and (skilllist.byid(POS_ID,posSkill) and (posSkill.endtime = 0)) then begin
engine.useskill(posSkill);
delay(500);
print('Triggering lvl3 of '+posSkill.name);
while user.buffs.byid(TRIGGER_ID,triggerBuff) and not (triggerBuff.level >= 3) do begin
if ATTACK_PET and (petlist.count > 0) then begin
if (user.target.name = '') then engine.settarget(petlist.items(0));
engine.attack(true);
end;
delay(150);
end;
if (triggerBuff.level >= 3) then begin
print('Using '+sosSkill.name);
engine.useskill(sosSkill);
end;
end;
end;
delay(500);
end;
end.
end.

// usa Spirit of Shilen Sosinho

const
SOS_ID = 789;//Spirit of Shilen troca 'para dmais
POS_ID = 788;//Pain of Shilen
TRIGGER_ID = 5564;//Pain of Shilen trigger
ATTACK_PET = false;
var
sosSkill,posSkill: TL2skill;
sosBuff,triggerBuff: TL2buff;
begin
while true do begin
if not user.buffs.byid(SOS_ID,sosBuff) then begin
if (skilllist.byid(SOS_ID,sosSkill) and (sosSkill.endtime = 0)) and (skilllist.byid(POS_ID,posSkill) and (posSkill.endtime = 0)) then begin
engine.useskill(posSkill);
delay(500);
print('Triggering lvl3 of '+posSkill.name);
while user.buffs.byid(TRIGGER_ID,triggerBuff) and not (triggerBuff.level >= 3) do begin
if ATTACK_PET and (petlist.count > 0) then begin
if (user.target.name = '') then engine.settarget(petlist.items(0));
engine.attack(true);
end;
delay(150);
end;
if (triggerBuff.level >= 3) then begin
print('Using '+sosSkill.name);
engine.useskill(sosSkill);
end;
end;
end;
delay(500);
end;
end.
end.

// Script para alertar sobre o captcha --> faz a leitura das palavras

function SetForegroundWindow(hwnd: integer) : Boolean; stdcall;
external 'user32.dll';

function captcha:boolean; begin
if engine.dlgtext.contains('Refresh') or //le se aparece na tela um dialogo com o texto Refresh
engine.dlgtext.contains('Captcha') or //le se aparece na tela um dialogo com o texto Refresh
engine.dlgtext.contains('60 seconds') or //le se aparece na tela um dialogo com o texto Refresh
engine.dlgtext.contains('Bot') then begin //le se aparece na tela um dialogo com o texto Refresh
SetForegroundWindow(Engine.GameWindow);
PlaySound(exepath+'\sounds\'+'PlayerAlarm'+'.wav');
delay(500); // tempo a cada som
StopSound;
end;
end;
begin
while true do begin
delay(300);
captcha();
end;
end.

// BY Sonyzin

const
SOS_ID = 789;//Spirit of Shilen troca 'para dmais
POS_ID = 788;//Pain of Shilen
TRIGGER_ID = 5564;//Pain of Shilen trigger
ATTACK_PET = false;
var
sosSkill,posSkill: TL2skill;
sosBuff,triggerBuff: TL2buff;
begin
while true do begin
if not user.buffs.byid(SOS_ID,sosBuff) then begin
if (skilllist.byid(SOS_ID,sosSkill) and (sosSkill.endtime = 0)) and (skilllist.byid(POS_ID,posSkill) and (posSkill.endtime = 0)) then begin
engine.useskill(posSkill);
delay(500);
print('Triggering lvl3 of '+posSkill.name);
while user.buffs.byid(TRIGGER_ID,triggerBuff) and not (triggerBuff.level >= 3) do begin
if ATTACK_PET and (petlist.count > 0) then begin
if (user.target.name = '') then engine.settarget(petlist.items(0));
engine.attack(true);
end;
delay(150);
end;
if (triggerBuff.level >= 3) then begin
print('Using '+sosSkill.name);
engine.useskill(sosSkill);
end;
end;
end;
delay(500);
end;
end.
end.
 
Назад
Сверху