Forum www.elfngboot.fora.pl Strona Główna
 Strona glówna  •  FAQ  •  Szukaj  •  Użytkownicy  •  Grupy  •  Galerie  •  Rejestracja  •   Profil  •  Zaloguj się, by sprawdzić wiadomości  •  Zaloguj 
Ignore Monster 
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty
Zobacz poprzedni temat :: Zobacz następny temat  
Autor
Wiadomość
jabol123
Administrator



Dołączył: 05 Mar 2009
Posty: 26
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Czw 20:48, 05 Mar 2009  

Skrypt będzie ignorował monstera uprzednio wpisanego w jego treść.


Kod:

Const
 Ignore='Monk'; // wpisujemy nazwe potwora ktorego nie bedzie attakowac
var x : integer;
Looting:boolean;

function Attacking : boolean;
var x : integer;
begin
Result := False;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Attacking then
begin
Result := True;
Exit;
end;
end;
end;

function PlayerOnScreen : Boolean;
var
  x: integer;
begin
  Result := False;
  for x := 0 to Creatures.Count - 1 do
  begin
    if x >= Creatures.Count then Break;
    if Creatures.Creature[x].z=self.z then
    if Creatures.Creature[x].Name<>Self.Name then
    if not Creatures.Creature[x].NPC then
    begin
      Result :=true;
      Exit;
    end;
  end;
end;

function GetCreatureByID(ID: integer): TCreature;
var
  x: integer;
begin
  Result := nil;
  for x := 0 to Creatures.Count - 1 do
  begin
    if x >= Creatures.Count then Break;
    if Creatures.Creature[x].ID = ID then
    begin
      Result := Creatures.Creature[x];
      Exit;
    end;
  end;
end;


function FindClosest : integer;
var i, l, closest_num, closest_range, last_closest_range : integer;
begin
if not attacking then
begin
closest_num := -1;
last_closest_range := 5000;
for i := 0 to Creatures.Count - 1 do
if (Creatures.Creature[i].Z = Self.Z) then
if (Creatures.Creature[i].NPC = true) then
if (Ignore<>Creatures.Creature[i].Name) then
begin
closest_range := Round(Sqrt(Sqr(Self.X - Creatures.Creature[i].X)) + Sqr(Self.Y - Creatures.Creature[i].Y));
if (closest_range < last_closest_range) then
begin
last_closest_range := closest_range;
closest_num := i;
end;
end;
Result := closest_num;
Exit;
end;
end;

var found, Bla,y : integer;
begin
updateworld;
Bla:=Self.Containers.Count;
Looting:=false;
while not terminated do
begin
UpdateWorld;
if Self.Containers.Count>Bla then begin D:=Self.Containers.Count; Looting:=true; end;
if (Looting=true) then
                begin
                updateworld;
                Z:=self.x;
                y:=self.y;
                Self.DisplayText('Looting');
                repeat
                sleep(200);
                updateworld;
                until (Z<>Self.x) or (y<>self.y);
                Looting:=false;
                Self.DisplayText('Finished looting');
                end;
updateworld;
found := FindClosest;
if (found <> -1) then
if (attacking=false) and (PlayerOnScreen=false) and (Looting=false) then
Creatures.Creature[found].Attacking := true;
Sleep(1000);
end;
end;


Uwagi dodatkowe:
Jeżeli skrypt by nie działał możliwe jest ze trzeba odznaczyć Target All


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1
   
 
Opcje 
Zezwolenia Opcje
Kto jest na Forum Możesz pisać nowe tematy
Możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Kto jest na Forum
 
Jumpbox
Kto jest na Forum
Skocz do:  


fora.pl - załóż własne forum dyskusyjne za darmo
Theme FrayCan created by spleen & Download
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin