SRL Archive - Archive

JM Scripting Competition #1 Results!


Sir R. M8gic1an

2009-09-05 19:56:22

The Results have Arrived!
Competition: Rimmington Miner n Seller


Welcome All! :D
First of all, i would like to appologize to those who expected to get the results earlier. Everything takes it's time and i must say this was a rather hard competition to judge; Every script excells in it's own direction, and the winner wasn't clear to me until i got down to adding up the marks. I suspect the judges weren't too sure until the last moment either.

I will post all the scripts and the thoughts of all those who judged them along with mine, some points may sound a bit mean, however all is meant with the intention to teach. I must say i was surprised by the quality of each script, and actually found myself being harsher than I intented to at first because they exceeded my expectations. And for that, i take my hat off to you all ;)

Content:
[INDENT]1. Intro
2. The Thank You List
3. What You were Marked On[/INDENT]

Scripts:
[INDENT]4.1 Heysus
4.2 KitchenRange
4.3 Mormonman
4.4 Shady?
4.5 Tickky[/INDENT]

The Winner and a Conclusion
[INDENT]5. The Winner
6. Conclusion[/INDENT]



Introduction


And so, Junior Members take their first step towards becoming known as elite scripters in this community… And what a great step it was!

Rimmington is not a nice place. Very big mine, no banks nearby, annoying when other people take your rock, how fast do you respond? How do you find your rocks? How do you walk around in the mine? These were the things I was looking for in the script.

The point of this competition was to pick out from the Junior Members those who have talent, but had not put it to use publicly. Many people start a script and never finish it, so they don't show it and their talent goes unshow and unknown, and this competition would actually force these people to finish a script. :)

I hope many people will learn from these great examples, and that in the future more people will get involved in this competition. Scripting is a lot of fun, and seeing how well you did in comparision to others can teach you a lot. Use these scripts as a learning source.

Congratulations to All,

~RM

Sir R. M8gic1an

2009-09-05 20:01:36

The Thank You List


First of all I would like to thank Wizzup? for allowing me to start this competition when I was just an SRL Member (oh yes, it's been long:p)

Then I'd like to thank Dr. D Dervish for coming up with this idea when he was just a Junior Member.

Thirdly I'd like to thank Nauman and paz for helping me judge this competition at it's early stages.

Forthly I'd like to send one huge Thank You to Zeph, as he helped me organize and run all the behind-the-scenes concerning the competition Judges, Judging and forums.

Finally, another huge thank you (they've heard it quite a few times) to all the judges who did such a great job!

  • Zytex
  • Marpis
  • Coh3n
  • EC
  • TOF
  • NCDS
  • Baked0420
  • Harry

So, Thank You All :)

Sir R. M8gic1an

2009-09-05 20:14:55

What You Were Marked On


All the scripts were marked using the same criteria, and they were marked at the level that would be expected from someone with a Scripter's Cup. Below is a short summary of how you were marked.

1. Technique (/100)

This relates to what type of loops you have used where, how you decided to load all of those variables, if you used types correctly etc.

2. Individuality (/100)

This refers to whether your scripting style is your own or not. The more individual your script is, the better it is for you, because this means you really understand what all of the different procedures / functions / types / methods should be used for. it means you are relying less on other people, and are developing your own style.

3. Follow all SRL rules (/100)
This reffers to breaking out of infinite loops, breaking out of loops/procedures if your character is not logged in, the script being multiplayer, etc.

4. Creativity (/100)

How creative was the script, how different was it to everyone else's, was it what I was expecting the mass to do, or did yours stand out of the crowd?

5. Efficiency (/100)

This is the thing I am most strict about. The more efficient the script is, the better it is. Why constantly write out procedures when you can use a simple repeat instead? Are you using "end else" when needed? Do you have duplicate functions? Are you freeing DTMs / bitmaps after finishing with them? The more efficient your script is, the better it will run, and the easier errors will be to fix when they arise.

6. Presentation (/100)

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!)

