What's new

- TibiaBot NG Ng skrypt

Status
Not open for further replies.

Pasikonik

Active User
Joined
May 19, 2009
Messages
108
Reaction score
8
Witam ;)
Bardzo potrzebuje skrytpu, kt?ry b?dzie ignorowa? (nie atakowa?) Poison Spidera.
Skrypt do NGBOT
 

wolf aka wiki

Advanced User
Joined
Feb 3, 2010
Messages
169
Reaction score
21
Odp: Ng skrypt

Code:
Const
 Ignore='[COLOR="DarkOrange"]Monk[/COLOR]'; // 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;
 
Status
Not open for further replies.
Top