Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

Why the CPU usage up to 25% when running the code

Ask for help
Post Reply
Atida
Neophyte
Neophyte
Posts: 17
Joined: 15.08.2017 4:33

Why the CPU usage up to 25% when running the code

Post by Atida »

Code: Select all

Program Healing_Hiryu;
const
  Mubiao=$00F3;   //Hiryu Type
Label Heal;
begin

FindVertical := 25;
FindDistance := 3;
begin
while true do begin
Heal:
if gethp(findtype(Mubiao,ground))>=20 then begin
   wait(1000);
   goto Heal;  
   end;
if IsPoisoned(finditem) then begin
   cast('Arch Cure');
   WaitForTarget(2000);
   TargetToObject(finditem);
   wait(2000);   
end;

if ( gethp(findtype(Mubiao,ground))<20 ) and ( gethp(findtype(Mubiao,ground)) > 0 ) then begin
   addtosystemjournal(inttostr(gethp(finditem))); 
   CancelTarget;
   cast('greater heal')
   WaitForTarget(2000);
   TargetToObject(finditem);
   wait(2000);
end;
end;
end;
end.
GeeZeR
Apprentice
Apprentice
Posts: 226
Joined: 28.01.2012 19:48

Re: Why the CPU usage up to 25% when running the code

Post by GeeZeR »

try to put wait(10); at the end inside of that "while" cycle.
Stealth 8.10.2 | Клиент: 7.0.13.4
Atida
Neophyte
Neophyte
Posts: 17
Joined: 15.08.2017 4:33

Re: Why the CPU usage up to 25% when running the code

Post by Atida »

Thank GeeZeR, resolved.
Post Reply