Const
BPIndex = 1
RingID = 3051 //ID ringa
MinHealth = 600 // UStaw se jak ci, tutaj kiedy zaklada, : Musisz mie? otwarty bp z ringiem.
HealthToRemoveRing = 700 // PASUJE, tutaj ile hp kiedy sciaga ringa
var
G:integer;
Function GetItemFromOpenBackpack(ID:integer):TItem;
begin
result := nil;
UpdateWorld;
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 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];
G := x;
Exit;
end;
end;
end;
end;
while not terminated do
begin
If HealthToRemoveRing <= MinHealth Then
begin
Self.DisplayText('HealthToRemoveRing must be higher then MinHealth! Script will turn off now. Please try again.');
exit;
end;
UpdateWorld;
if Self.Health <= MinHealth then
begin
if self.ring.ID = 0 then
begin
Ring := GetItemFromOpenBackpack(RingID);
if Ring <> nil then
Ring.MoveToBody(Self.Ring,0);
else Self.DisplayText('The Ring wasnt found in any opened backpack.');
end;
end;
UpdateWorld;
if Self.Health >= HealthToRemoveRing then
begin
if self.ring.id <> 0 then
begin
Ring := Self.Ring;
Ring.MoveToContainer(Self.Containers.Container[BPIndex - 1],0,0);
end;
end;
sleep(500);
end;