SRL Archive - Judges' Spot

JM Comp #1 - Script #2 - RM: Done


Sir R. M8gic1an

2009-08-12 14:50:24

This is here for people to give opinions. Do take into account this was for #30 or something.


program RimmingtonMiner;
{.Include SRL\SRL\Misc\SMART.SCAR}
{.include srl\srl.scar}
{.include SRL\SRL\skill\mining.scar}

var
x,y, OresMined, TotalBanks, LoadsFinished : integer;
OreDTM : integer;

const
LoadsToDo = 2; // Loads To Do Before Switching Players.

Procedure WriteReport;
begin
WriteLn('Total Loads =' + IntToStr(TotalBanks));
WriteLn('Ores Mined =' + IntToStr(OresMined));
end;

Procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 3;

Players[0].Name := '';// Your UserName
Players[0].Pass := '';// Your PassWord
Players[0].Nick := '';// Your Nick (3-4 letters from your username)
Players[0].Active := False;// Use this player ??}
Players[0].integers[0] := 3;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[0].booleans[0] := False;//Is your pick equipped?
Players[0].strings[0] := 'sell'// bank or sell (Case Sensitive)

Players[1].Name := '';// Your UserName
Players[1].Pass := '';// Your PassWord
Players[1].Nick := '';// Your Nick (3-4 letters from your username)
Players[1].Active := True;// Use this player ??}
Players[1].integers[0] := 4;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[1].booleans[0] := False;//Is your pick equipped?
Players[1].strings[0] := 'sell'// bank or sell (Case Sensitive)

Players[2].Name := '';// Your UserName
Players[2].Pass := '';// Your PassWord
Players[2].Nick := '';// Your Nick (3-4 letters from your username)
Players[2].Active := False;// Use this player ??}
Players[2].integers[0] := 2;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[2].booleans[0] := False;//Is your pick equipped?
Players[2].strings[0] := 'bank'// bank or sell (Case Sensitive)

Players[3].Name := '';// Your UserName
Players[3].Pass := '';// Your PassWord
Players[3].Nick := '';// Your Nick (3-4 letters from your username)
Players[3].Active := False;// Use this player ??}
Players[3].integers[0] := 3;// 1 = Copper, 2 = Tin, 3 = Iron, 4 = Gold
Players[3].booleans[0] := False;//Is your pick equipped?
Players[3].strings[0] := 'sell'// bank or sell (Case Sensitive)
end;

function SetOreDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 867;
dtmMainPoint.y := 380;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 65536;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 867;
dtmSubPoints[0].y := 380;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 65536;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 851;
dtmSubPoints[1].y := 361;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 65536;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 869;
dtmSubPoints[2].y := 365;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 65536;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 850;
dtmSubPoints[3].y := 387;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 65536;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
OreDTM := AddDTM(TempTDTM);
end;



function RadialWalkTwo(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
wait(5000);
FFlag(10);
Result := True;
Break;
end;
end;

Procedure AntiRandoms;
var
x,y : integer;
begin
if Not(loggedIn) then Exit;
if FindGas(x, y) then
begin
RunTo('W', True);
RunAway ('E', True, 2, (2000+random(2000)));
end;
FindNormalRandoms;
if (FindFight) then
begin
RunTo('E', True);
wait(2000 + random(1000));
RunTo('w', True);
end;
end;

procedure AntiBan;
begin
if Not(loggedIn) then Exit;
case random(130) of
0: RandomRClick;
1: BoredHuman;
2: HoverSkill('Mining', False);
3: GameTab(random(6) + 1);
4: RandomMovement;
5: PickUpMouse;
end;
end;

function FindIron(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2964577, MSX1, MSY1, MSX2, MSY2, 10);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;

function FindTin(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5); //you do not set them back to defaults!
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 10000804, MSX1, MSY1, MSX2, MSY2, 15);
If(IsUpTextMultiCustom(['ine', 'ock'])) then
begin
Result := True;
Mouse(x, y, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
end;
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine', 'ock'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;

function FindShopOwner(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 12568519, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['alk'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, False);
ChooseOption('rade');
wait(random(200));
end else
Result := False;
end;
end;

function FindCopper(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4882382, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 6000+random(2000)));
Break;
end;
end;
end;

function FindGold(x, y: Integer): Boolean;
var
CTS, I, x2, y2, time: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
if Not(loggedIn) then Exit;
if FindBlackChatMessage('You swing') then wait(800 + random(300));
wait(500+random(200));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 30.5);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3264507, MSX1, MSY1, MSX2, MSY2, 15);
ColorToleranceSpeed(CTS);
ATPA := TPAToATPAEx(TPA, 15, 15);

