SRL Archive - Judges' Spot

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


Sir R. M8gic1an

2009-08-12 14:48:43

This is here for people to give their opinions on it.


Do take into account this was for rev #30 or something.

{
RIMMINGTON MINER BY *****

INSTRUCTIONS
1. Start Anywhere (mine, store, or anywhere in between)
2. Press Start

F11: Reset Players
F12: Toggles between Player Report and Randoms Report
}

Program RimmingtonMiner;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
{.Include SRL\SRL\Skill\Mining.scar}
{.Include SRL\SRL\Misc\Users.scar}

type
Response = record
Question: array of string;
Answer: array of string;
Timer: integer;
end;

var
x, y, i, ReportType, RespondTimer, Time, Timer: integer;
Bmp_Ore, Shopkeepers, RockIndex: integer;
Xp: extended;
RockLocation: TPoint;
AutoResponse: Array of Response;

const
SRL_ID = ''; //SRL Stats
SRL_Password = '';

Rock = 'Copper';
MinTime = 15; //Time per player (minutes)
MaxTime = 25;


Procedure PlayerReport;
var
i, Width: integer;
s: string;
begin
ClearReport;
AddToReport(' Player Report (F11 = Reset)');
for i:=0 to High(Players) do
begin
s := ' ' + Players[i].Name;
While Length(s) <= 13 do
s := s + ' ';
case Players[i].Active of
True: s := s + '(Active)';
False: s := s + '(Inactive)';
end;
While Length(s) <= 25 do
s := s + ' ';
s := s + IntToStr(Players[i].Integers[0]) + ' Ore';
While Length(s) <= 35 do
s := s + ' ';
s := s + IntToStr(Round(Players[i].Integers[0]*Xp)) + ' Xp';
if Length(s) > Width then
Width := Length(s);
ChangeReportWidth(Width*9 + 4);
AddToReport(s);
end;
end;


Procedure ProgressReport(s: string);
var
OreMined: integer;
begin
for i:=0 to High(Players) do
IncEx(OreMined, Players[i].integers[0]);

if s = '' then
begin
s := GetDebugLine(2);
end else
s := 'Status: ' + s;

if IsFKeyDown(12) then
case ReportType of
0: ReportType := 1;
1: ReportType := 0;
end;

if IsFKeyDown(11) then
if GetApplication.Messagebox('Reset Players?', 'Rimmington Miner by ****', 1) = 1 then
begin
for i:=0 to High(Players) do
Players[i].Active := true;
Writeln('Players Reset');
Wait(1000);
end;

ClearDebug;
Writeln('Rimmington Miner by *****');
Writeln(Capitalize(Rock) + ' Ore Mined: ' + IntToStr(OreMined));
Writeln(s);
Writeln('Next Player In ' + IntToStr( (Time - TimeFromMark(Timer))/60000) + ' Minutes');
Writeln(TimeRunning);
Writeln('');

case ReportType of
0: begin
Writeln('Press F12 to Show Player Report');
SRLRandomsReport;
end;
1: begin
Writeln('Press F12 to Show Randoms Report');
PlayerReport;
end;
end;
end;


Function StoreScreen: boolean;
begin
Result := FindTextTPA(2071807, 30, 170, 32, 365, 48, 'Store', upchars, Nothing);
end;


Function Direction(x1, y1, x2, y2: integer): extended;
var
x, y, h: extended;
begin
x := (x1 + x2)/2;
y := (y1 + y2)/2;
h := Hypot(x, y);
Result := -1;

case 0 of
x: Result := Degrees(ArcCos(x/h));
y: Result := Degrees(ArcSin(y/h));
h: exit;
end;

if Result = -1 then
Result := Degrees(ArcTan(y/x));
end;


Procedure AutoRespond;
var
a, b, c: integer;
n: string;
begin
if not LoggedIn then
exit;
if TimeFromMark(RespondTimer) < 5000 then
exit;

LastChatter(n);
if n = Players[CurrentPlayer].Name then
exit;

for a:=0 to High(AutoResponse) do
begin
for b:=0 to High(AutoResponse[a].Question) do
begin
if TimeFromMark(AutoResponse[a].Timer) < 120000 then
exit;
if Pos(Lowercase(AutoResponse[a].Question[b]), Lowercase(GetChatBoxText(8, clBlue))) > 0 then
begin
c := Random(GetArrayLength(AutoResponse[a].Answer));
SaveToChatLog;
AddToSRLLog(Players[CurrentPlayer].Name + ': ' + AutoResponse[a].Answer[c]);
Writeln('Typing Auto Response');
Wait(RandomRange(500, 1500));
Typesend(AutoResponse[a].Answer[c]);
MarkTime(RespondTimer);
MarkTime(AutoResponse[a].Timer);
exit;
end;
end;
end;
end;


