SRL Archive - JM Competition Judging

Rezozo


Daniel

2012-11-05 23:42:31

  • User: Rezozo
  • Date Received: 6-11-2012 (EDT)
  • Competition: Junior

Script below, as is (385 lines, total):

program DraynorSkiller;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$DEFINE PAINT}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}

Var
FishSpot, DBBank, Runs, Count, XPWCNow, XPFMNow, XPWC, XPFM, Loads, C, R, Logs, World:integer;
Scripttype:String;

Procedure DeclarePlayers; //Please fill out this and nothing else!
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
C :=6;// Columb (Only for Banking)
R :=1;// Row (Only for Banking)
Scripttype :='CNB'; //Type of script? CNB=ChopNBurn, CB=ChopNBank, BB=BurnNBank
World :=16; //Pick a world, any world :D (Make sure you meet the reqs to enter, i.e, Mem/F2p, wildy, skill level etc)
Loads :=10; //How many loads do you wish to do?
end;

{
Some Basic Rules/Warnings:

1) If using the BurnNBank, make sure the door for the building NEXT to the bank, is closed. (Usually Is)
2) This script makes sure the Public Chat is off, and on the Game Tab. This is the most effective way of simulating an annoyed human.
3) In the world choice above, try to keep somewhere less populated.
4) It is preffered to have at least 45 WC and a Rune Hatchet in the Inv or equipped. This is so you aren't eaten alive by the others.
5) Make sure you have bank space and you have the appropriate levels for the WoodCutting/FireMaking/

HAVE FUN!!
}

{
/~~~\/~~\/~~~\/~~~\/~~\/~~~\ /~~~\/~~\/~~~\/~~~\/~~\/~~~\
| /\/ /\/ /\ || /\/ /\/ /\ | | /\ \/\ \/\ || /\ \/\ \/\ |
\ \/ /\/ /\/ /\ \/ /\/ /\/ /Make sure you do not\ \/\ \/\ \/ /\ \/\ \/\ \/ /
\ \/\ \/\ \/ \ \/\ \/\ \/ Change anything \/ /\/ /\/ / \/ /\/ /\/ /
,_/\ \/\ \/\ \__/\ \/\ \/\ \______________________/ /\/ /\/ /\__/ /\/ /\/ /\_,
(__/\__/\__/\____/\__/\__/\________________________/\__/\__/\____/\__/\__/\__)

(~\/~~\/~~\/~~~~\/~~\/~~\/~~~~~~~~~~~~~~~~~~~~~~~~~~\/~~\/~~\/~~~~\/~~\/~~\/~)
'\ \/\ \/\ \/~~\ \/\ \/\ \/~~~~~~~~~~~~~~~~~~~~~~~~\/ /\/ /\/ /~~\/ /\/ /\/ /'
/\ \/\ \/\ \ /\ \/\ \/\ \ Have Fun / /\/ /\/ /\ / /\/ /\/ /\
/ /\/ /\/ /\ \/ /\/ /\/ /\ \ And stay in school! / /\ \/\ \/\ \/ /\ \/\ \/\ \
| \/ /\/ /\/ || \/ /\/ /\/ | | \/\ \/\ \/ || \/\ \/\ \/ |
\___/\__/\___/\___/\__/\___/ \___/\__/\___/\___/\__/\___/}

procedure Antiban; //Thanks to NKN. He is amazing, and didn't know half of these :P
begin

FindNormalRandoms;
case Random(90) of
0: RandomRClick;
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
5: ExamineInv;
6: MakeCompass('N');
7: SetAngle(SRL_ANGLE_HIGH);
8: Wait(5000+random(2000));
9: HoverSkill(skill_woodcutting,false);
end;

End;

Procedure MakeProggy;
Begin
Writeln('/////////////////////////Rez''s DraynorSkiller!//////////////////////////');
Writeln('//Time Running: '+ TimeRunning+' //');
Writeln('//Number of Logs chopped: '+IntToStr(Count)+' //');
Writeln('//Number of Logs burnt: '+IntToStr(Count)+' //');
Writeln('//Number of Loads done: '+IntToStr(Runs)+' //');
Writeln('//Experience Gained in WC: '+IntToStr(XPWC)+' //');
Writeln('//Experience Gained in FM: '+IntToStr(XPFM)+' //');
End;


procedure SetupLogin;
begin
ClearDebug;
SetupSRL;
DeclarePlayers;
if not LoggedIn then
begin
repeat
LoginPlayerToLob;
until LobbyScreen;

