SRL Archive - Judges' Spot

JM Comp #1 - Script #3 - Zeph: Done :P


Sir R. M8gic1an

2009-08-12 14:52:43

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


program RimmingtonMiner;
{.Include SRL\SRL.SCAR}
{.include srl/srl/misc/NewAutocolor.scar}
{.include srl/srl/misc/path.scar}
{.include srl/srl/skill/mining.scar}

{RM I didn't finish... I give up! Here is what I had.}
const

Debug = False;

{ // SRL-Stats \\ }
YourSRLID = ''; // SRL-Stats ID
YourSRLPassword = ''; // SRL-Stats PW
{ \\ SRL-Stats // }

var
OreDTM, ClayDTM, x, y, RockColor, BrownColor, WaitWhileMine, ores : Integer;
Time, Loads : LongInt;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 letters of the username
Players[0].Strings[0] := ''; //Type of Ore to Mine (Valid types: iron, gold, copper, clay, tin)
Players[0].Active := True; // Use this Character?

SetAutoColorReference('Grey Rock', 4872025);
RockColor := srl_AutoGetColor('Grey Rock');
SetAutoColorReference('Brown Rock', 3428502);
BrownColor := srl_AutoGetColor('Brown Rock');
end;

procedure LoadOreDTM;
begin
OreDTM := DTMFromString('78DA6364606560D8CBC8800C3C741419FE036' +
'99028986601AAD988AA06220B2381F45F160686D304D47C00AAD94F4' +
'00D1FD0AEED04D47002D51CC5AF060011C30943');

ClayDTM := DTMFromString('78DA63FCCFC2C070809101194C6F0803D3305' +
'146065606861DA86A60B27035FF80E61C25A0E61BA65D186AB88076E' +
'DC1AF0600D505084D');
end;

function FindPickInvEquip : boolean;
begin
if not (LoggedIn) then Exit;
Result := True;
Result := False;
end;


procedure Antiban;
begin
if not (LoggedIn) then Exit;
case Random(30) of

0: begin
RandomRClick;
MMouse(0,0,15,15);
end;

25: begin
GameTab(2);
HoverSkill('Mining', false);
wait(2000+random(1000));
GameTab(4);
end;

4: PickupMouse;

7: begin
MakeCompass('N');
wait(10+random(5));
MakeCompass('S');
wait(10+random(5));
MakeCompass('N');
end;

8: begin
GameTab(1 + Random(12));
wait(1000+random(1000));
GameTab(4);
end;

9..12: FindPick;

13: MouseBox(MSX1,MSY1,MSX2,MSY2,3);

18: AntiBan;

20: SleepAndMoveMouse(2000+random(2000));
end;
end;

procedure AntiRandoms;
begin
if not (LoggedIn) then Exit;
FindNormalRandoms;
if (FindFight) then
RunAway('S',true,1,5000+random(1000));
end;



function RoadAC: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(8.34, 0.07);

FindColorsSpiralTolerance(MMCX, MMCY, arP, 7237222, MMX1, MMY1, MMX2, MMY2, 6);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 9.99) and (X <= 17.87) and (Y >= 10.11) and (Y <= 18.13) and (Z >= 10.66) and (Z <= 19.09) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

function B2MWalkDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 1249;
dtmMainPoint.y := 345;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 6652035;
dtmMainPoint.Tolerance := 15;

dtmSubPoints[0].x := 1249;
dtmSubPoints[0].y := 345;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 6652035;
dtmSubPoints[0].Tolerance := 15;

dtmSubPoints[1].x := 1244;
dtmSubPoints[1].y := 339;
dtmSubPoints[1].AreaSize := 3;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 16183024;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1261;
dtmSubPoints[2].y := 342;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 6652035;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 1256;
dtmSubPoints[3].y := 310;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 6652035;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 1246;
dtmSubPoints[4].y := 354;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 6652035;
dtmSubPoints[4].Tolerance := 15;

dtmSubPoints[5].x := 1249;
dtmSubPoints[5].y := 297;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 6652035;
dtmSubPoints[5].Tolerance := 15;

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

function S2MEntranceDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..6] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 1285;
dtmMainPoint.y := 285;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1137799;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1285;
dtmSubPoints[0].y := 285;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1137799;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1275;
dtmSubPoints[1].y := 289;
dtmSubPoints[1].AreaSize := 3;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 15263986;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1289;
dtmSubPoints[2].y := 295;
dtmSubPoints[2].AreaSize := 3;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 15263986;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 1283;
dtmSubPoints[3].y := 260;
dtmSubPoints[3].AreaSize := 3;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 6051431;
dtmSubPoints[3].Tolerance := 30;

dtmSubPoints[4].x := 1308;
dtmSubPoints[4].y := 277;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 6051431;
dtmSubPoints[4].Tolerance := 30;

dtmSubPoints[5].x := 1254;
dtmSubPoints[5].y := 269;
dtmSubPoints[5].AreaSize := 3;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 15263986;
dtmSubPoints[5].Tolerance := 30;

dtmSubPoints[6].x := 1310;
dtmSubPoints[6].y := 302;
dtmSubPoints[6].AreaSize := 3;
dtmSubPoints[6].AreaShape := 0;
dtmSubPoints[6].Color := 15263986;
dtmSubPoints[6].Tolerance := 30;

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


procedure LoadS2M;
begin
SetupPath;
RoadColor := RoadAC;
Path[1].Mainpoint.x:=685;
Path[1].Mainpoint.y:=67;
Path[1].Subpoints[0].x:=649;
Path[1].Subpoints[0].y:=126;
Path[1].Subpoints[1].x:=564;
Path[1].Subpoints[1].y:=74;
Path[1].Subpoints[2].x:=658;
Path[1].Subpoints[2].y:=69;
Path[1].Subpoints[3].x:=666;
Path[1].Subpoints[3].y:=66;
Path[1].Subpoints[4].x:=680;
Path[1].Subpoints[4].y:=69;
Path[1].Subpoints[5].x:=657;
Path[1].Subpoints[5].y:=37;
Path[2].Mainpoint.x:=671;
Path[2].Mainpoint.y:=70;
Path[2].Subpoints[0].x:=676;
Path[2].Subpoints[0].y:=62;
Path[2].Subpoints[1].x:=619;
Path[2].Subpoints[1].y:=32;
Path[2].Subpoints[2].x:=619;
Path[2].Subpoints[2].y:=83;
Path[2].Subpoints[3].x:=621;
Path[2].Subpoints[3].y:=111;
Path[2].Subpoints[4].x:=638;
Path[2].Subpoints[4].y:=85;
end;

procedure LoadM2S;
begin
RoadColor := RoadAC;
Path[0].Mainpoint.x:=583;
Path[0].Mainpoint.y:=105;
Path[0].Subpoints[0].x:=620;
Path[0].Subpoints[0].y:=90;
Path[0].Subpoints[1].x:=612;
Path[0].Subpoints[1].y:=100;
Path[0].Subpoints[2].x:=601;
Path[0].Subpoints[2].y:=106;
Path[0].Subpoints[3].x:=589;
Path[0].Subpoints[3].y:=105;
Path[0].Subpoints[4].x:=569;
Path[0].Subpoints[4].y:=102;
Path[0].Subpoints[5].x:=565;
Path[0].Subpoints[5].y:=77;
Path[1].Mainpoint.x:=621;
Path[1].Mainpoint.y:=110;
Path[1].Subpoints[0].x:=629;
Path[1].Subpoints[0].y:=34;
Path[1].Subpoints[1].x:=630;
Path[1].Subpoints[1].y:=49;
Path[1].Subpoints[2].x:=624;
Path[1].Subpoints[2].y:=73;
Path[1].Subpoints[3].x:=639;
Path[1].Subpoints[3].y:=94;
Path[1].Subpoints[4].x:=674;
Path[1].Subpoints[4].y:=83;
Path[1].Subpoints[5].x:=622;
Path[1].Subpoints[5].y:=117;
end;


function LoadRockWalk(Rock: String): Integer;
var
dtmMainPoint: TdtmPointDef;
dtmSubPoints: array[0..4] of TdtmPointDef;
TempTdtm: Tdtm;
begin
case lowercase(Rock) of
'iron' : begin
dtmMainPoint.x := 1253;
dtmMainPoint.y := 274;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 869733;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1253;
dtmSubPoints[0].y := 274;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 869733;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1257;
dtmSubPoints[1].y := 266;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RockColor;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1254;
dtmSubPoints[2].y := 280;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RockColor;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 1268;
dtmSubPoints[3].y := 285;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RockColor;
dtmSubPoints[3].Tolerance := 30;

dtmSubPoints[4].x := 1233;
dtmSubPoints[4].y := 275;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 15263465;
dtmSubPoints[4].Tolerance := 30;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
'copper' : begin
dtmMainPoint.x := 1268;
dtmMainPoint.y := 285;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 735324;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1268;
dtmSubPoints[0].y := 285;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 735324;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1251;
dtmSubPoints[1].y := 297;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := BrownColor;
dtmSubPoints[1].Tolerance := 20;

dtmSubPoints[2].x := 1278;
dtmSubPoints[2].y := 283;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := BrownColor;
dtmSubPoints[2].Tolerance := 20;

dtmSubPoints[3].x := 1272;
dtmSubPoints[3].y := 296;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := BrownColor;
dtmSubPoints[3].Tolerance := 20;

dtmSubPoints[4].x := 1274;
dtmSubPoints[4].y := 269;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 15001846;
dtmSubPoints[4].Tolerance := 30;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
'tin' : begin
dtmMainPoint.x := 1317;
dtmMainPoint.y := 330;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 735324;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1317;
dtmSubPoints[0].y := 330;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 735324;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1310;
dtmSubPoints[1].y := 328;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RockColor;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1319;
dtmSubPoints[2].y := 334;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RockColor;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 1322;
dtmSubPoints[3].y := 314;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := BrownColor;
dtmSubPoints[3].Tolerance := 20;

dtmSubPoints[4].x := 1296;
dtmSubPoints[4].y := 316;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := BrownColor;
dtmSubPoints[4].Tolerance := 20;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
'gold' : begin
dtmMainPoint.x := 1291;
dtmMainPoint.y := 305;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 734551;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1291;
dtmSubPoints[0].y := 305;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 734551;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1287;
dtmSubPoints[1].y := 301;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RockColor;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1295;
dtmSubPoints[2].y := 306;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RockColor;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 1276;
dtmSubPoints[3].y := 320;
dtmSubPoints[3].AreaSize := 3;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 15066346;
dtmSubPoints[3].Tolerance := 15;

dtmSubPoints[4].x := 1293;
dtmSubPoints[4].y := 329;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 15066346;
dtmSubPoints[4].Tolerance := 30;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
'clay' : begin
dtmMainPoint.x := 1314;
dtmMainPoint.y := 314;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 255;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 1314;
dtmSubPoints[0].y := 314;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 255;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 1310;
dtmSubPoints[1].y := 328;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RockColor;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 1322;
dtmSubPoints[2].y := 314;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := BrownColor;
dtmSubPoints[2].Tolerance := 20;

dtmSubPoints[3].x := 1296;
dtmSubPoints[3].y := 316;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := BrownColor;
dtmSubPoints[3].Tolerance := 20;

dtmSubPoints[4].x := 1315;
dtmSubPoints[4].y := 284;
dtmSubPoints[4].AreaSize := 3;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 15001846;
dtmSubPoints[4].Tolerance := 30;

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

function StoreToMine : boolean;
var
x, y, DTM : Integer;
begin
if not (LoggedIn) then Exit;
DTM := S2MEntranceDTM;
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;
end else
begin
Result := False;
Writeln(' Walk To Mine. - Failed.');
FreeDTM(DTM);
if not (Result) then
begin
Exit;
end;
end;
end;

function WalkToRock(Ore : String) : Boolean;
var
x, y, RockDTM : integer;
begin
if not (LoggedIn) then Exit;
if MakeCompass('N') then
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;
FreeDTM(RockDTM);
end;

procedure WaitWhileMining;
begin
if not (LoggedIn) then Exit;
MarkTime(Time);
begin
repeat
Antiban;
Wait(500+random(100));
AntiRandoms
Wait(500+random(100));
FindPickInvEquip;
Wait(500+random(300));
until (FindBlackChatMessage('anage') or (TimeFromMark(Time) >= WaitWhileMine));
end;
end;

procedure morm_RockColor; //loads colors from mining.scar
var
kind: string;
begin
LoadRockRecords;
begin
kind := (Players[CurrentPlayer].strings[0]);
case LowerCase(kind) of
'tin': begin
ores := rimmington_Tin;
WaitWhileMine := 14000;
end;
'gold': begin
ores := rimmington_Gold;
WaitWhileMine := 20000;
end;
'clay': begin
ores := rimmington_Clay;
WaitWhileMine := 12000;
end;
'iron':
begin
ores := rimmington_Iron;
WaitWhileMine := 8000;
end;
'copper': begin
ores := rimmington_Copper;
WaitWhileMine := 14000;
end;

end;
end;
end;

function FindClickRock : boolean;
begin
if not (LoggedIn) then Exit;
SetAngle(True);
if FindObjRock(x, y, ores) then
begin
case random(4) of
0,3: begin
Mouse(x, y, 3, 3, True);
end;
1: begin
Mouse(x, y, 3, 3, False);
Wait(600+random(200));
ChooseOption('ine');
end;
2: begin
Mouse(x, y, 3, 3, True);
end;
end;
Result := True;
end else
begin
Result := False;
end;
end;

procedure MineRock;
begin
if not (loggedin) then exit;
if FindClickRock then
WaitWhileMining;
end;



function MineToStore : Boolean;
var
FirsDTM : Integer;
begin
if not (LoggedIn) then Exit;
FirsDTM := S2MEntranceDTM;
if MakeCompass('N') then
if FindSymbol(x, y, 'mining spot') then
begin
Mouse(x, y, 1, 1, true);
FFlag(5);
if DTMRotated(FirsDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
begin
Mouse(x, y, 1, 1, true);
Flag;
Wait(1000+random(500));
end else
begin
Result := False;
Writeln('Storewalk failed');
end;
LoadM2S;
repeat
WalkPath(0);
FFlag(0);
until (FindPath(1, True));
if FindSymbol(x,y,'shop') then
begin
Mouse(x + 18, y - 15, 1, 1, true);
FFlag(0);
Wait(1000+random(500));
Writeln(' Walk To Store. - Complete.');
Result := True;
end else
begin
Result := False;
Writeln('Storewalk failed');
end;
end else
begin
Result := False;
Writeln(' Walk To Store. - Failed.');
FreeDTM(FirsDTM);
if not (Result) then
begin
Exit;
end;
end;
end;

function FindShopKeeper(var cx, cy: Integer) : boolean ; //my own custom function
var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.06);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2504761, MSX1, MSY1, MSX2, MSY2, 9);
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(['ssistant', 'hop'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end;
end;
end;

procedure SellOres;
begin
LoadOreDTM;
Writeln('Finding Shopkeeper');
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);
Loads := Loads+1;
end;

procedure SetupPlayer;
begin
if not (LoggedIn) then
LoginPlayer;
repeat
Wait(50);
until LoggedIn;
morm_RockColor;
SetRun(true);
FindPick;
end;

procedure ProgressReport;
var
Load : longint;
begin
if not debug then
ClearDebug;
Load := Loads;
Writeln('Rimmington Miner By: ****);
Writeln('Time Running ' +TimeRunning);
Writeln('Loads Sold ' +inttostr(Load));
Writeln('I know I did not do good...');
SendSRLReport;
end;

procedure MainLoop;
begin
DeclarePlayers;
ScriptID := '1144';
SRLID := YourSRLID;
SRLPassword := YourSRLPassword;
ActivateClient;
Wait(500);
SetupPlayer;
repeat
if StoreToMine then
WalkToRock(Players[CurrentPlayer].Strings[0]);
Writeln('Mining...');
repeat
MineRock;
InvCount;
until (InvFull)
Writeln('Selling...');
if MineToStore then
SellOres;
ProgressReport;
until AllPlayersInactive;
end;

begin
SetupSRL;
SetupNewAutoColor;
SetupMining;
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 22:02:10

Technique: (**/100)
+ TPA finding.
+ DDTMs.
- Could have added more failsafes.

Inidividuality: (**/100)
+ Does know some SRL functions.

Follow all SRL Rules: (**/100)
- Doesn't break out from possible infinite loops.
+ Good use of "if not LoggedIn then Exit;".
+ Free's DTMs.

Creativity: (**/100)
- Nothing very special.

Efficiency: (**/100)
- Half of the script is DDTMs.
- Many global vars (most of them is required but at least 3 of them could be taken away).
- Not finished, hard to tell if the script would actually work.
- Some long waits in there, which could be taken away or made faster.

Presentation: (**/100)
- No heading.
- Basic progress report.
+ Some comments.
+ Some standards.

Meeting all requirements: (**/100)
+ Yes and No, the function FindPickInvEquip; isn't working, but I am sure that the script would work (when finished + every other functions working) with the pick in either inv or equipped.

Added extras: (**/100)
- Nothing extra added…

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

NCDS

2009-08-14 22:39:51

Technique: (/100)
-DDTM's could have all been declared shorter and more simple.
-FindShopKeeper fails to use it's own parameter's.
-Alot of symbol walking with really no failsafe's.

Individuality: (/100)
-Im quite positive that function RoadAC is from ACA.

Follow SRL Rules: (/100)
-Main loop is endless as I don't see anywhere that he set's current player to false.

Creativity: (/100)

Efficiency: (/100)
-No real FailSafe's
-Unnecessary long waits.
-Many functions could be shortened alot.

Presentation: (/100)
-Standards are pretty messy in spots.
-Repetitive code.

Meet all requirements: (/100)
-No, it would not compile at this point.

AddedExtras: (/100)

Coh3n

2009-08-16 00:47:51

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.

Result := False;
You do not need to do this at all because if a condition is not met, the Boolean is automatically set to false.

1. Technique (**/100)
  • Positives
    • Not too many global variables.
  • Negatives
    • No walking failsafes, this is essential if you want your script to run for more than a couple loads at a time.
    • Not really any advanced code.
    • For copper/tin/clay you use FindSymbol for walking and no failsafes.
    • DTMs/DDTMs could easily have been loaded in an array.
    • Your DDTMs don't use AntoColoring, which would make then static and just like a DTM.
2. Individuality (**/100)
  • Positives
    • I like how it will randomly left or right click the rocks, although it could have been done much better.
  • Negatives
    • You didn't create your own autocolor functions, you just relied on ACA to do it for you.
3. Follow all SRL rules (**/100)
  • Positives
    • Frees DTMs.
  • Negatives
    • Missing a lot of begin..end nests that without, you script isn't going to work like you want it to.
    • Didn't use many loops to begin with, but when you did, they could potentially be endless.
4. Creativity (**/100)
  • Positives
    • Again, the randomly right/left clicking when mining the ore.
  • Negatives
    • Over 400 lines of your script is DDTMs.
    • No creativity in the progress report.
5. Efficiency (**/100)
  • Positives
    • I like how you used only one DTM for the ores, instead of 4 different DTMs for each ore.
    • Good use of "if not LoggedIn then Exit;" failsafe.
  • Negatives
    • Didn't see any failsafes for the walking procedures.
    • Many, many functions could be shortened.
6. Presentation (**/100)
  • Negatives
    • No header.
    • Standards could be a lot better.
7. Meeting all Requirements (**/100)
  • There is no point in the script where you switch to the next player, so I would say that the multiplayer doesn't work.
8. Added Extras (**/100)
  • Positives
    • The ability to mine clay.

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

marpis

2009-08-16 17:37:29

1. Technique (/100)
+ DDTM walking
- Not enough failsafes

2. Individuality (/100)
+ Using Path.scar

3. Follow all SRL rules (/100)
+ I did not notice mentionable infinite loops
- Multiplayer doesn't work

4. Creativity (/100)
- ACA2

5. Efficiency (/100)
- Many things could be shortened

6. Presentation (/100)
- Standards and nestings are not very good

7. Meeting all Requirements (/100)
+ Mines all ores, shops
- It's not multiplayer
- No pickaxe thingys

8. Added Extras (/100)
+ Clay

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

ZephyrsFury

2009-09-05 20:00:17

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) = 47%