SCAR Code:
program New;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Misc/Debug.Scar}
{.Include SRL/SRL/Misc/Users.Scar}
Var X, Y, I : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
TP : TPoint;
TB : TBox;
Function SkillCoords2(Row, Column : ShortInt): TPoint;
Begin
Result := Point(570 + (60 * (Column - 1)) + Column * 2,
211 + (27 * (Row - 1)) + Round(Row Div 2 * 1.5));
End;
function SkillToCoords2(Skill: Variant) : TPoint;
var
SkillArr: TStringArray;
CX, CY, skNo: Integer;
SkillS: string;
begin
if (not LoggedIn) then exit;
if (VarType(Skill) = varInteger) then
SkillS := IntToStr(Skill)
else
SkillS := Lowercase(Skill);
case Lowercase(SkillS) of
'hp', 'constitution': SkillS := 'hitpoints';
'ranged': SkillS := 'range';
'hunter': SkillS := 'hunting';
end;
SkillArr := ['attack', 'strength', 'defence', 'range', 'prayer', 'magic',
'runecrafting', 'construction', 'dungeoneering', 'hitpoints',
'agility', 'herblore', 'thieving', 'crafting', 'fletching', 'slayer',
'hunting', '', 'mining', 'smithing', 'fishing', 'cooking',
'firemaking', 'woodcutting', 'farming', 'summoning'];
if (GetNumbers(SkillS) = SkillS) and (InRange(StrToIntDef(GetNumbers(SkillS), 0), 1, Length(SkillArr))) then
skNo := StrToInt(SkillS) - 1
else
if (not InStrArrEx(SkillS, SkillArr, skNo)) then
begin
srl_Warn('SkillToCoords', 'Invalid Skill Name/Number: ''' + string(Skill) + '''', warn_AllVersions);
Exit;
end;
If skNo = 18 Then Inc(SkNo); //empty space
if (InRange(skNo + 1, 1, 27)) then
begin
CX := skNo div 9 + 1;
CY := skNo mod 9 + 1;
Disguise(SkillArr[SkNo]);
end;
Result := SkillCoords2(CY, CX);
GameTab(tab_Stats);
end;
function GetSkillInfo2(Skill: Variant; Amount : Boolean): Integer;
var
TP: TPoint;
Box : TBox;
TPA : TPointArray;
Cts : Integer;
begin
Result := -1;
GameTab(tab_Stats);
TP := SkillToCoords2(Skill);
if (not(Amount)) then
TP := Point(TP.x + 7, TP.y + 15);
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(0);
if not FindColors(TPA, 65535, TP.x - 5, TP.y - 4, TP.x + 29, TP.y + 14) then
exit;
DebugTPA(TPA, '');
Box := GetTPABounds(TPA);
Result := StrToIntDef(GetNumbers(GetTextAtEx(Box.x1 - 2, Box.y1 - 1, 140,
StatChars, False, True, 0, 3, 65535, 3, True, tr_Digits)), -1);
ColorToleranceSpeed(CTS);
end;
function GetSkillLevel2(Skill: Variant): Integer;
begin
Result := GetSkillInfo2(Skill, False);
end;
Begin
SetupSRL;
SRLPlayerForm(False, [], [], [], []);
For I := 1 To 25 Do
Begin
{ TP := SkillToCoords2(I);
MMouse(TP.x, TP.y, 0, 0); }
WriteLn(GetSkillLevel2(I));
wait(1200);
End;
End.