Procedure AntiBan;
var
Angle: integer;
begin
if not LoggedIn then
exit;
case Random(750) of
0, 1: HoverSkill('mining',false);
2: HoverSkill('random', false);
3: BoredHuman;
4: SleepAndMoveMouse(250+random(250));
5: RandomRClick;
6: begin //Checks friends list
GameTab(8);
Wait(1000+random(500));
MMouse(MIX1,MIY1,160,240);
Wait(1000+random(500));
GameTab(4);
end;
7, 8: begin
Angle := Round(rs_GetCompassAngleDegrees);
MakeCompass(IntToStr(RandomRange(Angle - 45, Angle + 45)));
end;
9, 10, 11, 12, 13, 14: PickUpMouse;
end;
end;


Procedure AntiRandom;
begin
ProgressReport('');
if not LoggedIn then
exit;
FindNormalRandoms;
AutoRespond;
AntiBan;

if FindFight then
RunAway('s', true, 1, RandomRange(15000, 25000));
end;


Function CharMoving: boolean;
var
C1, C2, C3, C4: integer;
begin
Result := false;
C1 := GetColor(MMCX - 25, MMCY - 25);
C2 := GetColor(MMCX + 25, MMCY - 25);
C3 := GetColor(MMCX + 25, MMCY + 25);
C4 := GetColor(MMCX - 25, MMCY + 25);

Wait(500);

if not((GetColor(MMCX - 25, MMCY - 25) = C1)) then
Result := true;
if not((GetColor(MMCX + 25, MMCY - 25) = C2)) then
Result := true;
if not((GetColor(MMCX + 25, MMCY + 25) = C3)) then
Result := true;
if not((GetColor(MMCX - 25, MMCY + 25) = C4)) then
Result := true;
end;


Procedure SetCompass;
{ Sets the compass in 45 degree increments so your
character is not standing in front of the ore }
var
i, Angle: integer;
begin
Angle := Round(rs_GetCompassAngleDegrees);
for i:=0 to 3 do
if InRange(Angle, i*90 + 30, i*90 + 60) then
exit;

i := Random(4);
MakeCompass(IntToStr(RandomRange(i*90 + 30, i*90 + 60)));
end;


Function SymbolWalk(Symbol: string; XOffset, YOffset: integer): boolean;
// DDTMs weren't working good in Rimmington :(
var
x, y, XMod, YMod: integer;
Angle: extended;
begin
Result := false;
if not LoggedIn then
exit;
if not FindSymbol(x, y, Symbol) then
exit;

Angle := rs_GetCompassAngleRadians;
x:= x + round(XOffset*cos(Angle) - YOffset*sin(Angle));
y:= y + round(XOffset*sin(Angle) + YOffset*cos(Angle));

if x > MSCX then
begin
XMod := -4;
end else
XMod := 4;

if y > MSCY then
begin
YMod := -4;
end else
YMod := 4;

if Distance(MMCX, MMCY, x, y) > 10 then
begin
if MFNF(x, y, XMod, YMod) then
begin
FFlag(30);
Result := true;
end;
end else
Result := true;

AntiRandom;
end;


Procedure WalktoStore;
var
MMAngle: integer;
Angle: extended;
begin
if not LoggedIn then
exit;
ProgressReport('Walking To Store');

repeat
MMAngle := Round(rs_GetCompassAngleDegrees);
if FindDTMRotated(Shopkeepers, x, y, MMX1, MMY1, MMX2, MMY2, Radians(MMAngle-30), Radians(MMAngle + 30), 0.05, Angle) then
begin
if Distance(MMCX, MMCY, x, y) < 20 then
exit;
Mouse(x, y, 0, 0, true);
FFlag(0);
exit;
end;

if not SymbolWalk('store', 0, 0) then
if not SymbolWalk('portal', 14, 12) then
if not SymbolWalk('water', 15, -20) then
if not RadialWalk(FindRoadColor, MMAngle + 190, MMAngle + 260, 65, 1, -1) then
SymbolWalk('mining spot', -15, 20);

AntiRandom;
until(false);

Wait(RandomRange(250, 500));
ProgressReport('');
end;


Procedure WalktoMine;
var
MMAngle, t: integer;
Angle: extended;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
exit;
if SymbolWalk('mining spot', RockLocation.x, RockLocation.y) then
exit;
ProgressReport('Walking To Mine');
SymbolWalk('store', 60, -36);
MarkTime(t);
repeat
if SymbolWalk('mining spot', RockLocation.x, RockLocation.y) then
break;

MMAngle := Round(rs_GetCompassAngleDegrees);
if not SymbolWalk('mining spot', 0, 0) then
if not RadialWalk(FindRoadColor, MMAngle + 15, MMAngle + 85, 65, 1, -1) then
if not SymbolWalk('water', 20, -20) then
begin
Angle := rs_GetCompassAngleRadians;
x:= MMCX + round(55*cos(Angle) - 17*sin(Angle));
y:= MMCY + round(55*sin(Angle) + 17*cos(Angle));
end;
AntiRandom;
until(TimeFromMark(t) > 30000);

ProgressReport('');
end;


Function TradeShopkeeper: boolean;
var
i, t: integer;
Colors: Array of integer;
begin
if not LoggedIn then
exit;
if StoreScreen then
begin
Result := true;
exit;
end;