For I := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['ine'])) then
begin
Result := True;
getmousepos(x2,y2);
Mouse(x2, y2, 2, 2, True);
marktime(time);
AntiRandoms;
repeat
Antiban;
wait(500 + random(1200));
AntiRandoms;
until(FindBlackChatMessage('You manage') or FindBlackChatMessage('There is no') or (TimeFromMark(time) >= 3000+random(2000)));
Break;
end;
end;
end;


Procedure WalkToMine;
begin
MakeCompass('n');
SetRun(True);
RadialWalkTwo(FindFallyRoadColor, 225, 180, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 150, 200, 70, 2, 2);
RadialWalk(FindRoadColor, 150, 250, 70, 2, 2);
RadialWalk(FindRoadColor, 150, 250, 70, 2, 2);
RadialWalk(FindRoadColor, 315, 180, 70, 2, 2);
RadialWalk(FindRoadColor, 180, 270, 70, 2, 2);
RadialWalk(FindRoadColor, 270, 160, 45, 2, 2);
if Not(RadialWalk(FindStoneColor, 90, 270, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 270, 160, 30, 2, 2);
if Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
end else
begin
NextPlayer(False);
LoadsFinished := 0;
end;
end;
end;
end;

Procedure MineIron;
begin
repeat
FFlag(0);
if FindIron(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
FFlag(0);
wait(random(1200));
if FindIron(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
case random(4) of
0 : SetAngle(True);
end;
Mouse(x - 18 + (random(20)), y + random(40), 2, 2, True);
FFlag(0);
end;
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;

Procedure MineTin;
begin
repeat
if FindTin(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindTin(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x + (18 + random(15)), y + (random(20)), 2, 2, True);
FFlag(0);
end;
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;

Procedure MineCopper;
begin
repeat
if FindCopper(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindCopper(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
RadialWalk(FindStoneColor, 310, 370, 55, 2, 2);
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;

Procedure MineGold;
begin
repeat
if FindGold(x,y) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
wait(random(1200));
if FindGold(x,y) then
begin
Antiban;
AntiRandoms;
wait(200 + random(200));
end else
begin
if FindSymbol(x, y, 'Mining Spot') then
begin
Mouse(x + (random(15)), y + (30 + random(30)), 2, 2, True);
FFlag(0);
case random(2) of
0: FindIron(x, y);
end;
end;
wait(5000 + random(2000));
end;
end;
until(InvFull);
OresMined := OresMined + 27;
end;
Procedure WalkToShop;
begin
MakeCompass('n');
Setangle(true);
if FindSymbol(x, y, 'mining spot') then
begin
Mouse(x, y, 5, 5, True);
FFlag(0);
end;
case random(1) of
0 : SetRun(True);
end;
if RadialWalk(FindRoadColor, 135, 270, 70, 2, 2) then
begin
RadialWalk(FindRoadColor, 180, 270, 60, 2, 2);
if Not(FindSymbol(x, y, 'pot')) then
begin
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
if FindSymbol(x, y, 'pot') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end;
end else
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end else
begin
if FindSymbol(x, y, 'mining spot') then
begin
MMouse(x + 10, y, 3, 3);
GetMousePos(x, y);
Mouse(x, y, 2, 2, True);
FFlag(0);
RadialWalk(FindRoadColor, 180, 300, 70, 2, 2);
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 5, 5, True);
FFlag(0);
if FindSymbol(x, y, 'pot') then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindShopOwner(x, y);
end;
end else
begin
RadialWalk(FindRoadColor, 180, 270, 30, 2, 2);
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 6, 6, True);
FFlag(0);
If FindSymbol(x, y, 'pot') then
begin
mouse(x, y, 1, 1, True);
FFlag(0);
if Not(FindShopOwner(x, y)) then
SetAngle(False);
Wait(random(200));
FindSHopOwner(x, y);
end;
end;
end;
end;
end;
wait(2000 + random(500));
end;

Procedure MineRocks;
begin
if Players[CurrentPlayer].integers[0] = 1 then
begin
MineCopper;
end;
if Players[CurrentPlayer].integers[0] = 2 then
begin
MineTin;
end;
if Players[CurrentPlayer].integers[0] = 3 then
begin
MineIron;
end;
if Players[CurrentPlayer].integers[0] = 4 then
begin
MineGold;
end;
end;

Procedure DepositStuff;
begin
if Players[CurrentPlayer].Booleans[0] = True then
begin
wait(random(200));
Deposit(random(20) + 1, 28, True);
if InvCount > 0 then
begin
wait(random(200));
Deposit(1, 28, True);
end;
end;

if Players[CurrentPlayer].Booleans[0] = False then
begin
wait(random(200));
Deposit(random(20) + 2, 28, True);
if InvCount > 1 then
begin
wait(random(200));
Deposit(2, 28, True);
end;
end;
case random(1) of
0 : CloseBank;
end;
Inc(TotalBanks);
Inc(LoadsFinished);
if LoadsFinished >= LoadsToDo then
begin
NextPlayer(True);
LoadsFinished := 0;
end;
end;

Procedure WalkToBank;
begin
MakeCompass('n');
RadialWalk(FindStoneColor, 300, 400, 70, 2, 2);
RadialWalk(FindStoneColor, 0, 90, 70, 2, 2);
RadialWalk(FindRoadColor, 430, 315, 70, 2, 2);
RadialWalk(FindRoadColor, 90, 0, 70, 2, 2);
RadialWalk(FindRoadColor, 135, 0, 30, 2, 2);
RadialWalk(FindRoadColor, 0, 90, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindRoadColor, 340, 380, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 350, 370, 70, 2, 2);
RadialWalk(FindFallyRoadColor, 350, 370, 70, 2, 2);
SetAngle(True);
FFlag(0);
if FindBank('feb') then
if BankScreen then
begin
DepositStuff;
end else
begin
RadialWalk(FindFallyRoadColor, 430, 350, 40, 3, 3);
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
OpenBankQuiet('feb');
wait(random(1200));
DepositStuff;
end else
begin
RadialWalk(FindFallyRoadColor, 370, 350, 35, 2, 2);
FFlag(0);
FindBank('feb');
DepositStuff;
end;
end;
Inc(TotalBanks);
Inc(LoadsFinished);
if LoadsFinished >= LoadsToDo then
begin
Logout;
NextPlayer(True);
LoadsFinished := 0;
end;
end;

Procedure WalkBackToMine;
begin
MakeCompass('n');
if FindSymbol(x, y, 'water') then
begin
Mouse(x, y, 2, 2, True);
end;
wait(400 + random(600));
RadialWalk(FindRoadColor, 0, 90, 70, 2, 2);
if Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
if Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 470, 350, 30, 2, 2);
if Not(RadialWalk(FindStoneCOlor, 0, 360, 70, 2, 2)) then
begin
if Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2)) then
begin
RadialWalk(FindRoadColor, 470, 350, 40, 2, 2);
If Not(RadialWalk(FindStoneColor, 0, 360, 70, 2, 2)) then
begin
If Not(RadialWalk(FindRockColor, 0, 360, 70, 2, 2))then
begin
NextPlayer(False);
end;
end;
end;
end;
end;
end;
SetRun(False);
end;

Procedure SellOre;
begin
FFlag(0);
SetOreDTM;
if FindDTM(oreDTM, x, y, MIx1, Miy1, Mix2, Miy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(100));
ChooseOption('Sell 50');
wait(200 + random(200));
end;
if Players[CurrentPlayer].booleans[0] = True then
begin
if InvCount > 1 then
begin
if FindDTM(OreDTM, x, y, MIx1, Miy1, MIx2, MIy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(200));
ChooseOption('Sell 50');
end;
end;
end;
if Players[CurrentPlayer].booleans[0] = False then
begin
if InvCount > 2 then
begin
if FindDTM(OreDTM, x, y, MIx1, MIy1, MIx2, MIy2) then
begin
Mouse(x, y, 2, 2, False);
wait(random(200));
ChooseOption('Sell 50');
end;
end;
end;
FreeDTm(OreDTM);
Inc(TotalBanks);
if TotalBanks >= LoadsToDo then
begin
WalkBackToMine;
NextPlayer(True);
end;
end;

Procedure Mainloop;
begin
SymbolAccuracy := 0.5;
repeat
if(not LoggedIn)then LoginPlayer;
if Players[CurrentPlayer].strings[0] = 'bank' then
begin
WalkToMine;
end;
MineRocks;
if Players[CurrentPlayer].strings[0] = 'bank' then
begin
WalkToBank;
end;
if Players[CurrentPlayer].strings[0] = 'sell' then
begin
WalkToShop;
wait(random(300));
SellOre;
WalkBackToMine;
end;
WriteReport;
Until(AllPlayersInactive);
end;

begin
SMARTSetupEx(8, False, True, False);
Wait(8000);
SetTargetDC(SmartGetDC);
Setupsrl;
DeclarePlayers;
Mainloop;
end.


1. Technique (/100)
2. Individuality (/100)
3. Follow all SRL rules (/100)
4. Creativity (/100)
5. Efficiency (/100)
6. Presentation (/100)
7. Meeting all Requirements (/100)
8. Added Extras (/100)

~RM

Gu3st...

2009-08-14 21:11:32

Technique: (**/100)
- Could have had one procedure that would mine the specifik rock that the current player is set to mine instead of having a procedure for each and every rock.
- The different Mine;-procedures is almost identical.
- Does not use failsafes in the walking. Not good.
- Typical antiban procedure.
- Random(1) would always return 0 so why use it in "case Random(1) of"?
-+ The DDTM is static but you show that you know how to make it.
+ TPA finding.

Inidividuality: (**/100)
- Nothing special, but not many people would make a script like this.

Follow all SRL Rules: (**/100)
- Does not break out of possible infinite loops, and has alot of infinite loops in the script.
- Standards are a bit off.
+ Good use of "if not LoggedIn then Exit;".
+ Free's the DTM.

Creativity: (**/100)
- Not very much creative in this script, none of the functions gave me any "Woah!"-feelings.

Efficiency: (**/100)
- You have one procedure for every rock, and there is a possible infinite loop in every procedure! Not good…
- Do the Rock-finding procedures even work? :/
-+ Used the procedure RadialWalkTwo only once.

Presentation: (**/100)
- No heading.
- A VERY simple progress report, could have added things like player report, version number etc…

Meeting all requirements: (**/100)
+ Yes - barely.

Added extras: (**/100)
- None extras added.

Total (**/800) = **.**%

Coh3n

2009-08-16 00:10:30

Statements like this:

case random(1) of
0 : CloseBank;
end;
Don't need a case, they can easily be written like this:

if Random(1) = 0 then
CloseBank;
You don't need to have "= True" in statements like this:

if Players[CurrentPlayer].Booleans[0] = True then
Because and if..then..else statements checks if the condition is true, otherwise it is false. With that in mind you could have easily used an else statement to do the action if .Booleans[0] was false.

1. Technique (**/100)
  • Positives
    • I like how there aren't many global variables.
    • Your mining procedures show good knowledge of TPAs.
  • Negatives
    • What is the point of using a DDTM for ore? Why not use a normal DTM/Bitmap.
    • No failsafes for a lot of your walking.
2. Individuality (**/100)
  • Positives
    • Looks like the functions/procedures were made by yourself, which is good.
  • Negatives
    • All procedures are the typical mining procedures I see around the forums.
3. Follow all SRL rules (**/100)
  • Positives
    • Frees DTMs.
  • Negatives
    • Possible endless loop in all the Mine procedures.
4. Creativity (**/100)
  • Negatives
    • Didn't see much creativity at all in this script.
    • Progress report can be anything - be creative!
5. Efficiency (**/100)
  • Negatives
    • There are many times where you could have used an "else" statement.
    • Having a different procedure to find/mine every rock is very inefficient especially when it's pretty simple to put it into one function.
6. Presentation (**/100)
  • Positives
    • I like the comments in DeclarePlayers - makes it easy for someone new to SCAR.
  • Negatives
    • No header.
    • Progress report has nothing to it.
7. Meeting all Requirements (**/100)
  • Positives
    • All requirements are met as far as I can tell. Although, you don't actually check for a pickaxe, meaning if the player doesn't have one on them, the script will continue to try and mine without a pickaxe.
8. Added Extras (**/100)
  • Positives
    • SMART.
    • Banking, very nice addition.

Total: **/800 = **.*%

marpis

2009-08-18 22:22:03

1. Technique (/100)
- Finding functions are straight from some tutorial. Look at CTS values.
- Doesn't know how to use cases
- Serious lack of walking failsafes
- Doesn't know how to use DDTM

2. Individuality (/100)
- As I already mentioned, all "advanced" functions are straight from some tutorial

3. Follow all SRL rules (/100)
- Lack of if not loggedin then exit
- Multiplayer doesn't work

4. Creativity (/100)
- I don't see any imagination here. Why not use strings in DeclarePlayers? strings[x] := 'copper'?

5. Efficiency (/100)
+ FreeDTM, which shouldn't really be a plus… It's just something you must do
- All the finding functions are the same

6. Presentation (/100)
+ Commented DeclarePlayers
- Ore is set with integer, not with string
- Progressreport

7. Meeting all Requirements (/100)
- Multiplayer doesn't work properly, so I can't give 100

8. Added Extras (/100)
+ Banking

Total: **/800 = **.*%

Torrent of Flame

2009-08-21 16:39:10

With your Ore finding procedures, why do you write a new procedure for EVERY find ore. You need to use a case. Seriously. Use a case.

1. Technique (**/100)

– No cases or failsafes
– Poor use of DDTM

2. Individuality (**/100)

- Nothing special.

3. Follow all SRL rules (**/100)

– No failsafes.
+ Free's DTM

4. Creativity (**/100)

- Not much special
– Ore is declared with Integer, not string.

5. Efficiency (**/100)

- Nothing Notable.


6. Presentation (**/100)

+ A few comments
- No Strings, why not?
– No description or introduction
– Poor Progress Report.

7. Meeting all Requirements (**/100)

+ Does as far as i can see.

8. Added Extras (/100)

++ Banking
+ SMART


Total: **/800 = **.*%

EvilChicken!

2009-08-21 20:59:17

The first thing that strikes me when I open this script is that there are no instructions presented. Furthermore, your global varables could've been declared under DeclarePlayers, and your WriteReport could definetly have been placed there too. And to top my pickyness, indendation is required after constants and variables too. :p But, all of what I've mentioned doesn't count as anything negative of course, but you have to understand that it does indeed draw points from presantability.

Your WriteReport, which is your progress report, is just too simple - it doesn't cover the basic needs which I'd require from a proggy. It doesn't display the amount of time this script ran, it doesn't display the statuses of each player. It doesn't even show the script's name!
There are several tutorials on how to make a decent progress report, check the beginner's section of the tutorial island. Or, if you'd like to do it in a fancy way, use the Reports.scar include which is found in the /Misc folder in the SRL include folder.

The DeclarePlayers procedure is preperly commented, and that you use Players[].Integers[0] to determine what rock to mine is okay for me, as I see no marginal advantages of a string instead of your method.
What I on the other side do dislike is that you use Players[].Booleans[0] to see whether the pick is equipped instead of automatically detecting it, something which could've been done quite easily.

Instead of Players[].strings[0], you should've used a boolean. Not only is it bad that the string is case sensetive, it only has two valid outcomes, which could've been easier determined by making a boolean determine whether to bank or sell the mined ores.
On a side note, make it a habit to do "Lowercase(S)" on all user-input strings that the script checks. The parameter S is ofcourse to be replaced by the user-input string.

In SetOreDTM, you don't need to have declare all variables that are set to zero. Things like "dtmMainPoint.Tolerance := 0;" (line 69) can simply be deleted. Doing this shows that your knowledge is more advanced than knowing how to use Nielsie's DDTM generator.
But more importantly; which part of SetOreDTM is dynamic?
As you might know, the first "D" in DDTM stands for "dynamic" - which simply sums up the difference between DTMs and DDTMs. Basically, DDTMs can be modified during runtime, while "normal" DTMs are static.
You get a very small plus for having a DDTM in your script, but a minus because there is nothing dynamic about it.

I can't really say I like your RadialWalkTwo function, the only addition is a 5000 msec wait which I don't see the point of. If you're worred about FFlag(10) exiting too early because the flag isn't planted on the map yet; if that happened commonly, it would've been fixed in SRL quite some time ago.
Plus, if you still insisted on having it there, you might want to ultilize your function with the help of SRL functions, something like this:

function RadialWalkTwo(TheColor, StartRadial, EndRadial, Radius, Xmod, Ymod: Integer): Boolean;
var
TPA: TPointArray;
I: Integer;
begin
Result := False;
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
Result := WaitFunc(@FlagPresent, 50, 2500);
if (Result) then
begin
FFlag(10);
Exit;
end;
end;
Plus, waiting 5 entire seconds for the flag to appear each single time this function is called, is way too long.

Your AntiRandoms procedure is peculliar. First, varaible decleration standards are off. Small thing, but not too pretty.
Second, the character will never run back if a gas or a fight is detected.
Instead of using RunAway('E', True, 2, ..), simply add in a "3" as the third parameter: "RunAway('E', True, 3, 2000 + Random(2000));".
Furthermore, you could've used an or statement to shorten this procedure, so instead of doing "if FindGas then RunAway; If FindFight then RunAway", you should rather have written "if FindGas or FindFight then RunAway".

You do not ultilize your usage of FindGas either.
Instead of using in inside a rock-finding function and passing the coords of the found rock to the FindGas function, you pass two emply variables in there. It would actually be more efficient to do "FindGas(0, 0)", which is what you did, except that you used empty variables.

Your AntiBan procedure is all fine, but why does the random gametab range only go from 1 to 6? There are more available tabs than that.

First of all, I have to compliment you for your object finding. You use TPAs in an efficient way, something that is rather remarkable for a jr. member.
.. but (you knew there had to be one. I mean, look at my avatar?) why in the world do you have to have almost the exact same code repeated for entire 152 lines?
You should much rather have made a general object finder that takes colors as a parameter, and with various other options as additional parameters. Plus, you have the same CTS2 values for every object finding function. And, why in the world is your CTS2 saturation modifier set to 30? That is by far the highest value I've ever seen used in association with the CTS2 saturation modifier.
And, on a side note, array of TPointArray is declared as a T2DPointArray in WizzyPlugin. If you want to make things look prettier, declare ATPA like this:
ATPA: T2DPointArray;

Standards are off in WalkToMine – but more importantly; you have no failsafes in your walking! As you might remember, failsafes was a point in the competition's requirements list - and it was there for a reason. Failsafes are very important for extending a scripts maximal runtime, and for the script not to be stuck in a loop due to an unpredicted even taking place.

And, after WalkToMine comes 119 more lines of repeated code. You really need to learn proper usage of cases, as they are crucial for coding efficiency. Instead of having all those Mine*rock*; procedures, you could've had one simple looking like this:

procedure MineRock;
var
RockFound: Boolean;
begin
repeat
case Players[CurrentPlayer].Integers[0] of
0: RockFound := FindGold(X, Y);
1: RockFound := FindCopper(X, Y);
et cetera ..
end;
if (RockFound) then
begin
AntiBan;
AntiRandoms;
wait(200 + random(300));
end else
begin
...
end;
until(InvFull);
IncEx(OresMined, 27);
end;

Plus, if you would've ultilized your rockfinding functions like I said using cases, you could've just done "RockFound := FindRock(Players[CurrentPlayer].Integers[0]", if a case declaring which number represents which rock were to be found inside the potential FindRock.

Moving on, WalkToShop is written in an inefficient way. If you read all of what I wrote so far, you understand what I mean. But, bonus points for having some failsafes there.

Your MineRocks is a perfect example where I you should've used a case.
This would be a more correct way to do it:

procedure MineRocks;
begin
case Players[CurrentPlayer].Integers[0] of
1: MineCopper;
2: MineTin;
3: MineIron;
4: MineGold;
end;
end;
Doesn't that look much neater?
On a side note, you don't need begin and end statements if you're only checking one statement:

procedure Example;
begin
if (True = True) then // No begins.
WriteLn('True equals True.'); // No ends.
// Why? Because we only had ONE statement after the "if-then" line.

if (True xor False) then
begin // Here we need a begin,
if (not LoggedIn) then exit; // Because we first check if we're logged in
WriteLn('True xor False equals True.'); // and THEN check the other statement.
end; // Since we have two statements, we need to have begins and ends.
end;

In DepositStuff you have another applicable case where you can add cases.
What surprizes me is that you actually have used a case in this procedure.
.. but, you've done it slightly wrong. First, Random(X) returns an integer which can have a maximal value of X - 1. That means, Random(2) can result 0..1 and Random(100) can result numbers ranging from 0 to 99.
Besides, if your case only has two outcomes, (boolenian) you can make it into an "if..then..else"-statement. Your case would be better written like this:

if (Random(2) = 0) then
CloseBank;

Again, very poor failsafes in WalkToBank and WalkBackToMine. WalkBackToMine also has a strange syntax that by all means should be improved.

In your mainloop, it would be highly adviseable to apply the things I told you about Lowercase() if you're determined on using strings.

Finally, you get few bonus points for adding S.M.A.R.T. :)