7. Meeting all Requirements (/100)
Does your Script sell in Rimmington? Does it have Multiplayer? Does it mine tin, copper, iron and gold? Is it able to run with the pickaxe in the inventory or equipped? Does it have antirandoms, antiban and a progress report? If so you just earnt yourself 100 points free of charge.


8. Added Extras (/100)

What extra features did you include in your script? The more that are in there, the better it is. Be careful though, because including extra features which don't work / aren't efficient could get you marked down in other categories!

Sir R. M8gic1an

2009-09-05 20:22:08

4.1 Heysus


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-05 20:33:12

4.2 KitchenRange


Technique (44/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 (44/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 (54/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
(22/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 (24/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 (24/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 (54/100)
[INDENT]+ Banking, however the walking should have a few more failsafes.
+ Smart[/INDENT]

Total Score: (366 / 800) = 45.75%

Sir R. M8gic1an

2009-09-05 20:40:20

4.3 Mormonman


Technique (66/100)
[INDENT] + Limited use of Global variables
+ DDTM Walking
+ Random Left or Right clicking on the rock to start mining - good antiban.
- Need more failsafes for walking using symbols. Failsafes are backups for when things go wrong (such as when the symbol is covered or when the DDTM failed, etc).
- FindShopKeeper fails to use it's own parameter's.
- DDTM's could have all been declared shorter and more simple.

Statements like this:

if not (Result) then
begin
Exit;
end;
Can be better written like this:

if no (Result) then
Exit;
There is no need for a begin..end nest if you are only doing one action.
[/INDENT]

Individuality (68/100)
[INDENT]
+ Uses SRL extra's such as Path.scar and NewAutoColor.scar. Good job.
- You didn't create your own autocolor functions, you just relied on ACA to do it for you.
[/INDENT]

Follows all SRL rules (60/100)
[INDENT]
+ Frees all dtms.
+ Has LoggedIn checks in all functions.
- Multiplayer does not work - you do not call NextPlayer at all in your main loop.
- Possible infinite loops:

repeat
if FindShopKeeper(x,y) then
begin
Mouse(x, y, 1, 1, False);
Wait(300+random(100));
ChooseOption('rade');
Wait(3000);
if FindDTM(OreDTM,x,y,mix1,miy1,mix2,mix2) then
begin
Mouse(x,y,3,3,false);
Wait(300+random(100));
ChooseOption('ell 50');
end;
if FindDTM(ClayDTM,x,y,mix1,miy1,mix2,mix2) then
begin
Mouse(x,y,3,3,false);
Wait(300+random(100));
ChooseOption('ell 50');
end;
Mouse(485,42,7,7,true);
end;
until not FindDTM(OreDTM,x,y,mix1,miy1,mix2,mix2);
If for example FindShopKeeper broke, the script would keep looping until the OreDTM disappeared which of course won't happen if you're not able to sell it.

Also,

repeat
WalkPath(0);
FFlag(0);
until (FindPath(1, True));


If FindPath() fails the character will keep trying to click on path 0 ad infinitum.
- Missing some begins and ends after if then statements. Eg:

if MakeCompass('N') then
begin
if FindSymbol(x, y, 'portal') then
Mouse(x, y, 3, 3, True);
FFlag(0);
LoadS2M;
WalkPath(2);
if DTMRotated(DTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
Flag;
Wait(1000+random(500));
end;
Writeln(' Walk To Mine. - Complete.');
Result := True;

Notice how after if FindSymbol(x, y, 'portal') then you don't have a begin. This means only the Mouse() will depend on FindSymbol(). The rest will be executed regardless if whether the portal symbol was found or not.

[/INDENT]

Creativity
(68/100)
[INDENT] - Nothing really creative. The progress report is just plain and over 400 lines of your script are DDTMs.
[/INDENT]

Efficiency (64/100)
[INDENT] + Used one DTM to find all ores rather than 4 or 5 separate DTMs.
- Lots of long waits which slow your script down.
- Many functions could be combined/shortened.
- DDTM declarations take up a great deal of your scripts. You could perhaps shorten it down a bit but not by much.
- Script isn't finished.[/INDENT]

Presentation (21/100)
[INDENT]
+ Standards are acceptable however it gets messy in places - mostly incorrect nesting which makes it harder for you to see where you need Begins and Ends. Overall your standards could be improved a great deal.
+ Some commenting.
- No script intro/header/description.
- Very basic progress report.
- Repetitive coding - you tend to copy and paste functions or parts of functions when it isn't required.

Eg.

Case lowercase(Ore) of
'iron' : begin
RockDTM := LoadRockWalk('iron');
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
'copper' : begin
if FindSymbol(x, y, 'mining spot') then
Mouse(x, y, 1, 1, true);
FFlag(0);
RockDTM := LoadRockWalk('copper');
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
'tin' : begin
if FindSymbol(x, y, 'mining spot') then
Mouse(x, y, 1, 1, true);
FFlag(5);
RockDTM := LoadRockWalk('tin');
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
'gold' : begin
RockDTM := LoadRockWalk('gold');
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
'clay' : begin
if FindSymbol(x, y, 'mining spot') then
Mouse(x, y, 1, 1, true);
FFlag(0);
RockDTM := LoadRockWalk('clay');
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
end;

Is there a reason why you can't replace all that with this:

begin
if FindSymbol(x, y, 'mining spot') then
Mouse(x, y, 1, 1, true);
FFlag(0);
RockDTM := LoadRockWalk(Lowercase(ore)); //NOTE HERE
if DTMRotated(RockDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
FFlag(0);
Result := True;
Writeln('RockWalk Done');
end else
begin
Result := False;
Writeln('RockWalk failed');
end;
end;
[/INDENT]

Meeting all Requirements (0/100)
[INDENT] - Pretty much ok except your multiplayer features are non-existant. Therefore I'd say no you haven't met the requirements.[/INDENT]

Added Extras (26/100)
[INDENT]+ Able to mine Clay also. But nothing else apart from that.
[/INDENT]

Total Score: (373 / 800) = 46.63%

Sir R. M8gic1an

2009-09-05 20:43:57

4.4 Shady


Technique (90/100)
[INDENT]- MANY global variables, I am sure there is some way to shorten that list.
+ Good use of type records and With..Do statements.
+ Autocoloring
+ Failsafes
- No failsafes in walking
- Could've used TPAs instead of FindObjCustom…[/INDENT]

Individuality (97/100)
[INDENT]+ Used a lot of custom functions.
+ Nice custom AntiBan function, although you anti ban too much.
+ Shows good understanding of the SRL include and it's functions.[/INDENT]

Follow all SRL Rules
(90/100)
[INDENT]+ Free's DTMs and BMPs.
+ Uses timers to break out of some loops.
- Some loops would require a few more failsafes: eg SellOres, to be sure Shop Window is open
- SellOres could become infinite if no ShopScreen
+ Good use of FindNormalRandoms[/INDENT]

Creativity
(74/100)
[INDENT]+ Randomization of Right/Left click
+ Custom walking functions and Types
- Could be a bit more creative with Rock Finding
+ Locating Method is extremly creative
+ Good method of storing information.
+ Interesting method of handling fights.
- Could have made an function that checks what pickaxe is being used so that the user doesn't have to enter it himself.[/INDENT]

Efficiency (74/100)
[INDENT]+ DTMs Freed.
+ Low waiting time between each step/function, makes the script faster.
+ Alot of minor tweaks here and there
- A lot of functions could be shortened
- Could have made a better use of cases[/INDENT]

Presentation (100/100)
[INDENT]+ A nice heading! I immediately understand what the script does and it's features.
+ Very detailed progress report!
+ Introduction!
+ Standards!
- More Comments throughout the script would've been nice.
- No Function / procedure headers.[/INDENT]

Meeting all requirements (100/100)
[INDENT]+ Yes.[/INDENT]

Added extras (98/100)
[INDENT]+ Option for dropping the ores / Powermining.
+ Banking
+ Clay Mining[/INDENT]


Total Score: (713 / 800) = 89.13%

Sir R. M8gic1an

2009-09-05 20:56:41

4.5 Tickky


Technique (59/100)
[INDENT]- lack of walking failsafes
- infinite loops
+ Autocolor, (ACA)
+ Not many global vars.
+ Good use of constants.[/INDENT]

Individuality
(65/100)
[INDENT]+ Custom Functions
+ Nice way of loading DTMs
- ACA
[/INDENT]
Follow all SRL Rules (64/100)
[INDENT]- Although you have a DTM freeing procedure, you don't free them.
- lack of if not loggedin then exit;
- infinite loops
- SellShit: improper name
[/INDENT]
Creativity (85/100)
[INDENT]+ RemainingOres function
- Little imagination used on walking, you can find more ways of figuring out where you are.
+ Random right/left click with click the rocks, although you should right click much less.
[/INDENT]
Efficiency (73/100)
[INDENT]- Doesn't free DTMs
- Calls FindObjRock too many times
- Too many long waits.
+ Having the option to load only one DTM at a time is very efficient
+ Great use of cases and functions.
- May want to use some "else" statements when working with cases.[/INDENT]

Presentation (85/100)
[INDENT] + Nice header.
+ Nice progress report.
+ Awesome signature!
+ Good Standards
+ Nice Separation of functions
- Not many comments throughout the script
- No function / procedure header
- No Player Report[/INDENT]

Meeting all Requirements (100/100)
[INDENT] + All Reqs met
- Doesn't check if PickAxe is in Inv or Equipped, or if doesn't have one at all.[/INDENT]

Added Extras
(94/100)
[INDENT] + Banking
+ Clay Mining[/INDENT]


Total Score: (625 / 800) = 78.13%

Sir R. M8gic1an

2009-09-06 10:33:46

And now… The Winner is: Shady?
Congratulations!


Gratz to Shady? for winning this competition! His script was truely amazing and unexpected from a Junior Member. Unfortunately now it is obsolete as RS and SRL have changed a lot since he made it, however it is still a great learning tool!

The Scores:

  1. Shady? (713/800) = 89.13%
  2. Heysus (673/800) = 84.14%
  3. Tickyy (625/800) = 78.13%
  4. Mormonman (373/800) = 46.63%
  5. KitchenRange (366/800) = 45.75%

Last Words


Congratulations to all who entered. I'm happy to say this competition was a success, for those who entered. Most of you used your scripting competition script to get SRL Members, when that was one of the prizes. Better even, your applications were a true success! Remember these scripts were judged at Scripting Cup level, and therefore the scores might seem a bit harsh, however, for a JM to get a scripting cup it is truely incredible. To this, i must add that Shady did get one after a few more touches to his script. The comments might sound a bit mean or too direct, but they are there for you to learn, not for you to beat yourself for forgetting something.

My words of advice? Always search through the includes and practice makes perfect.

To all Junior Members out there, I seriously advise you to join the next one ;) Scripting is a lot of fun.

We now cast our hopeful glances towards Shady? who's shown a lot of hidden talent.
Are you hiding it too?


Lots o' Love
~RM

ZephyrsFury

2009-09-06 10:40:53

Congratz to all the members who participated. Well done all who took part in the organizing, running and judging. Thank you, above all, to Rasta Magician who has spent countless hours on this… great job! :D

Simtoon

2009-09-06 10:45:50

I was going to enter but meh :)

noidea

2009-09-06 10:48:48

nice job to the participants!
Congrats SHady ;)
Jeez, it took since you were an SRL member Rasta :p