Перейти к содержимому

Фотография
- - - - -

Подвисает скрипт


  • Авторизуйтесь для ответа в теме
Сообщений в теме: 3

#1
Roneros

Roneros
  • 2
    0
    Не выбрано
    • Гремлин
    • Пользователь

Добрый день господа , друзья и товарищи. 
Подскажите , в чем может быть проблема , иногда подвисает скрипт в городе .
Отказывается бежать к баферу и глобалу , если через адреналин ткнуть в любую точку карты - начинает движение. 
Сам скрипт 


uses SysUtils, Classes, RegExpr; 
var obj: TL2NPC; obj21: TL2Effect;
 var buff: TL2Buff;
  var Figth_Flag:boolean;
Item: TL2Item;
Npc: TL2Npc;

procedure PrintAllTags(); 
var RegExp: TRegExpr; 
begin      
RegExp:= TRegExpr.Create;
RegExp.Expression:= '(<a *(.+?)</a>)|(<button *(.+?)>)'; 
if RegExp.Exec(Engine.DlgText) then
repeat Print(RegExp.Match[0]);
until (not RegExp.ExecNext); 
RegExp.Free;
end;


procedure Sticking_Thread(sec: integer);
var Timer: int64;  X, Y, Z: integer;
begin
  while (Engine.Status <> lsOnline) do delay(555);    
  X:= User.X;  Y:= User.Y;  Z:= User.Z;               
  Timer:= GetTickCount + sec*1000;                    

  while delay(555) do begin                           
    if (Engine.Status = lsOnline) then begin          
      if (User.Cast.EndTime = 0)                     
      and (Abs(User.X-X) < 50)                       
      and (Abs(User.Y-Y) < 50) then begin            
        if (GetTickCount > Timer) then begin    
          Script.Suspend;                             
                if Engine.UseItem(736) then begin           
            while (User.Cast.EndTime <> 0) do delay(555); 
            delay(5555);                             
          end;
          Script.Replace;                           
        end;
      end else begin                                 
        X:= User.X;  Y:= User.Y;  Z:= User.Z;         
        Timer:= GetTickCount + sec*1000;             
            end;
    end;
  end;
end;


function Bypass(dlg: string): boolean; 
var
RegExp: TRegExpr;
SL: TStringList;
i: integer;
bps: string;
begin
Result:= true; 
RegExp:= TRegExpr.Create; 
SL:= TStringList.Create;

RegExp.Expression:= '(<a *(.+?)</a>)|(<button *(.+?)>)'; 
if RegExp.Exec(Engine.DlgText) then 
repeat SL.Add(RegExp.Match[0]);
until (not RegExp.ExecNext); 

for i:= 0 to SL.Count-1 do begin 
if (Pos(dlg, SL[i]) > 0) then begin 
RegExp.Expression:= '"bypass -h *(.+?)"'; 
if RegExp.Exec(SL[i]) then 
bps:= TrimLeft(Copy(RegExp.Match[0], 12, Length(RegExp.Match[0])-12));
end;
end;

Print(bps); 
if (Length(bps) > 0) then Engine.BypassToServer(bps); 

RegExp.Free; 
SL.Free;
end;

//---------------------------------------------------
//Проверка  на смерть.
//---------------------------------------------------
function deadCheck: Boolean;
begin
Result:=false;
    if User.Dead then begin
          Engine.FaceControl(0,false);
        Result:=true;
        Print('В город');
        Delay(1000);
        Engine.GOHome;  
        Delay(10000);
    end;

end;


procedure Dead();
begin
while 1<>2 do begin
delay(2000); //умерли
if User.Dead then begin
print('смерть');
delay(5000);
engine.GoHome;
Engine.FaceControl(0, false);
end;
end;
end;
//---------------------------------------------------
//Проверка бафа
//---------------------------------------------------
function buffCheck: Boolean;
var buff: TL2Buff;
begin
print('Чекаем баф'); 	
if (not User.Buffs.ByID(1062, buff)) then begin 
Result:=true;
print('Баф');
if user.inrange(147138,25906,-2039, 300, 300)then begin
Engine.SetTarget(50019);
delay(500);
Engine.DlgOpen();
delay(500);
Bypass('Warrior');
delay(500);
      end;
end;
end;


