SRL Archive - Outdated / Broken

Army Tracker!


Sir R. M8gic1an

2010-01-31 16:16:26

Ladies and Gents,
I've done a very simple script to keep track of your army.

Just fill in DeclarePlayers and set up the consts the way you like.

[php]
| - NICK - ATK - STR - DEF - MAGE - MINE - SMITH - FISH - COOK - WC - |
| - **** - 36 - 30 - 30 - 28 - 44 - 10 - 43 - 13 - 69 - |
| - **** - 35 - 34 - 34 - 2 - 1 - 1 - 45 - 1 - 65 - |
| - **** - 32 - 30 - 32 - 7 - 1 - 1 - 44 - 3 - 48 - |
| - **** - 30 - 36 - 30 - 24 - 1 - 1 - 41 - 19 - 59 - |
| - **** - 33 - 30 - 34 - 25 - 45 - 1 - 40 - 19 - 52 - |
| - **** - 40 - 42 - 1 - 1 - 71 - 1 - 5 - 13 - 76 - |
| - **** - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - |
[/php]


As I am failing to upload it…

program ArmyChecker;
{$DEFINE SRL_SMART}
{.include srl/srl/misc/Smart.scar}
{.include srl/srl.scar}

const
//Setup Variables
//F2P
CHECK_ATK = true;
CHECK_STR = true;
CHECK_DEF = true;
CHECK_RANGE = false;
CHECK_PRAYER = false;
CHECK_MAGIC = true;
CHECK_RC = false;
CHECK_HP = false;
CHECK_CRAFT = false;
CHECK_MINE = true;
CHECK_SMITH = true;
CHECK_FISH = true;
CHECK_COOK = true;
CHECK_FM = false;
CHECK_WC = true;

//P2P
CHECK_AGI = false;
CHECK_HB = false;
CHECK_TH = false;
CHECK_FLETCH = false;
CHECK_SLAY = false;
CHECK_FARM = false;
CHECK_CONS = false;
CHECK_HUNT = false;
CHECK_SUMMON = false;

Procedure DeclarePlayers;
var
i: integer;
begin
NumberOfPlayers(1);

with Players[0] do
begin
Name :='';
Nick := '';
Pass := '';
Active := true;
end;

{ // personal use
for i:= 0 to HowManyPlayers - 1 do
with Players[i] do
begin
Nick := copy(Name, 1, 4);
Pass := '';
Active := true;
end;
}
end;

Procedure CheckIt(skill: integer; check: boolean; var i: integer; var ResultMe: TIntegerArray);
begin
if check then
begin
writeln('Adding skill: ' + IntToStr(skill));
ResultMe[i] := skill;
writeln(ResultMe[i]);
inc(i);
end;
end;

Function WhatToCheck: TIntegerArray;
var
size, skillN: integer;
begin
//24 skills
SetLength(Result, 24);
size := 0;

for skillN := SKILL_ATTACK to SKILL_SUMMONING do
begin
case skillN of

//F2P
skill_Attack : CheckIt(skillN, CHECK_ATK, size, Result);
skill_Strength : CheckIt(skillN, CHECK_STR, size, Result);
skill_Defense : CheckIt(skillN, CHECK_DEF, size, Result);
skill_Range : CheckIt(skillN, CHECK_RANGE, size, Result);
skill_Prayer : CheckIt(skillN, CHECK_PRAYER, size, Result);
skill_Mage : CheckIt(skillN, CHECK_MAGIC, size, Result);
skill_Runecrafting : CheckIt(skillN, CHECK_RC, size, Result);
skill_HP : CheckIt(skillN, CHECK_HP, size, Result);
skill_Crafting : CheckIt(skillN, CHECK_CRAFT, size, Result);
skill_Mining : CheckIt(skillN, CHECK_MINE, size, Result);
skill_Smithing : CheckIt(skillN, CHECK_SMITH, size, Result);
skill_Fishing : CheckIt(skillN, CHECK_FISH, size, Result);
skill_Cooking : CheckIt(skillN, CHECK_COOK, size, Result);
skill_Firemaking : CheckIt(skillN, CHECK_FM, size, Result);
skill_Woodcutting : CheckIt(skillN, CHECK_WC, size, Result);