Colors := [12765898, 3032132, 5734044]

While CharMoving do
Wait(100);

for i:=0 to 2 do
begin
if FindObjTPA(x, y, Colors[i], 10, 1, 4, 4, 12, ['hop']) then
begin
Mouse(x, y, 0, 0, false);
Wait(RandomRange(50, 100));
if ChooseOption('Trade') then
begin
MarkTime(t);
repeat
Wait(100);
until((StoreScreen) or (TimeFromMark(t) > 10000));
Wait(RandomRange(400, 800));
Result := StoreScreen;
exit;
end;
end;
end;
end;


Procedure SellOre;
begin
if not LoggedIn then
exit;
if not TradeShopkeeper then
exit;
ProgressReport('Selling Ore');
GameTab(4);
if FindBitmapToleranceIn(Bmp_Ore, x, y, MIX1, MIY1, MIX2, MIY2, 40) then
begin
MMouse(x, y, 4, 4);
Wait(RandomRange(100, 200));
if IsUpText('re') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, false);
Wait(RandomRange(50, 100));
ChooseOption('50');
end;
Wait(RandomRange(300, 600));
end;
CloseWindow;
AntiRandom;
ProgressReport('');
end;


Function FindRocks: boolean;
var
x, y, t: integer;
Angle: extended;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;

Result := false;
case RockIndex of
1, 2: t := GetSystemTime + 1000;
3: t := GetSystemTime + 5000;
4: t := GetSystemTime + 105000;
end;

While GetSystemTime < t do
begin
Wait(250);
AntiRandom;
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;
end;

WalkToMine;
While CharMoving do
Wait(100);
if not FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
if not FindSymbol(x, y, 'mining spot') then
begin
Writeln('Could not Find Mine Symbol');
TerminateScript;
exit;
end;
Angle := rs_GetCompassAngleRadians;
x:= x + round(RockLocation.x*cos(Angle) - RockLocation.y*sin(Angle));
y:= y + round(RockLocation.x*sin(Angle) + RockLocation.y*cos(Angle));

MakeCompass(FloatToStr(Direction(MSCX, MSCY, x, y)));
SetAngle(false);
if FindAllRocksRecord(Rocks, RockIndex, false, true) then
begin
Result := true;
exit;
end;
end;
end;


Procedure MineOre;
var
x, y, OreCount, Timeout, T: integer;
RockPos: TPoint;
Rocks: TPointArray;
begin
if not LoggedIn then
exit;
if InvFull then
exit;

SetCompass;
While CharMoving do
Wait(100);

if not FindRocks then
begin
ProgressReport('Could not Find Rocks');
Players[CurrentPlayer].Active := false;
exit;
end;

//Finds rock without gas near it
if not FindGas(x, y) then
begin
x := -100;
y := -100;
end;
FindAllRocksRecord(Rocks, RockIndex, false, true);
if GetArrayLength(Rocks) = 0 then
exit;
SortTPAFrom(Rocks, Point(MSCX, MSCY));
for i:=0 to High(Rocks) do
begin
if Distance(x, y, Rocks[i].x, Rocks[i].y) > 100 then
begin
MMouse(Rocks[i].x, Rocks[i].y, 0, 0);
Wait(RandomRange(100, 150));
if IsUpText('Rock') then
break;
end else
if i = High(Rocks) then
exit;
end;

ProgressReport('Mining');
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);

RockPos := Point(x, y);
OreCount := CountItemsIn('inv', 'bmp', Bmp_Ore, [40]);
MarkTime(Timeout);
MarkTime(T);

While TimeFromMark(T) < 1000 do
begin
Wait(100);
FindPick;
AntiRandom;

if CountItemsIn('inv', 'bmp', Bmp_Ore, [40]) = OreCount + 1 then
begin
Inc(Players[CurrentPlayer].integers[0]);
Inc(ReportVars[0]);
exit;
end;

//Checks if there is ore in the rock
FindAllRocksRecord(Rocks, RockIndex, false, true);
if GetArrayLength(Rocks) = 0 then
exit;
SortTPAFrom(Rocks, RockPos);
if Distance(Rocks[0].x, Rocks[0].y, RockPos.x, RockPos.y) < 30 then
begin
RockPos := Rocks[0];
MarkTime(T);
end;

if InvFull then
break;

if TimeFromMark(TimeOut) > (RockIndex/4 + 1)*30000 then
break;

if FindGas(x, y) then
begin
if Distance(RockPos.x, RockPos.y, x, y) < 100 then
begin
Writeln('Gas Detected');
AddToSRLLog('Gas Detected');
Mouse(MMCX + 8, MMCY + 8, 2, 2, true);
break;
end;
end;
end;


Wait(RandomRange(50, 100));
if CountItemsIn('inv', 'bmp', Bmp_Ore, [40]) = OreCount + 1 then
begin
Inc(Players[CurrentPlayer].integers[0]);
Inc(ReportVars[0]);
end;
end;


