Callin me out... I see how it is.
Simba Code:
Function HPLevel: Integer;
Var
ColourString: String;
Begin
Result:= GetMMLevels('HP', ColourString);
End;
Simba Code:
Function GetMaxHP: Extended;
Var
Text: String;
B, BigBox: TBox;
TPA : TPointArray;
ATPA : T2DPointArray;
I,cts: Integer;
BoxColors: TIntegerArray;
Begin
GameTab(Tab_Combat);
HumanMouseBox(650,394-50,682,401-50);
Wait(RandomRange(500,700));
B := IntToBox(594, 365-50, 694, 394-50);
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
// Black
BoxColors := [1774603];
SetLength(ATPA, Length(BoxColors));
for i := 0 to High(BoxColors) do
FindColorsTolerance(ATPA[i], BoxColors[i], B.X1, B.Y1, B.X2, B.Y2, 0);
TPA := MergeATPA(ATPA);
If Length(TPA) < 10 Then
begin
Writeln('Not enough colors');
ColorToleranceSpeed(cts);
Exit;
end;
ATPA := SplitTPA(TPA, 4);
For i := 0 to High(ATPA) do
begin
B := GetTPABounds(ATPA[i]);
if ((B.x2-B.x1) > 4) and ((B.y2-B.y1) > 4) then
Break
else
B := IntToBox(0, 0, 0, 0);
end;
If (B.x2 = 0) then
begin
ColorToleranceSpeed(cts);
Exit;
end;
BigBox := B;
Text:= GetTextAtExWrap(BigBox.X1, BigBox.Y1, BigBox.X2, BigBox.Y2, 0, 5, 2, 3111603, 10, 'UpChars');
Text:= Copy(Text, 0, High(Text)-1);
If (StrToIntDef(Text, 0)=100) Then
Result:=HPLevel Else
Result:= (HPLevel*100)/(StrToIntDef(Text, 0));
End;
Have a variable called maxhp. Do maxhp:=getmaxhp; once at the setup of your script, then do checks for your hp lvl.
Simba Code:
If ((HPLevel < (HP*0.80))) Then
Begin
If HPLevel=-1 Then
Exit;
That 80 you can replace with whatevers