Technique (**/100)

You really need to learn cases. This is a basic thing which could've improved your script by a lot if you had applied them correctly in your script.

Individuality (**/100)

Plus points for showing good knowledge of one- and two-dimensional TPoint arrays – but a significant minus for the style. I am truly sorry, but you have to face the fact; there is over 300 lines of code that can be deemed unnecessary by using correct scripting techniques.

Follows all SRL rules (**/100)

In the restricted cases where you actually do have failsafes, they all have room for significant improvement. You do not have correct multiplayer procedures, and there are quite a lot of places where "if not (LoggedIn) then exit;" wasn't found.

Creativity (**/100)

Nothing that was "out of the box", nothing that even was close to it. Even in areas where there was room for creativity, (like your progress report) you settled for simplicity.

Efficiency (**/100)

Not good, not good.
I've reasoned this low score in my entire text, and I am really hoping you follow my advice.



Presentation (**/100)



This is what's written in the marking scheme:

Presentation of a script is always important! And this should be easy marks. There are only 4 categories. Do you have a respectable title page? A decent progress report? Good scripting standards? Commented procedures and functions? (which is the one everyone always forgets!)

As I commented at the very start of my text, you have no title page. That's minus 25 points already. Furthermore, a decent progress report? Minus 25 more points. Good standards? Minus five, as they're pretty sloppy quite a lot of places. Finally, do you have commented procedures and functions? No. I see not a single comment in your script below your DeclarePlayers procedure.