Procedure SetupAutoRespond;
begin
SetLength(AutoResponse, 6);
AutoResponse[0].Question := ['hi', 'hello', 'hey', 'helo'];
AutoResponse[0].Answer := ['hi', 'hello', 'hey'];

AutoResponse[1].Question := ['mining level', 'mining lvl', 'minin level',
'minin lvl', 'mine level', 'mine lvl'];
AutoResponse[1].Answer := [IntToStr(GetSkillLevel('mining'))];

AutoResponse[2].Question := ['lol', 'lawl', 'rofl', 'haha', 'lmao'];
AutoResponse[2].Answer := ['lol', 'lawl', 'rofl', 'haha', 'lmao'];

AutoResponse[3].Question := [Players[CurrentPlayer].Nick];
AutoResponse[3].Answer := ['no hablo ingles', 'je ne parle pas anglais', 'I cant talk im muted'];

AutoResponse[4].Question := ['hablo espanol'];
AutoResponse[4].Answer := ['no hablo espanol', 'no comprendo', 'yo vivo en taco bell'];
end;



Procedure SetupPlayer;
begin
if not LoggedIn then
LoginPlayer;
SetAngle(true);
FindPickHeadColor;
SetupAutoRespond;
ProgressReport('');
end;

Procedure Setup;
begin
SetupSRL;
SetupMining;
SRLPlayerForm(True, [], [], [], []);
SMARTSetupEx(121, False, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);

case Capitalize(Rock) of
'Iron':
begin
Bmp_Ore := SRL_GetBitmap(1);
RockIndex := 3;
RockLocation := Point(-35, 6);
Xp := 35;
end;
'Copper':
begin
Bmp_Ore := SRL_GetBitmap(2);
RockIndex := 1;
RockLocation := Point(3, -20);
Xp := 17.5;
end;
'Tin':
begin
Bmp_Ore := SRL_GetBitmap(3);
RockIndex := 2;
RockLocation := Point(25, 16);
Xp := 17.5;
end;
'Gold':
begin
Bmp_Ore := SRL_GetBitmap(6);
RockIndex := 4;
RockLocation := Point(0, 24);
Xp := 65;
end;
end;

if RockIndex = 0 then
begin
Writeln('ERROR: Rock Type Not Recognized');
TerminateScript;
end;

Shopkeepers := DTMFromString('78DA638C6162608865400139A9290C29409A1' +
'188FF03016338504D28AA9AB76F1918F8A16A4080319AB01A00C6' +
'C80B89');

ScriptID := '1146';
SRLID := SRL_ID;
SRLPassword := SRL_Password;
SRL_Procs[0] := @AntiRandom;
end;

begin
Setup;
RandomNextPlayer(Players[CurrentPlayer].Active);
SetupPlayer;

repeat
Time := RandomRange(MinTime*60000, MaxTime*60000);
MarkTime(Timer);

repeat
case InvFull of
True: begin
WalkToStore;
SellOre;
end;
False: begin
WalkToMine;
MineOre;
end;
end;
if not LoggedIn then
break;
if Players[CurrentPlayer].Active = false then
break;
until(TimeFromMark(Timer) > Time);

Logout;
RandomNextPlayer(Players[CurrentPlayer].Active);
until(false);

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

Sir R. M8gic1an

2009-08-13 16:12:16

1. Technique (80 / 100)

Very good technique, good use of Types, although you could've it them for the rocks as well. Extremely good use of math and logic, although one of your calculations was wrong. Very good auto responder, and Setup Auto respond. But there are times when an if would've been better used than a case and you still went for the case. When it's a simple true/false an if as a better choice.

finally, there was just a little something that would've been the chery on top of the icing:

case Capitalize(Rock) of
'Iron': //...
'Copper': //...
'Tin': //...
'Gold': //...
else: begin Writeln('ERROR: Rock Type Not Recognized'); TerminateScript; end;
end;

you can use else in a case ;) Some points were taken away for bad use of FindGas(x,y) as looking through your code it looks like you expect it to save the gas coordinates to (x,y), while what it actually does is check if there is gas at (x,y)

2. Individuality (**/100)

Very few would've been able to do such a script, and you use a wide variety of functions and procedures from the SRL Include, showing that you don't just use the same one's as everyone does, and you also choose well when to make a function and the looping you do shows you clearly know what you are doing.

3. Following SRL Rules (**/100)

This was a part that i was strongly disapointed with. Breaking out of loops and etc was fine, but a few more functions needed that if not loggedin then exit; failsafe. I don't know how you expect to get the compass angle while logged out. But what pushed this grade don so much was the bad use of multiplayer. The switching of players is fine although i hate it for being random, but the fact that ALL the players have to mine the SAME rock is something that you could have very easil overpassed. Players[CurrentPlayer].Strings[0] = 'iron';

4. Creativity (** / 100)


Very creative, lots of innovative functions created, uncommon techniques used.

5. Effieciency (** / 100)


