Page 1 of 1

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

Posted: 18.06.2018 10:15
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.

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

Posted: 18.06.2018 19:45
by GeeZeR
try to put wait(10); at the end inside of that "while" cycle.

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

Posted: 21.06.2018 13:21
by Atida
Thank GeeZeR, resolved.