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.
layfree
Posts: 4
Joined: 14.01.2016 20:50

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

Post by layfree »

你可以和我VX联系,pg116100
Post Reply