Possible Infinite loop in WalkToStore, cases used when it should've been if, some variables would've been better as arrays, and, in a case, when you have a long list of numbers such as "3,4,5,6,7,8,9,10" you can just do "3..10"

6. Presentation (** / 100)

Script header was minimal, progress and player reports aren't quite presentable, standards are perfect, comments were fine.

7. Meeting all Requirements(** / 100)


You met all the extra requirements.

8. Added Extras (**/100)

Extremely good auto-responder. SRL Stats, GJ. Smart, although you don't leave the option of not using it.

Total Score: (*** / 800) = **%


~RM

marpis

2009-08-14 16:07:47

1. Technique (**/100)
+ Using custom Types
+ Decent failsafes
- No DDTM and RadialWalk is only a failsafe? What?
- Too many global variables

2. Individuality (**/100)
+ Very unique calculations on angles etc

3. Follow all SRL rules (**/100)
+ I didn't notice any mentionable infinite loops
- All players have to mine the same rock

4. Creativity (**/100)
+ Calculations and trigonometry
+ Autoresponder texts
- All players have to mine the same rock

5. Efficiency (**/100)
- Global variables, bitmaps for example
- Bitmaps and DTMs not freed

6. Presentation (**/100)
+ Report to debugbox in almost every procedure
- Bad instructions. Reset players what?

7. Meeting all Requirements (**/100)
+ You met all the requirements

8. Added Extras (**/100)
+ Autoresponder
+ SRL Playerform

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

Baked0420

2009-08-14 18:59:05

Technique: (**/100)

-bmp_ore, I like it, because you only have to search for one variable no matter which ore inputted, dont like how it can only be one ore mined though
-A type for autoresponder
-9, 10, 11, 12, 13, 14: in antiban and not 9..14:
-some trig in direction, not bad, I don't see trig often at all


Inidividuality: (**/100)