OpenWorldScreen;
if not WorldScreen then
OpenWorldScreen;
if WorldScreen then
begin
writeln('picking world!');
SelectWorld(World);
LogInPlayer;
end;
end;

while not LoggedIn do
wait(500);

ExitSquealOfFortune();
SetChat('off', CHAT_PUBLIC);
Mouse(90 + (CHAT_GAME * 55), 496, 8, 3, mouse_left); //click game tab
end;


Function isChopping: Boolean; //Average PixelShift from Flights TuT (THANKS FLIGHT!!)
var
PBox: TBox;
begin
PBox := IntToBox(250, 175, 280, 220);
Result := (AveragePixelShift(PBox, 300, 450) > 400);
end;

Procedure BankD;
Var
x, y:Integer;
Begin

Logs := DTMFromString('m1gAAAHic42JgYMhlYmAoA+JqKA3iZwBxPBCnQvkgtjUjA4MBEFsBsRMQuwKxOxBbArEREBsCsQsQmxsIAk1lIoj5gSQxmJFIjAAAHLkH3w==');

if (findSymbol(x, y, 'bank')) then
Mouse(x-1, y-2, 1, 1, true)

Else
Begin
Mouse(590, 130, 7, 7, true);
Wait(1000);

if (findSymbol(x, y, 'bank')) then
Mouse(x, y, 1, 1, true);
End;

Wait(10000);
RestUntil(50);
SetRun(true);
OpenBankFast('db');
Wait(1000+random(250));

if ExistsItemDTM(Logs, x, y) then
Begin
MMouse(x, y, 3, 3);
Mouse(x,y,3,2, false);
ChooseOption('All');
End;
Writeln('Banking!');

if (findSymbol(x, y, 'fish')) then
Begin
Mouse(x, y, 1, 1, true);
Wait(10000);
End
Else
Begin
MouseBox(660, 100, 665, 115, 1);
Wait(6000);
if (findSymbol(x, y, 'fish')) then
Mouse(x, y, 1, 1, true);
End;
RestUntil(50);
SetRun(true);

End;

Procedure BankT;
Var
x, y:Integer;
Begin
if (findSymbol(x, y, 'bank')) then
Mouse(x, y-5, 1, 1, true);

Wait(6000+Random(100));
OpenBankFast('db');
Withdraw(C-1, R-1, 28);
Wait(1000+random(250));
Writeln('Banking!')
End;



Procedure Chop;
var
x, y: integer;
begin

if FindObj(x, y, 'illow', 3359297, 20) or FindObj(x, y, 'illow', 1384220, 20) then
Begin
Mouse(x,y,1,1, false);
ChooseOption('hop');
SetRun(true);
AntiBan;

Repeat
until not(ischopping);

End;
End;

Procedure Burn;
var
x, y: integer;
begin

Logs := DTMFromString('m1gAAAHic42JgYMhlYmAoA+JqKA3iZwBxPBCnQvkgtjUjA4MBEFsBsRMQuwKxOxBbArEREBsCsQsQmxsIAk1lIoj5gSQxmJFIjAAAHLkH3w==');

if ExistsItemDTM(Logs, x, y) then
MMouse(x, y, 3, 3);

Mouse(x,y,3,2, false);
ChooseOption('ight');
AntiBan;
Wait(5000);

if ExistsItemDTM(Logs, x, y) then
Mouse(x, y, 3, 3, true);

wait(3000);
MouseBox(279, 430, 320, 450, mouse_left);
AntiBan;
Writeln('Let the burning begin!')
repeat
Until not(ExistsItemDTM(Logs, x, y));
End;

Procedure ChopNBurn;
Begin
if LoggedIn then
begin

ClickNorth(SRL_ANGLE_LOW);
Keydown(VK_LEFT);
Wait(randomrange(1000, 1020));
Keyup(VK_LEFT);
Writeln('Setting angle!');
end;
Repeat

XPWC:=GetXP(20) - XPWCNow;
XPFM:=GetXP(19) - XPFMNow;

Chop;
If invfull then
Begin
Writeln('Inventory Full!');
Runs:=runs+1;
Burn;
Count:=Count+28;
End;
MakeProggy;
Until(Runs=Loads);
End;

Procedure ChopNBank;
Var
x, y:Integer;

Begin
ClickNorth(SRL_ANGLE_LOW);
Keydown(VK_LEFT);
Wait(randomrange(1000, 1020));
Keyup(VK_LEFT);
SetRun(true);



