SCAR Code:
program HitPredictor;
Const
CombatLevel = 99;//Your combat level(Only matters in pvp)
PvpMode = True;//Pvp? True=Yes, False=No
TextX = 400;//X coordinate for hit text
TextY = 360;//Y coordinate for hit text
PaintTime = 2000;//How long to display hit [milliseconds]
var
XpChars: Integer;
XP1, XP2, Hit, TimeMark: Integer;
a: Extended;
CA: TCanvas;
PA, PB: TPointArray;
procedure PaintText(S: String);
var
Imag, W, H: Integer;
C1: TCanvas;
begin
Imag := CreateBitmapFromText(S, BigChars, 255);
GetBitmapSize(Imag, W, H);
C1 := GetBitmapCanvas(Imag);
CopyCanvas(C1, CA, 0, 0, W, H, TextX, TextY, TextX+W, TextY+H);
FreeBitmap(Imag);
end;
function XpAmouth: Integer;
var
X: Integer;
P: TPointArray;
begin
FindColors(P, 16777215, 460, 58, 505, 66);
X := GetTPABounds(P).X1;
Result := StrToInt(GetNumbers(GetTextAtEx(X, 57, 0, XpChars, False, False, 0, 0, 16777215, 10, True, tr_Digits)));
end;
begin
ClearDebug;
CA := GetClientCanvas;
XpChars := LoadChars2(AppPath + 'Fonts\XpChars\');
WriteLn('Chars Loaded');
if not PvpMode then a := 0.133*4
else
case CombatLevel of
3..19: a := 0.133*4;
20..39: a := 0.136*4;
40..59: a := 0.140*4;
60..79: a := 0.143*4;
80..99: a := 0.146*4;
100..119: a := 0.150*4;
120..138: a := 0.153*4;
end;
WriteLn('We hit '+FloatToStr(1/a)+' * Gained xp');
repeat
repeat
FindColors(PA, 16777215, 470, 60, 509, 65);
until(Length(PA) > 5);
XP1 := XPAmouth;
repeat
FindColors(PB, 16777215, 470, 60, 509, 65);
if GetSystemTime - TimeMark < PaintTime then PaintText(IntToStr(Hit));
Wait(20);
if (Length(PA) > 0) and (Length(PB) > 0) then
if (not TPAInTPA(PA, PB)) then Break;
until(False);
TimeMark := GetSystemTime;
XP2 := XPAmouth;
Hit := Round((XP2-XP1)/a);
if (XP1 > 0) and (XP2 > 0) then WriteLn('We hit: '+IntToStr(Hit));
PaintText(IntToStr(Hit));
until(false);
end.