-Case booleans of, as opposed to case integers of, haven't seen that before, though it's not really needed when yuo can just if then else, but original none the less.
-typical antiban
-random next player, most the time I just see nextplayer
-own custom made functions, ones you'd think you'd see in SVN such as, StoreScreen, and CharMoving (don't think IsMoving was in svn when comp was released, could be wrong, but I dont think it was)


Follow All SRL Rules: (**/100)

-Did not free Bmp_Ore from Srl_GetBitmap
-Did not free Shopkeepers which was a DTM
-Can be stuck in a loop at WalkToStore, only ways to break out are by finding the DTM shopkeepers, and by being logged out
-Had multiplayer


Creativity: (**/100)

-I like the CharMoving, although there can be false false's, like it can return as character is moving when it's not since there is no tolerance and colors shift
-response being a type
-Rock coulda been a type also, but not too big of a deal to me, still creative how you did that setup, as long as you didn't steal it from another script


Efficiency: (**/100)

-never freed bitmap/dtm, big pet peev of mine (mentioned earlier, but this also makes it inefficient)
-can only mine one ore? and for all characters?
-there are 5 if not's in walk to store, good, but bad infinite loop
-WalktoMine has repeat with an until TimeFromMark, and breaks and exits within the loop, so it's not only timed, but if it doesn't break, the timer breaks it
-only has to search for the bmp declared (since it only uses one, but since it does, it's good, he doesn't try searching for all bmp's)
-Uses case Capatilize(Rock) of and then the rock types to declare the bmp, rockindex, location, and exp, I like it, so it doesn't have to repeat things, such as looking for every ore to find which to sell
-SRLPlayerForm, it's saves you from putting in a specific player amount
-SRLPlayerForm not containing the following: SRL_ID, SRL_Password, but especially: Rock, MinTime, MaxTime, inneficient to me to have those in the script, when it can just easily be added to SRLPlayerForm, it's what the parameters are there for


Presentation: (**/100)

-I don't see the decription for each custom made procedure/function
-Few notes in there along with coding, that never hurts
-Not much of a header unfortunately
-Standards looked good, sometimes there would be lines skipped, but I guess if that's how you do it then go ahead, didn't make it any harder to read, nice standards.
-Just tell people to be anywhere between mine and store, what about a pick?
-You don't mention pick can be wielded or in inventory, well nothing bout pick, but that should be mentioned.

Meeting All Requirements: (***/100)

-all requirements met, goodjob


Added Extras: (**/100)

-Autoresponder, GREAT, always good to have, I believe more then 50% of bans are due to no autoresponder along with fishyness, and when you don't talk at all, it leads to legit people reporting, at least there's something to talk in there
-but I take off 5 points for not having the quickchat question for mining level (What is your level in mining?) it has pretty much all the other ways to ask though, which is good.
-SRL Stats, even if they don't work, you show you know how to use it, could add more then one variable though, but I won't penalize for that.
-Srl_Procs call, nice

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

Gu3st...

2009-08-14 20:22:58

Technique: (**/100)
- Only calls SetupPlayer; once.
+ CharMoving: An easy but yet effective method for checking if you are moving, only downside would be if one of the colours were a NPC, Player or a item.
+ AutoResponder: Uses type records.
+ Failsafes.

Inidividuality: (**/100)
+ You show us that you know alot about the SRL Include and it's functions.
+ You know what you are doing when making functions.
TIP: "if BOOLEAN then" is faster than "case BOOLEAN of" so you would want to use if … then in the future :)

Follow all SRL Rules: (**/100)
- DTMs and BMPs not free'ed!
-+ Uses timers to break out of eventually infinite loops. Unfortunate there is one infinite loop in WalkToStore;…
+ Can't find any other rule breaks.

Creativity: (**/100)
- Could have made the AntiBan better/more creative way.
- Only one type of rock to mine. This is what makes the points for Creativity low.
+ Many useful functions created.
+ Uncommon techniques.
+ Trigonometry.

Efficiency: (**/100)
- You don't free the DTMs and BMPs which makes the script unable of running for longer periods because SCAR would eventually crash.
- I've said it before but each player should be able to mine any rock, not only one.
- Too many global vars.
- It doesn't seem like you fully understands the use of SRLPlayerForm.

Presentation: (**/100)
- Could have made a form or an intro.
- Could have made header bigger.
- Progress report isn't actually very beautiful.
+ Comments.
+ Standards!

Meeting all requirements: (**/100)
+ All requirements met.

Added extras: (**/100)
+ Auto Responder: This is very good! This makes the macro look alot less bot-like! ++ For that.
+ SRL_Procs[]: Not alot of people uses this (!), even though they are so useful.

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

NCDS

2009-08-15 05:30:47

Technique (/100)
+ I like the use of Loops.
+ Nice job using alot of mathematical functions.

Individuality (/100)
+ You use alot of custom functions.

Follow all SRL rules (/100)
- Endless Loops.
- Only mines one rock.

Creativity (/100)
+ Again, the math is good.
+ Nice Responder.

Efficiency (/100)
- There's probably alot of thing's in RS that have "re" in the name..

if IsUpText('re') then
- Don't forget to free .bmp's and DTM's.

Presentation (/100)
+ I see comments.
+ Code is well organized.

Meeting all Requirements (/100)
+ Good job.

Added Extras (/100)
+ Again with the Responder.

Coh3n

2009-08-15 23:46:41

1. Technique (**/100)
  • Positives
    • Has a thorough knowledge of all types of loops + their internal commands.
    • Uses a custom type effectivly.
  • Negatives
    • There are a lot of global variables, including single letter variables.
    • Walking could be better, I don't like how much you rely on symbol finding, although what you've done with it isn't bad.
    • I recommend using an "else" statement when you are working with cases.
2. Individuality (**/100)
  • Positives
    • From all my time here I haven't seen a script written quite like this. It shows me you can effectively use logic.
    • I like the custom AntiBan. He doesn't do it too often and there are plenty of different AntiBan procedures.
  • Negatives
    • You don't use a custom form.
3. Follow all SRL rules (**/100)
  • Positives
    • Good job breaking/exiting out of loops/procedures when necessary.
  • Negatives
    • Every player has to mine the same rock.
    • There were a couple procedures missing the "if not LoggedIn then Exit;" failsafe.
4. Creativity (**/100)
  • Positives
    • Lots of creativity as I haven't seen a script quite like this one before.
  • Negatives
    • Your progress report makes me question your creativity.
5. Efficiency (**/100)
  • Positives
    • You use your skills in math to your advantage.
  • Negatives
    • You didn't free your Shopkeepers DTM.
6. Presentation (**/100)
  • Positives
    • Comments are written where needed.
    • Uses SRL PlayerForm. In my opinion, looks better than DeclarePlayers.
    • Standards are good, although some bold words are capitalized, some aren't, but that's not a big deal.
  • Negatives
    • Script header could be much better, but it's better than no header at all.
    • Commented description of the procedures/functions is always helpful.
7. Meeting all Requirements (**/100)
  • Positives
    • All requirements have been met as far as I can tell.
8. Added Extras (**/100)
  • Positives
    • SRL PlayerForm. Even though I already commented, it wasn't required.
    • Autoresponder. Although I feel it makes you loop more like a bot, it shows they can use types, and it wasn't required.
    • SMART.
  • Negatives
    • Could have use a with..do statement in SetupAutoRespond;

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

Torrent of Flame

2009-08-16 00:06:04

Technique: (**/100)
+ Good CharMoving procedure.
+ Good use of Records for the autoresponder.
- Lots of Global Variables, could easily be placed Locally.

Inidividuality: (**/100)
+ Functions are very well written, you know how to use the SRL include.
- I think you have the capability to write your own form, but you have used the SRL Player form, which I feel was a disappointment.
- Only one rock is avaliable to be mined, which is a disappointment too.

Follow all SRL Rules: (**/100)
- You dont free the DTM's or BMP's
- Bad use of Multi-player.

Creativity: (**/100)
– Only 1 Rock avaliable to mine!
- AntiBan not especially special.
+ Good CharMoving Procedure
++ Some procedures very well written.

Efficiency: (**/100)
- Can only mine one rock.
- Can lag due to no free DTM's etc.
- Can get stuck if your RadialWalk fails.

Presentation: (**/100)
- Could have made a nice intro.
- Ugly report.
+ Well Standardized.

Meeting all requirements: (**/100)
+ All requirements met.

Added extras: (**/100)
++ Good AutoResponder!

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

EvilChicken!

2009-08-16 02:16:42

The script gives a good first impression – the instructions and other starting
comments are minimalistic; clean and simple. The start of the script shows a declared type, a nice add to the script as it's both shows intermediate knowledge and contributes to keep this script clean. The type is used for a smart purpose.

From the looks of it, you have used many global global variables than needed.
Golbal variables are unpreferrable, as they do not get freed after exiting the procedure/function they were used in.

I'm displeased with the fact that using the SRL playerform isn't optional.
If I were you, I'd add a DeclarePlayers procedure, and let a constant decide which option to use.

Instead of "which rock to mine"-constant, you should rather have use a
Players[].Strings[] to give the script user the ability to customize preferred
rocks individually for each player. And, also add a comment next to the line,
showing what the various valid argumens could be, like:
Players[0].Strings[0] := ''; // Rock to mine. Valid arguments: 'tin', 'copper', 'iron'.

In PlayerReport, you do "for I := 0 to High(Players)". There is a global variable
in SRL called HowManyPlayers. You should've rather used that variable, and made it be "for I := 0 to HowManyPlayers - 1".

Your entire PlayerReport procedure seems to be very slow. Instead of doing something like "while (Length(S) <= 25) do S := S + ' ';", you should've simply used the SCAR function Replicate(c: Char; I: LongInt): string., or even better, use the Reports.scar include found in /misc.

In PorgressReport(), don't use begins/ends for one-line statements;
if (Boolean) then
begin
DoSomeThing;
end else
begin
DoSomethingElse;
end;
^^^ This is wrong.

if (Boolean) then
DoSomeThing;
else
DoSomethingElse;
This would be the correct way to do it.

And, don't use cases if you only have two statements. (.. or less :p)
case ReportType of
0: ReportType := 1;
1: ReportType := 0;
end;
Instead of that, you should've rather do something like this:
 
if (ReportType = 1) then
ReportType := 0
else
ReportType := 1;

The F11-feature for resetting your players is a nice extra, but RC.scar has been updated, so it's advisable that you rather use that include. :)

Instead of using GetArrayLength, try to use Length or more preferrablly; High.

In your AutoRespond procedure, consider using AddMistakes() from text.scar in /core.
Would be a neat addon, no?

In AntiBan, instead of
9, 10, 11, 12, 13, 14: PickUpMouse;
, do
  9..14: PickUpMouse;

You're missing a "if (not LoggedIn) then exit;" in CharMoving.
Besides, why didn't you use SRL's IsMoving in MapWalk.scar?

You should've placed SetUpAutoRespond somewhere at the top of the script so the player would be able to customize triggers and responses more easily.

Instead of a "Capitalize", you should've used a "Lowercase(Rock)".
Sure, it looks less fancy, but is a lot more "stable" to use.

Always use SRL constants when available.
SRL_Procs[0] should be SRL_Procs[srl_AntiBan].

You should also have a constant allowing the user pick between NextPlayer and RandomNextPlayer.

You have a lot of occurences of case with only two possible outcomes.
Mind what I said about those.

Instead of doing "if (Boolean = false) then ..", do "if (not Boolean) then..".

Technique (**/100)

The logical part is good, and your advanced use of math functions looks promising. It appears as if you have an intermediate to advanced of scripting, but you need to look through all of the SRL includes carefully, and see if any of them could replace some of your routines. And, I would advise more common random checks.

Individuality (/100)

Your use of math is definitely outstanding, your standards are fine, and your scripting style is great. But, as mentioned, you need to learn usage of the actual SRL include a little bit better.

Follow all SRL rules (/100)

A downside here is that your multiplayer cannot be set to preform sequentially. Furthermore, your usage of global variables is not good and there is a potential infinite loop in WalktoStore.

Creativity (/100)

The custom Type array with triggers and responses was well made, so was your usage of math. Otherwise nothing extraordinary.

Efficiency (/100)

A minus here for making all players mine the same rock, something which easily could have been made differently.

Presentation (/100)

Minimalistic instructions. I myself liked them, but they wouldn't be sufficient if this script was to be publicly published. The standards were good, with some issues regarding cases as mentioned. The progress report wasn't that well-made, you should rather have used the Reports.scar include in the /misc folder.

Meeting all Requirements (100/100)

All extra requirements are met.

Added Extras (/100)

Good autoresponder, although I've seen the exact same concept being used before many times.
You include SMART, but still you call SmartSetUpEx and you don't set the required variables to run smart, so it will load default settings. You should rather have added constants for world to load, whether to use a signed client, and whether to load a members world or not.
The usage of the SRL playerform is a nice addition, but you don't leave the user a choice NOT to use it, as mentioned before.
srl_Procs[SRL_AntiBan], nice. Shows you know how to use not-so-commonly-used SRL features.


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

ZephyrsFury

2009-08-16 13:24:28

From: EvilChicken!
For example, instead of using F11/12 to reset players, you could've used the contents of the RC.scar include.


RC.scar would have been completely outdated and not working when the competition was run.

EvilChicken!

2009-08-16 14:13:37

From: ZephyrsFury
RC.scar would have been completely outdated and not working when the competition was run.


Thanks, edited the post a bit.

Coh3n

2009-08-16 16:57:04

From: EvilChicken!
In PorgressReport(), don't use begins/ends for one-line statements;
if (Boolean) then
begin
DoSomeThing;
end else
begin
DoSomethingElse;
end;
^^^ This is wrong.

if (Boolean) then
DoSomeThing;
else
DoSomethingElse;
This would be the correct way to do it.


I wouldn't say the way he did it was wrong because it still works, it just can and should be written shorter. Also when you show him how to write it, there's no semicolon after the first action. ;) I'm assuming that was in there by accident, just thought I'd let you know. :p