if (findSymbol(x, y, 'fish')) then
Begin
Mouse(x, y, 1, 1, true);
Wait(10000);
End
Else
Begin
MouseBox(660, 100, 665, 115, 1);
wait(6000);
if (findSymbol(x, y, 'fish')) then
Mouse(x, y, 1, 1, true);
End;

Repeat
XPWC:=GetXP(20) - XPWCNow;
Chop;

RestUntil(50);
SetRun(true);

If invfull then
Begin

Writeln('Inventory Full!');
Runs:=Runs+1;
BankD;

ClickNorth(SRL_ANGLE_LOW);
Keydown(VK_LEFT);
Wait(randomrange(1000, 1020));
Keyup(VK_LEFT);
Count:=Count+28;
if (findSymbol(x, y, 'fish')) then
Begin
Mouse(x, y, 1, 1, true);
Wait(10000);
End
Else
Begin
MouseBox(660, 100, 665, 115, 1);
wait(6000);
if (findSymbol(x, y, 'fish')) then
Mouse(x, y, 1, 1, true);
End;

End;

RestUntil(50);
SetRun(true);
AntiBan;
MakeProggy;
Until(Runs=Loads);

End;

Procedure BurnNBank;
Begin

if LoggedIn then
begin

ClickNorth(SRL_ANGLE_HIGH);
Keydown(VK_LEFT);
Wait(randomrange(1000, 1020));
Keyup(VK_LEFT);
Keydown(VK_LEFT);
Wait(randomrange(1000, 1020));
Keyup(VK_LEFT);
Writeln('Setting angle!');

end;

Repeat
XPFM:=GetXP(19) - XPFMNow;
BankT;
MouseBox(615, 120, 630, 150, 1);
Writeln('Walking to spot!');
Wait(3000);
Burn;
Runs:=runs+1;
Count:=Count+28;
MakeProggy;
Until(Runs=Loads);
End;




Procedure DoIt;
Begin

Logs := DTMFromString('m1gAAAHic42JgYMhlYmAoA+JqKA3iZwBxPBCnQvkgtjUjA4MBEFsBsRMQuwKxOxBbArEREBsCsQsQmxsIAk1lIoj5gSQxmJFIjAAAHLkH3w==');
XPWCNow:=GetXP(20);
XPFMNow:=GetXP(19);
Case ScriptType of
'CNB': ChopNBurn;
'CB': ChopNBank;
'BB': BurnNBank;
End;
End;



BEGIN
SetupLogin;
ActivateClient;
LoginPlayer;
DoIt;
FreeDTM(Logs);
END.

NKN

2012-11-06 16:39:53

1. Technique (60/100)
Begin/Ends used incorrectly, i.e
  if (findSymbol(x, y, 'bank')) then
Mouse(x, y-5, 1, 1, true);

Wait(6000+Random(100));
OpenBankFast('db');
Withdraw(C-1, R-1, 28);
Wait(1000+random(250));
Writeln('Banking!')
End;
If the symbol is there, click it. What if it's not, you're still going to try and bank. No failsafe for it.

Walking is all Symbol walking, which can be broken simply by having loads of dots over them, or half of them cut off.

Random loops, i.e.
Repeat
until not(ischopping);
Should have -something- in there, even if it's a wait

Static wait times, not very randomized.
Relies on waits too much, doesn't check for the actual condition change.
Example:
Begin
Mouse(590, 130, 7, 7, true);
Wait(1000);

if (findSymbol(x, y, 'bank')) then
Mouse(x, y, 1, 1, true);
End;

Wait(10000);
RestUntil(50);
SetRun(true);
OpenBankFast('db');
Wait(1000+random(250));
Waits 10 seconds exactly, and then opens bank. Doesn't check if near bank or anything, just does it.

Using FindObj as the only way to find mainscreen objects.

A plus is he used DTMs for inventory items, but added the free DTMS at the end of the script, when some of the DTMS he called globally aren't in use at all times.

2. Individuality (70/100)

Used some borrowed methods.

Used basic object finding methods onscreen, didn't develop own.



3. Follow all SRL rules (65/100)
Loops had no failsafes, could go on forever.

No multiplayer support

Random loops with nothing in them? See above

Low amount of failsafes.

4. Creativity (85/100)

Kind of basic.
Gave script 3 options, so you got a higher score for that. B+ :)

5. Efficiency (60/100)

You use two or three procedures or functions you could just use one for.

Such as when you MMouse, then Mouse to click on it. You're moving it to two different spots, just use mouse.

