Const
RuneID = 3155 // tutaj id runy
MinHP = 1100 // ponizej xx hp nie strzeli z runy
function GetAttackedCreature:TCreature;
begin
UpdateWorld;
result := nil;
for i := 0 to Creatures.Count -1 do
begin
if i >= Creatures.Count then break;
if Creatures.Creature[i].ID = Self.Attacking then
Begin
result := Creatures.Creature[i];
exit;
end;
end;
end;
while not terminated do
begin
UpdateWorld;
Creature := GetAttackedCreature;
if Creature <> nil then
if Self.Health >= MinHP then
Self.Containers.UseItemWithCreature(RuneID,Creature);
sleep(3000);
end;