And… Is there a procedure/function that checks for the pickaxe? Because everyone said he meets all the requirements, but I still fail to see where it is.

EDIT: Nevermind, I found it. Must have over-looked it. :duh:

Sir R. M8gic1an

2009-09-04 21:29:04

bump. starting on this.

~RM

Sir R. M8gic1an

2009-09-04 21:44:12

Technique (86/100)
[INDENT] + Using Custom Types
+ Good failsafes
+ Use of Trigonometry
+ Nice use of FindObjRock
+ Nice use of Bitmaps.scar
+ Personal CharMoving function
+ Good use of Loops and Failsafes
- Not enough use of Local variables rather than global
- Rock as a constant, rather than a Players[].Strings[]
- SetupPlayer only called once
- Use of cases when an if would've been better

case ReportType of
0: ReportType := 1;
1: ReportType := 0;
end;

//would be better off
if (ReportType = 1) then
ReportType := 0
else
ReportType := 1;

- Should've use SRL Constants rather than hard coded values

SRL_Procs[0]
// should be
SRL_Procs[srl_AntiBan]
+ However, it is good that you used SRL_Procs
- Finally in the antiban:

9, 10, 11, 12, 13, 14: PickUpMouse;
//better:
9..14: PickUpMouse;
[/INDENT]