There are pretty much no walking failsafes. If it fails walking to the bank, you have it click a static point, and look again.

Lots of random loops that just sit there.

Static waits.

6. Presentation (70/100)

Standards are off. You capitalize some begin/ends, and lowercase others.

Your progress report looks pretty basic.

You didn't comment on your procedures!!!!!

7. Meeting all Requirements (75/100)
You didn't add multiplayer support! That's a big one in my eyes, as it's a tad more difficult, showing you're a more competent scripter.


8. Added Extras (90/100)

Added three options for the script.
Used basic methods for them.

Average Score: 71.875%

Nebula

2012-11-07 20:07:15

Technique (60/100)
-2 unused global variables
-Setup information that should be constants not variables.
-Script runs indefinitely, there is no TerminateScript called.
-infinite loops e.g.
            repeat
Until not(ExistsItemDTM(Logs, x, y));

Individuality (65/100)
Not much to say here.
-isChopping from flight (not original)

Follow all SRL rules (60/100)
-infinite loops, no breaking out of them at all. (as already stated)
-The below is the only method of terminating. which fails if the script is still logged in from doing actions that it shouldn't be doing due to not stopping.
  while not LoggedIn do
wait(500);

Creativity (55/100)
There was no "thinking out side of the box". Very simple, nothing that stood out to me.

Efficiency (75/100)
-dtms loaded at the beginning then freed at the end of the script, not loaded-unloaded when needed.
-decent condensation of procedures into 3 chunks (chop/burn/bank combos)

Presentation (75/100)
-clean proggy+25
-clear setup+25
-not so good standards. enable parser (view->extentions), parse it then compare.. +10
-procedure commentary not given. but also not needed, names were straightforward.+15

Meeting all Requirements (75/100)
-Walking script +10 (only symbols, not very reliable)
-Two skills* +20 (wc+fm)
-Banking +20
-Multiplayer +5 (had a small portion of multiplayer (Players[0].Name :=) etc) but did not use correctly.
-Free to Play only +20


Added Extras (75/100)
-ischopping from flight
-3 different chop/burn/bank cominations
-runs for a specific amount of loads

Avg (67.5/100)

Ashaman88

2012-11-21 16:06:35

1. Technique (70/100)

-Fishspot and DBBank variables never used (not a huge deal)
-Some of your setup variables would be better as constants (like loads), for method its good to keep it as a variable so you can change it if something goes wrong (like if it screws up banking too many times, have it switch to the drop method instead)
-Potential infinite loops (unlikely but still)
repeat
LoginPlayerToLob;
until LobbyScreen;

while not LoggedIn do
wait(500);

Repeat
until not(ischopping);

This is next one is the worst one because if you messed up with lighting the log you wont ever break out of it.
repeat
Until not(ExistsItemDTM(Logs, x, y));
-Nice job using different types of loops

2. Individuality (65/100)

-You do rely heavily on prebuilt functions
-Using an option for 3 different methods is nice

3. Follow all SRL Rules (64/100)
-See #1 for discussion about infinite loops
-You don't have a check for loggedin very often, can also cause more infinite loops

4. Creativity (64/100)
-You don't use a ton of creative methods, but it usually gets the job done
-You did put in 3 different methods, nice!


5. Efficiency (63/100)
-Instead of dealing with the changing world functions, why not just use the worldinfo in the player array? It will automatically select that world with just loginplayer instead of having to do all of this:
repeat
LoginPlayerToLob;
until LobbyScreen;

OpenWorldScreen;
if not WorldScreen then
OpenWorldScreen;
if WorldScreen then
begin
writeln('picking world!');
SelectWorld(World);
LogInPlayer;
end;

-What happens if the bank symbol is blocked or it fails to find the bank symbol the second time? Should have more failsafes for this
-You never check for bankscreen or pinscreen
-What happens if openbank fails? It will still try to deposit the fish
-Same issue with withdrawing, no checks for pin or bankscreen
-Instead of a static wait to click make a fire, have it detect the colors for it.
-Nice job using the include for functions
-In case anything goes wrong, you should have the freedtm as an addonterminate function


6. Presentation (85/100)
-Nicely presented instructions
-Nice progress report
-Standards are pretty far off, read up on this

7. Requirements (90/100)
-No multiplayer which would be nice for a script like this
-2 skills, banking, walking (would like to see more advanced methods), f2p

8. Added extras (85/100)
-I liked how you had it setup for 3 different options and how the user can determine how many loads to do

Average 73/100

BraK

2012-11-30 06:29:37

Final Score: [70.7/100]