Meeting all Requirements (0/100)

Your multiplayer is faulty, your antirandom procedure is inefficient, you do not autodetect whether the pick is equipped or not and your progress report is not decent. I'm again sorry, but no points for you on this.

Added Extras (**/100)

You have no extra features, and nothing that covers any aspects besides the very core of the required points.


Total score: (**/100) = **%

Sir R. M8gic1an

2009-09-04 01:29:02

From: marpis
1. Technique (/100)
- Finding functions are straight from some tutorial. Look at CTS values.


Is anyone able to find a tut with these exact values? I also find it somewhat strange that he'd be able to do a TPA finder but wouldn't think of using an array + case to avoid having 4 similar procs…

~RM

Sir R. M8gic1an

2009-09-04 01:36:16

Technique (…/100)
[INDENT] + TPA Finding
+ Good Use of Local variables
- Could use Player.Strings to set the rock, rather than a constant
- Should've used a Case statement, rather than several mining procedures
- Failsafes missing for the walking
- Random(1) always returns 0
- Using a case with only one option, better of using and if statement
- Static DDTM, should've used a normal one
- There is no need to compare a boolean to true, it does so automatically

if Players[CurrentPlayer].Booleans[0] = true then
//Could be
if Players[CurrentPlayer].Booleans[0] then
- Using a case on a string is CaSe SenSiTive, therefore you should always make it insensitive if it involves user input as Players[CurrentPlayer].Strings[0] does.