//---------------------------------------------------
//Перемещение аден
//---------------------------------------------------
procedure aden();
begin
if User.inrange(146811,27109,-2231, 500, 500)  then
begin
 Engine.MoveTo(146811,27109,-2231);
 Engine.MoveTo(147289,26926,-2229);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(146810,28059,-2294, 500, 500)  then
begin
 Engine.MoveTo(146810,28059,-2294);
 Engine.MoveTo(146847,27874,-2294);
 Engine.MoveTo(147004,27611,-2294);
 Engine.MoveTo(147004,27611,-2294);
 Engine.MoveTo(147004,27611,-2232);
 Engine.MoveTo(147244,26822,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(145686,21112,-2167, 500, 500)  then
begin
 Engine.MoveTo(145686,21112,-2167);
 Engine.MoveTo(145697,21616,-2167);
 Engine.MoveTo(145050,22609,-2167);
 Engine.MoveTo(145218,23947,-2167);
 Engine.MoveTo(146377,24455,-2039);
 Engine.MoveTo(146484,25685,-2039);
 Engine.MoveTo(147130,25700,-2039);
 Engine.MoveTo(147112,25921,-2039);

end;
if User.inrange(148076,27069,-2231, 500, 500)  then
begin
 Engine.MoveTo(148076,27069,-2231);
 Engine.MoveTo(147666,27110,-2230);
 Engine.MoveTo(147308,26954,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(148949,21125,-2167, 500, 500)  then
begin
 Engine.MoveTo(148949,21125,-2167);
 Engine.MoveTo(146122,21227,-2167);
 Engine.MoveTo(145697,21616,-2167);
 Engine.MoveTo(145050,22609,-2167);
 Engine.MoveTo(145218,23947,-2167);
 Engine.MoveTo(146377,24455,-2039);
 Engine.MoveTo(146484,25685,-2039);
 Engine.MoveTo(147130,25700,-2039);
 Engine.MoveTo(147112,25921,-2039);

end;
if User.inrange(144549,22828,-2167, 500, 500)  then
begin
 Engine.MoveTo(144549,22828,-2167);
 Engine.MoveTo(145697,21616,-2167);
 Engine.MoveTo(145050,22609,-2167);
 Engine.MoveTo(145218,23947,-2167);
 Engine.MoveTo(146377,24455,-2039);
 Engine.MoveTo(146484,25685,-2039);
 Engine.MoveTo(147130,25700,-2039);
 Engine.MoveTo(147112,25921,-2039);

end;
if User.inrange(144543,24666,-2167, 500, 500)  then
begin
 Engine.MoveTo(144543,24666,-2167);
 Engine.MoveTo(145279,24307,-2167);
 Engine.MoveTo(146377,24455,-2039);
 Engine.MoveTo(146484,25685,-2039);
 Engine.MoveTo(147130,25700,-2039);
 Engine.MoveTo(147112,25921,-2039);

end;
if User.inrange(146497,30582,-2487, 500, 500)  then
begin
 Engine.MoveTo(146497,30582,-2487);
 Engine.MoveTo(147058,30323,-2487);
 Engine.MoveTo(147427,29959,-2487);
 Engine.MoveTo(147427,29339,-2295);
 Engine.MoveTo(147373,28351,-2294);
 Engine.MoveTo(147100,27643,-2294);
 Engine.MoveTo(147246,26930,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(144648,29158,-2487, 500, 500)  then
begin
 Engine.MoveTo(144648,29158,-2487);
 Engine.MoveTo(144966,28868,-2487);
 Engine.MoveTo(145110,27659,-2295);
 Engine.MoveTo(146220,27622,-2231);
 Engine.MoveTo(147108,27272,-2231);
 Engine.MoveTo(147224,26929,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(150247,29109,-2487, 500, 500)  then
begin
 Engine.MoveTo(150247,29109,-2487);
 Engine.MoveTo(149921,28836,-2487);
 Engine.MoveTo(149859,28063,-2339);
 Engine.MoveTo(149776,27675,-2295);
 Engine.MoveTo(148731,27683,-2231);
 Engine.MoveTo(148224,27383,-2231);
 Engine.MoveTo(147306,26932,-2230);

end;
if User.inrange(147848,30309,-2487, 500, 500)  then
begin
 Engine.MoveTo(147848,30309,-2487);
 Engine.MoveTo(147677,30089,-2487);
 Engine.MoveTo(147462,29870,-2447);
 Engine.MoveTo(147462,29413,-2295);
 Engine.MoveTo(147335,28272,-2294);
 Engine.MoveTo(147108,27664,-2294);
 Engine.MoveTo(147194,26961,-2229);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(144651,26680,-2295, 500, 500)  then
begin
 Engine.MoveTo(144651,26680,-2295);
 Engine.MoveTo(144681,27050,-2294);
 Engine.MoveTo(144936,27135,-2295);
 Engine.MoveTo(145145,27605,-2295);
 Engine.MoveTo(146182,27682,-2231);
 Engine.MoveTo(146921,27360,-2231);
 Engine.MoveTo(147218,26948,-2229);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(148557,30461,-2487, 500, 500)  then
begin
 Engine.MoveTo(148557,30461,-2487);
 Engine.MoveTo(148114,30076,-2487);
 Engine.MoveTo(147453,30049,-2487);
 Engine.MoveTo(147474,29710,-2368);
 Engine.MoveTo(147397,28461,-2294);
 Engine.MoveTo(147044,27389,-2231);
 Engine.MoveTo(147242,26823,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end;
if User.inrange(147971,27982,-2294, 500, 500)  then
begin
 Engine.MoveTo(147971,27982,-2294);
 Engine.MoveTo(147846,27354,-2231);
 Engine.MoveTo(147265,26878,-2230);
 Engine.MoveTo(147267,26400,-2185);
 Engine.MoveTo(147266,26195,-2103);
 Engine.MoveTo(147250,25969,-2039);
 Engine.MoveTo(147206,25899,-2039);
 Engine.MoveTo(147138,25906,-2039);

end; 
    end;
//---------------------------------------------------
//tp v katy
//---------------------------------------------------
procedure tpspot();
begin
if user.inrange(147138,25906,-2039, 500, 550)then begin
delay (1000);
print('Katakomby'); 	
Engine.SetTarget(31031);
delay(1000);
Engine.DlgOpen();
Bypass('Necropolis');
delay(1000);
Bypass('Disciple');
delay(3000);
end;
end;
//---------------------------------------------------
//katy beg
//---------------------------------------------------
procedure GoToSpot();
begin
 if User.inrange(172767, -17543, -4893, 250, 250) then begin
delay (1000);
print('bejim na spot');
Engine.MoveTo(172660, -16657, -4894);
Engine.MoveTo(172668, -16418, -4895);
Engine.MoveTo(173144, -15864, -4896);
Engine.MoveTo(173143, -15837, -4896);
Engine.MoveTo(173089, -14949, -4895);
Engine.MoveTo(172635, -15049, -4895);
Engine.MoveTo(172632, -13458, -4895);
Engine.MoveTo(172612, -12259, -4893);
Engine.MoveTo(172609, -11383, -4893);
Engine.MoveTo(172751, -11010, -4893);
end;
if user.inrange(172751, -11010, -4893, 100, 100)then begin
     Engine.FaceControl(0,true);
            end;
            end;
//---------------------------------------------------
//script
//---------------------------------------------------

begin
while 1<>2 do begin
aden;
if (not User.Buffs.ByID(1062, buff)) then begin 
buffCheck;
delay(1000);
end;
if User.Buffs.ByID(1062, buff) then begin
tpspot;
end;
if User.Dead then begin
deadCheck;
end;
if User.Buffs.ByID(1062, buff) then begin
GoToSpot;
    end;
    end;
end.


  • 0

#2
vvfrc33

vvfrc33
  • 70
    18
    Горит!
    • Lvl 32
    • Пользователь
    Skype
    teodor2475
    Город
    СПБ

Roneros, добавь в дедчек рандом движение после делея и зачем процедура деад тут?


  • 0

Discord neowhite#3259


#3
Roneros

Roneros
  • 2
    0
    Не выбрано
    • Гремлин
    • Пользователь

vvfrc33, пример на движ можно?


  • 0

#4
vvfrc33

vvfrc33
  • 70
    18
    Горит!
    • Lvl 32
    • Пользователь
    Skype
    teodor2475
    Город
    СПБ

Roneros,

Engine.DmoveTo(user.x+random(50),user.y+25,user.z);

Сообщение отредактировал vvfrc33: 17 Октябрь 2019 - 17:16

  • 0

Discord neowhite#3259



Количество пользователей, читающих эту тему: 0

0 пользователей, 0 гостей, 0 анонимных

Rawr.pro - Сделано с для игроков.