Individuality(100/100)
[INDENT]+ Very unique use of math, trig
+ using Case on booleans, rather than if/else
+ use of RandomNextPlayer rather than NextPlayer
+ Custom Type
+ Different from usual Progress/Player Report
+ Wide use of SRL
+ Lots of custom functions, shows you know what you want and you know what you are doing
[/indent]
Following SRL Rules (65/100)
[indent]
- If not LoggedIn then exit missing in places
- Use of Rock constant rather than a player strings.
+ Multiplayer
+ No infinite loops
- You don't free BMP_Ore
- You don't free ShopKeepers DTM[/INDENT]

Creativity
(91/100)
[INDENT]Very creative, lots of innovative functions created, uncommon techniques used and nice AutoResponder type.[/INDENT]

Efficiency (68/100)
[INDENT] - Lots of Global variables which should've been local
- Bitmaps and DTMs not freed
- High(Players) instead of using SRL's HowManyPlayers. Would've been more efficient
- Could've used SCAR's string manipulation functions:

while (Length(S) <= 25) do S := S + ' ';"
//Replicate(c: Char; I: LongInt): string
s := s + Replicate(' ', 25-Length(s));

- bad use of begin / end

if (Boolean) then
begin
DoSomeThing;
end else
begin
DoSomethingElse;
end;

//could be

if (Boolean) then
DoSomeThing
else
DoSomethingElse;

- Again, i have to mention it in efficiency, you use cases when an if would've been better
- And finally "9..14" rather than "9, 10, 11, ….." in your case.[/INDENT]

Presentation (67/100)
[INDENT]+ Commented along the script
+ Use of SRLPlayerForm rather than DeclarePlayers
+ Good Standards
- Script Header is not really amazing
- Didn't comment on what each procedure and functions does at the top of it[/INDENT]

Meeting all Requirements
(100/100)
[INDENT] + Requirements were met.[/INDENT]

Added Extras
(96/100)
[INDENT] + AutoResponder
+ SRL Stats
+ SMART
+ SRL_Procs[/INDENT]


Total Score: (673 / 800) = 84.14%

Sir R. M8gic1an

2009-09-04 22:22:29

There, did i miss anything?

~RM

Coh3n

2009-09-05 01:28:20

From: Rasta Magician
There, did i miss anything?

~RM


What about "Follows all SRL rules"? Other than that it looks sexy. <3

EDIT: Nevermind, it's just not large and bolded. :p

Sir R. M8gic1an

2009-09-05 16:02:18

From: Coh3n
What about "Follows all SRL rules"? Other than that it looks sexy. <3

EDIT: Nevermind, it's just not large and bolded. :p


Fixed :)

~RM