Cytat został ukryty, ponieważ ignorujesz tego użytkownika. Pokaż cytat.
Ostatnio zmieniony przez dernight : 16-03-2009, 16:19
Ostatnio zmieniony przez Fyrafozor : 15-03-2009, 23:06
Ostatnio zmieniony przez MisieQQKnw : 20-03-2009, 11:32
" Everybody Lies "
Dr. House
Ostatnio zmieniony przez Poducha : 21-03-2009, 16:37
Const
SSA_ID = 3082 // Enter the amulet ID here and it will put it on amulet slot everytime it's empty.
AOL_ID = 3057 // Change the ID of the AOL
function GetItemFromOpenBackpack(ID: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;
while not terminated do
begin
UpdateWorld;
SSA := GetItemFromOpenBackpack(SSA_ID);
if SSA <> nil then
begin
UpdateWorld;
if Self.Amulet.ID = 0
then SSA.MoveToBody(Self.Amulet,0);
Sleep(500);
end;
else
begin
SSA := GetItemFromOpenBackpack(AOL_ID);
self.displayText('You Dont have SSA, So I will put AOL, Bye.');
if SSA <> nil then
SSA.MoveToBody(Self.Amulet,0);
else
begin
sleep(1500);
Self.Displaytext('LOL you dont even have aol! xD');
end;
break;
end;
sleep(100);
end;
Const
// SSA //
SSAMANA = 500 // ponizej tej many wlozy ssa
SSAID = 3082
// Amulet //
AmuletMANA = 5000 // powyzej tej many wlozy inny amulet
AmuletID = xxxx // wpisz ID jakiegos innego amuletu, ktory masz
var
Amulet:TItem;
function GetItemFromOpenBackpack(ID: integer): TItem;
var
x: integer;
y: integer;
begin
Result := nil;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].ID = ID then
begin
Result := Self.Containers.Container[x].Item[y];
Exit;
end;
end;
end;
end;
begin
while not Terminated do
begin
updateworld;
If (Self.Mana <= SSAMANA) and (Self.Amulet.ID<>AmuletID) then
begin
Amulet := GetItemFromOpenBackpack(SSAID);
if Amulet<>nil then
Amulet.MoveToBody(Self.Amulet, 0);
else Self.DisplayText('SSA not found in backpack >.<');
end;
If (Self.Mana >= AmuletMANA) and (Self.Amulet.ID<>SSAID) then
begin
Amulet:=GetItemFromOpenBackpack(AmuletID);
if Amulet<>nil then
Amulet.MoveToBody(Self.Amulet, 0);
else Self.DisplayText('Amulet not found in backpack >.<');
end;
Sleep(1000);
end;
end;
Ostatnio zmieniony przez Gray : 21-03-2009, 14:07
Ostatnio zmieniony przez Adisky : 22-03-2009, 16:41
Const
Ignore='Ghost'; // if the creature is a Ghost, we wont attack it.
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;
Const
MonsterList = ['Ghost']; //List of monsters to not attack
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 IsAttackable(Name: String): Boolean;
var
x: integer;
begin
Result := False;
for x := Low(MonsterList) to High(MonsterList) do
begin
if Name = MonsterList[x] then
begin
Result := True;
Break;
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 (IsAttackable(Creatures.Creature[i].Name) = False) 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;
Const
MonsterList = ['potworek1', 'potworek2','xxxxx','yyyyyy']; //List of monsters to attack
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 IsAttackable(Name: String): Boolean;
var
x: integer;
begin
Result := False;
for x := Low(MonsterList) to High(MonsterList) do
begin
if Name = MonsterList[x] then
begin
Result := True;
Break;
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 (IsAttackable(Creatures.Creature[i].Name) = True) 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;
Aktualnie 1 użytkowników przegląda ten temat. (0 użytkowników i 1 gości)
Zakładki