case Lowercase(MyString) of
'lowercased string': //...
'other lowercased string': //...
'another lowercased string': //...
end;

- When checking for conditions to do an action, you could jumble them together;

if FindGas(x, y) then RunAway;
if FindFight then RunAway;
//This could be
if (FindGas(x, y))or(FindFight) then RunAway;

- When a condition statement if only followed by one other statement it does not need begin / end

if not LoggedIn then
begin
exit;
end;

//could be

if not LoggedIn then exit;

- "OresMined := OresMined + 27;" Considering that you already have an ore DTM, it is better practice to use CountItems and get an accurate counting of how many ores were mined (maybe you got a random event box, or a gem).[/INDENT]

Individuality (…/100)
[INDENT]You know what you are doing, however, you do not seem to know it so well that you have developped your own style yet. Your script as it is would not make a person link it directly to you, rather it would remind them of the tutorials they have read. Keep on scripting and once it becomes as if you were speaking it will mean you have developped yourown style already.[/INDENT]

Follows all SRL rules (…/100)
[INDENT]- if not LoggedIn missing in some loops.
- Possible infinite loops, like for example, in the mining procedures.
- More Failsafes should be added
- Multiplayer not used to it's full potential. Should've used Players[].Strings[] rather than a constant to define which rock to mine, so each player could mine a different one.
+ Good habit of freeing dtms
- NextPlayer should be called in MainLoop, rather than in lower level procs/funcs as otherwise you're character might end up stuck in a loop he shouldn't be in.
[INDENT]e.g. Player 1 is tries to walk to mine but it fails; You call next player; This new player is in the bank, but he thinks he should be mining, therefore it goes to false as well because he can't find the rocks.[/INDENT]

