Simba Code:
Program testP06;
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I P07Include.Simba}
Const
YourHealth = 10;
var
GreenP,RedP,MyHP:Integer;
Health,HealthPercent,AllP,HpPercentMissing,Missing_Health:Extended;
PercentHP:Extended;
Procedure ShowHealth;
Begin
if (RedP < 1) or (GreenP < 1) Then
Begin
Exit;
End;
AllP := (RedP + GreenP);
HpPercentMissing := (RedP/AllP);
Missing_Health := (MyHP*HpPercentMissing);
Health := ((MyHp) - (Missing_Health));
PercentHP := ((RedP/AllP)*100);
Writeln('I have about ' + ToStr(Health)+ ' HP left');
Writeln('Percent:' + ToStr(PercentHP));
End;
Procedure WriteColors;
Begin
Writeln('Green:' + IntToStr(GreenP));
Writeln('Red:' + IntToStr(RedP));
End;
Procedure CountColors;
Begin
GreenP := CountColorTolerance(65280,245,140,281,154,3);
RedP := CountColorTolerance(255,245,140,281,154,3);
End;
Begin
SetupP07Include;
ActivateClient;
Wait(500);
P07_MakeCompassNorth;
P07_MakeCameraAngleHigh;
MyHP := YourHealth;
CountColors;
WriteColors;
ShowHealth;
End.
Make sure it searches for your health bar It may be slightly off