Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- bmpEmpty, bmpFull: TSCARBitmap;
- procedure ScriptTerminate;
- begin
- bmpEmpty.Free;
- bmpFull.Free;
- end;
- function ValueToPercent(position, source: Extended): Extended;
- begin
- if (position <> 0) then
- Result := ((position / source) * 100);
- end;
- function GetHPPercent: Extended;
- var
- c, m: Integer;
- area: TBox;
- begin
- area := GetClient.ImageArea;
- c := CountBitmap(bmpFull, area.X1, area.Y1, area.X2, area.Y2);
- m := (c + CountBitmap(bmpEmpty, area.X1, area.Y1, area.X2, area.Y2));
- Result := ValueToPercent(c, m);
- end;
- function GetMaxHP: Integer;
- var
- area: TBox;
- begin
- area := GetClient.ImageArea;
- Result := (CountBitmap(bmpEmpty, area.X1, area.Y1, area.X2, area.Y2) and CountBitmap(bmpFull, area.X1, area.Y1, area.X2, area.Y2));
- end;
- function GetHP: Integer;
- var
- area: TBox;
- begin
- area := GetClient.ImageArea;
- Result := CountBitmap(bmpFull, area.X1, area.Y1, area.X2, area.Y2);
- end;
- begin
- GetClient.Activate;
- bmpFull := TSCARBitmap.Create('deNrjZeBm+A8EDg4EEASMKhtoZQDQDvbe');
- bmpEmpty := TSCARBitmap.Create('deNrjZeBm+P//vwMh8B8MRpUNuDIAn7Kclw==');
- Wait(500);
- WriteLn('HP: ' + IntToStr(GetHP) + '/' + IntToStr(GetMaxHP));
- WriteLn('HP Percent: ' + FloatToStr(GetHPPercent) + '%');
- end.
Advertisement
Add Comment
Please, Sign In to add comment