if Players[CurrentPlayer].strings[0] = 'bank' then
begin
WalkToMine;
end;
MineRocks;
[/INDENT]

Creativity
(…/100)
[INDENT] - You do not seem to have gone out of your way to make inventive processes. There is a lot of room for creativity, especially in the progress report.
+ Very creative of you to think of banking as well as selling[/INDENT]

Efficiency (…/100)
[INDENT] - There are many times where you could have used an "else" statement.
- Having a different procedure to find/mine every rock is very inefficient especially when it's pretty simple to put it into one function.
- Used the procedure RadialWalkTwo only once.[/INDENT]

Presentation (…/100)
[INDENT] - No Intro
- Simple Progress Report
+ Standards are good, a bit out of place at times
+ Comments in DeclarePlayers
- Not really commented throughout the script[/INDENT]

Meeting all Requirements (100/100)
[INDENT] + - It does meet all requirements, although all players have to mine the same rock.
- Also, you never check for a pickaxe, meaning that you can have it in inventory, equipped or not have it at all.[/INDENT]

Added Extras (…/100)
[INDENT]+ Banking, however the walking should have a few more failsafes.
+ Smart[/INDENT]

Total Score: (… / 800) = ..%

Sir R. M8gic1an

2009-09-04 03:03:24

I just did a sum up of everything you posted and a couple of things i noticed. Did i miss anything out? Serious GJ over here guys.