//P2P
skill_Agility : CheckIt(skillN, CHECK_AGI, size, Result);
skill_Herblore : CheckIt(skillN, CHECK_HB, size, Result);
skill_Thieving : CheckIt(skillN, CHECK_TH, size, Result);
skill_Fletching : CheckIt(skillN, CHECK_FLETCH, size, Result);
skill_Slayer : CheckIt(skillN, CHECK_SLAY, size, Result);
skill_Farming : CheckIt(skillN, CHECK_FARM, size, Result);
skill_Construction : CheckIt(skillN, CHECK_CONS, size, Result);
skill_Hunter : CheckIt(skillN, CHECK_HUNT, size, Result);
skill_Summoning : CheckIt(skillN, CHECK_SUMMON, size, Result);
end;
writeln(IntToStr(Result[skilln-1]) + ' ' + IntToStr(size));
end;
end;

Function SkillToString(skill: integer): String;
begin
case skill of
skill_Attack : Result := 'ATK';
skill_Strength : Result := 'STR';
skill_Defense : Result := 'DEF';
skill_Range : Result := 'RANGE';
skill_Prayer : Result := 'PRAY';
skill_Mage : Result := 'MAGE';
skill_Runecrafting : Result := 'RC';
skill_HP : Result := 'HP';
skill_Agility : Result := 'AGI';
skill_Herblore : Result := 'HB';
skill_Thieving : Result := 'TH';
skill_Crafting : Result := 'CRAFT';
skill_Fletching : Result := 'FLETCH';
skill_Slayer : Result := 'SLAY';
skill_Mining : Result := 'MINE';
skill_Smithing : Result := 'SMITH';
skill_Fishing : Result := 'FISH';
skill_Cooking : Result := 'COOK';
skill_Firemaking : Result := 'FM';
skill_Woodcutting : Result := 'WC';
skill_Farming : Result := 'FARM';
skill_Construction : Result := 'CONST';
skill_Hunter : Result := 'HUNT';
skill_Summoning : Result := 'SUMMON';
end;
end;

Function CheckSkills(which: TIntegerArray): TIntegerArray;
var
i, size: integer;
begin
size := High(which);
SetLength(Result, size + 1);

for i:= 0 to size do
begin
if which[i] = 0 then continue;

writeln('checking skill ' + IntToStr(which[i]));
Result[i] := GetSkillLevel(which[i]);
end;

end;

Procedure PrintStatus(whichSkill: TIntegerArray; level: array of TIntegerArray);
var
i, h: integer;
Boundary: TIntegerArray;
s, sName: string;
begin
SetLength(Boundary, Length(whichSkill));

//printing the first line
s := '| - NICK - ';
for i:= 0 to High(whichSkill) do
begin
if whichSkill[i] = 0 then break;
sName := SkillToString(whichSkill[i]);
s := s + sName + ' - ';
Boundary[i] := Max(High(sName) + 1, 3);
end;
s := s + '|';
Writeln(s);

//printing player lines

for i := 0 to High(Players) do
begin
s := '| - ' + copy(Players[i].Name, 1, 4) + ' - ';
for h := 0 to High(whichSkill) do
begin
if whichSkill[h] = 0 then break;
s := s + PADR(IntToStr(level[i][h]), Boundary[h]-1) + ' - ';
end;

s := s + '|';
Writeln(s);
end;
end;

var
i: integer;
skillsToCheck: TIntegerArray;
levels: array of TIntegerArray;

begin
SetupSRL;
DeclarePlayers;
ActivateClient;
ClearDebug;
skillsToCheck := WhatToCheck;
SetLength(levels, Length(skillsToCheck));
if LoggedIn then LogOut;

for i:= 0 to High(Players) do
begin
SwitchToPlayer(i, true);

if FindNormalRandoms then
begin
LogOut;
Continue;
end;

levels[i] := CheckSkills(skillsToCheck);
LogOut;
end;

ClearDebug;
PrintStatus(skillsToCheck, levels);

end.


~RM

Wanted

2010-01-31 16:22:17

Nice… maybe make a version that grabs high-score stats too.

-IceFire

mormonman

2010-01-31 16:22:21

Hah, I made a simple one of these a long time ago.

Infantry001

2010-01-31 21:13:25

If you could somehow create a location checker too, that'd be sweet! (no reflection right now, so I'm guessing it would have to be some complex "check MM and compare it with a pic of the world map" sorta thing. but you can do it! ;)

YoHoJo

2010-01-31 21:20:38

Awesome, everyone (who still uses armies) could definitely use one of these. Thanks! So many potential possibilities too! :D