~RM

Coh3n

2009-09-04 03:22:31

Typo: Under Presentation, the last '-', you have throught instead of throughout. :p Just thought I'd let you know. As far as I can see, your sum it up quite nicely. ;) However, does this person really deserve 100/100 for Meeting all Requirements?

ZephyrsFury

2009-09-04 13:25:56

So whats the final score?

Sir R. M8gic1an

2009-09-04 13:42:22

From: Coh3n
Typo: Under Presentation, the last '-', you have throught instead of throughout. :p Just thought I'd let you know. As far as I can see, your sum it up quite nicely. ;) However, does this person really deserve 100/100 for Meeting all Requirements?


From: RM

You will get 100 points for meeting all the requirements. 0 If you fail to meet even just one of them.


~RM

Coh3n

2009-09-04 18:33:33

Yeah I guess so… It did say just to have the option of having it equipped or in the inventory, and I guess it can. It is just a big issue in my opinion because it will still try to mine even if there is no pickaxe.

Sir R. M8gic1an

2009-09-04 20:53:44

From: Coh3n
Yeah I guess so… It did say just to have the option of having it equipped or in the inventory, and I guess it can. It is just a big issue in my opinion because it will still try to mine even if there is no pickaxe.


inorite? but in a way it does meet them, no matter how badly. The fact that it can also not have a pickaxe would've been penalized in technique.

~RM

Coh3n

2009-09-04 21:26:29

From: Rasta Magician
inorite? but in a way it does meet them, no matter how badly. The fact that it can also not have a pickaxe would've been penalized in technique.

~RM


Okay I understand. :) But.. what's inorite? :o

Sir R. M8gic1an

2009-09-04 21:50:45

inorite? = I know, right?

~RM

Coh3n

2009-09-04 21:51:59

From: Rasta Magician
inorite? = I know, right?

~RM


Lmao :duh: