Code:
program RuneCrafter;
{.include srl/srl.scar}
var
WalkDTM, X, Y : Integer;
function FindRoadColor2 : Integer; forward;
function SetDTM(DDTMNumber: Integer): Integer;
var
DTMMainPoint: TDTMPointDef;
DTMSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
Road : Integer;
begin
Road := FindFallyRoadColor;
case DDTMNumber of
0: begin
DTMMainPoint.x := 789;
DTMMainPoint.y := 312;
DTMMainPoint.AreaSize := 0;
DTMMainPoint.AreaShape := 0;
DTMMainPoint.Color := Road;
DTMMainPoint.Tolerance := 0;
DTMSubPoints[0].x := 789;
DTMSubPoints[0].y := 312;
DTMSubPoints[0].AreaSize := 0;
DTMSubPoints[0].AreaShape := 0;
DTMSubPoints[0].Color := Road;
DTMSubPoints[0].Tolerance := 0;
DTMSubPoints[1].x := 789;
DTMSubPoints[1].y := 316;
DTMSubPoints[1].AreaSize := 0;
DTMSubPoints[1].AreaShape := 0;
DTMSubPoints[1].Color := Road;
DTMSubPoints[1].Tolerance := 0;
DTMSubPoints[2].x := 782;
DTMSubPoints[2].y := 314;
DTMSubPoints[2].AreaSize := 0;
DTMSubPoints[2].AreaShape := 0;
DTMSubPoints[2].Color := Road;
DTMSubPoints[2].Tolerance := 0;
DTMSubPoints[3].x := 783;
DTMSubPoints[3].y := 310;
DTMSubPoints[3].AreaSize := 0;
DTMSubPoints[3].AreaShape := 0;
DTMSubPoints[3].Color := Road;
DTMSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := DTMMainPoint;
TempTDTM.SubPoints := DTMSubPoints;
Result := AddDTM(TempTDTM);
end;
1: begin
DTMMainPoint.x := 743;
DTMMainPoint.y := 287;
DTMMainPoint.AreaSize := 0;
DTMMainPoint.AreaShape := 0;
DTMMainPoint.Color := FindRoadColor2;
DTMMainPoint.Tolerance := 0;
DTMSubPoints[0].x := 743;
DTMSubPoints[0].y := 287;
DTMSubPoints[0].AreaSize := 0;
DTMSubPoints[0].AreaShape := 0;
DTMSubPoints[0].Color := FindRoadColor2;
DTMSubPoints[0].Tolerance := 0;
DTMSubPoints[1].x := 749;
DTMSubPoints[1].y := 286;
DTMSubPoints[1].AreaSize := 0;
DTMSubPoints[1].AreaShape := 0;
DTMSubPoints[1].Color := FindRoadColor2;
DTMSubPoints[1].Tolerance := 0;
DTMSubPoints[2].x := 750;
DTMSubPoints[2].y := 292;
DTMSubPoints[2].AreaSize := 0;
DTMSubPoints[2].AreaShape := 0;
DTMSubPoints[2].Color := FindRoadColor2;
DTMSubPoints[2].Tolerance := 0;
DTMSubPoints[3].x := 745;
DTMSubPoints[3].y := 295;
DTMSubPoints[3].AreaSize := 0;
DTMSubPoints[3].AreaShape := 0;
DTMSubPoints[3].Color := FindRoadColor2;
DTMSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := DTMMainPoint;
TempTDTM.SubPoints := DTMSubPoints;
Result := AddDTM(TempTDTM);
end;
2: begin
dtmMainPoint.x := 687;
dtmMainPoint.y := 287;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 2396017;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 687;
dtmSubPoints[0].y := 287;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 2396017;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 699;
dtmSubPoints[1].y := 277;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 2396017;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 705;
dtmSubPoints[2].y := 283;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2396008;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 699;
dtmSubPoints[3].y := 298;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2462305;
dtmSubPoints[3].Tolerance := 0;
dtmSubPoints[4].x := 679;
dtmSubPoints[4].y := 281;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 2396017;
dtmSubPoints[4].Tolerance := 0;
dtmSubPoints[5].x := 688;
dtmSubPoints[5].y := 276;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 2396017;
dtmSubPoints[5].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;
function AutoColorcrafter: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.20, 0.35);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 5787989, MSX1, MSY1, MSX2, MSY2, 2);
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
ColorToRGB(arC[i], R, G, B);
if (R >= 81) and (R <= 89) and (G >= 77) and (G <= 85) and (B >= 84) and (B <= 92) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 7.82) and (X <= 9.10) and (Y >= 7.88) and (Y <= 9.19) and (Z >= 9.68) and (Z <= 11.21) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function AutoColorAlter: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 1.19);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 9075558, MSX1, MSY1, MSX2, MSY2, 3);
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
ColorToRGB(arC[i], R, G, B);
if (R >= 99) and (R <= 107) and (G >= 116) and (G <= 130) and (B >= 127) and (B <= 150) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 15.49) and (X <= 18.89) and (Y >= 16.97) and (Y <= 20.77) and (Z >= 22.86) and (Z <= 31.46) then
begin
Result := arC[i];
Writeln('AlterColor = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor alter failed in finding the color.');
end;
function FindRoadColor2: Integer;
var
GC, a, l, TestColor, Red, Green, Blue : Integer;
var
P:array of Tpoint;
begin
GC := 6776943;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 60);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,60) then
begin
ColorToRGB(TestColor,Red,Green,Blue);
if InRange((Red - Green),5,10) then
if InRange((Red - Blue),4,10) then
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then
begin
Result := TestColor;
RoadColor := TestColor;
Writeln('RoadColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
Writeln('Could not find Road Color!');
Result := 0;
end;
function AutoColorGrass: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.22, 0.36);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 2063967, MMX1, MMY1, MMX2, MMY2, 4);
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
ColorToRGB(arC[i], R, G, B);
if (R >= 86) and (R <= 109) and (G >= 110) and (G <= 141) and (B >= 26) and (B <= 37) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 9.79) and (X <= 15.30) and (Y >= 13.45) and (Y <= 21.73) and (Z >= 3.10) and (Z <= 5.08) then
begin
Result := arC[i];
Writeln('Grass color = ' + IntToStr(arC[i]));
Break;
end;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding grass color.');
end;
procedure banking;
var
essdtm : integer;
begin
essDTM := DTMFromString('78DA638C67606038CC8002A24282190481342' +
'310FF0702C65C20631F031A60442281740690B840404D30903846' +
'404D0890D84B404D3E90384A404D2490388F5F0D00D1990D2E');
if not openbankquiet('feb') then
if not openbankfast('feb') then
if not openbankglass('feb' ,true, true) then
writeln('couldnt open bank');
repeat
wait(10);
//findnormalrandoms;
until (bankscreen) or ( pinscreen);
if pinscreen then
inpin(players[currentplayer].pin);
wait(100 + random(20));
if finddtm(essdtm, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
mouse(x, y, 5, 5, false);
wait(10 + random (20));
chooseoption('All');
end else
writeln('No ess found');
end;
function WalkToAlterStep1: Boolean;
var
x, y : Integer;
begin
Disguise('Walking 1');
MakeCompass('N');
WalkDTM := SetDTM(0);
Result := RadialWalk(FindWaterColor, 180, 270 , 100 , 1, -1);
if Result then
begin
FFlag(5);
Writeln(' Main Walking 1. - Complete.');
end else
Result := DTMRotated(WalkDTM, x, y, MMX1, MMY1, MMX2, MMY2);
if Result then
begin
Mouse(x, y, 8, 8, True);
Writeln(' Backup Walking 1. - Complete.');
FFlag(5);
end else
begin
Result := False;
Writeln(' Failed. Logging Out. Next Player');
if Result then
TerminateScript;
end;
end;
function WalkToAlterStep2: Boolean;
var
x, y : Integer;
begin
Disguise('Walking 2');
MakeCompass('N');
WalkDTM := SetDTM(0);
Result := RadialWalk(FindFallyRoadColor, 170, 200 , 100 , 1, -1);
if Result then
begin
FFlag(5);
Writeln(' Main Walking 2. - Complete.');
end else
Result := DTMRotated(WalkDTM, x, y, MMX1, MMY1, MMX2, MMY2);
if Result then
begin
Mouse(x, y, 8, 8, True);
Writeln(' Backup Walking 2. - Complete.');
FFlag(5);
end else
begin
Result := False;
Writeln(' Failed. Logging Out. Next Player');
if not Result then
TerminateScript;
end;
end;
function WalkToAlterStep3: Boolean;
begin
Disguise('Walking 3');
MakeCompass('N');
if RadialWalk(FindRoadColor2, 270, 180 , 100 , 1, -1) then
begin
Flag;
Writeln(' Main Walking 3. - Complete.');
Result := True;
end else
begin
WalkDTM := SetDTM(1);
if DTMRotated(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X, Y, 8, 8, True);
Writeln(' Backup Walking 3. - Complete.');
FFlag(0);
Result := True;
end else
begin
Result := False;
Writeln(' Failed. Logging Out. Next Player');
if not Result then
TerminateScript;
end;
end;
end;
function WalkToAlterStep4: Boolean;
begin
Disguise('Walking 4');
MakeCompass('N');
if RadialWalk(AutoColorGrass, 234, 252, 100 , 1, -1) then
begin
Flag;
Writeln(' Main Walking 4. - Complete.');
Result := True;
end else
begin
WalkDTM := SetDTM(2);
if DTMRotated(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X, Y, 8, 8, True);
Writeln(' Backup Walking 4. - Complete.');
FFlag(0);
Result := True;
end else
begin
Result := False;
Writeln(' Failed. Logging Out. Next Player.');
if not Result then
TerminateScript;
end;
end;
end;
procedure WalkToAlter;
begin
{WalkToAlterStep1;
WalkToAlterStep2;
WalkToAlterStep3;
}
WalkToAlterStep4;
end;
procedure GetInAlter;
var
AlterDTM : Integer;
begin
AlterDTM := DTMFromString('78DA637462626078CA80027A9A9A180481342' +
'310FF0702460FA09AEB0C6880118904D29E4035AF5055182828A0' +
'AAB106AAF944408D2550CD4302763900D5DCC6AF0600C7200D74');
SetAngle(True);
gametab(tab_Inv);
if DTMRotated(AlterDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 3, 3, True)
else
Writeln('No tally found getting one out of bank');// Finish
if FindColorSpiralTolerance(x, y, AutoColorAlter, MSX1, MSY1, MSX2, MSY2, 5) then
MMouse(x, y, 8, 8);
if IsUpText('ruin') then
Mouse(x, y, 0, 0, True);
end;
procedure InAlter;
var
x, y, H, cts, i: integer;
TreeUptext: string;
MainPoints, BasePoints, TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not LoggedIn then exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.2, 0.2);
FindColorsTolerance(MainPoints, 5919576, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsTolerance(BasePoints, 5791583, MSX1, MSY1, MSX2, MSY2, 5);
TPA := CombineTPA(MainPoints, BasePoints);
if (Length(TPA) > 0) then
writeln('couldnt find alter');
begin
ATPA := SplitTPAEx(TPA, 9, 9);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
H := High(ATPA) - 1;
for I := 0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(100 + Random(200));
if IsUpText('Craft') then
Mouse(x, y, 0, 0, True);
exit; // it clicks twice for some reason
end;
end;
end;
procedure OutAlter;
var
x, y, H, cts, i: integer;
TreeUptext: string;
MainPoints, BasePoints, TPA: TPointArray;
ATPA: T2DPointArray;
begin
if not LoggedIn then exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.2, 0.2);
FindColorsTolerance(MainPoints, 7445926, MSX1, MSY1, MSX2, MSY2, 5);
FindColorsTolerance(BasePoints, 9355204, MSX1, MSY1, MSX2, MSY2, 5);
TPA := CombineTPA(MainPoints, BasePoints);
if (Length(TPA) > 0) then
writeln('couldnt find portal');
begin
ATPA := SplitTPAEx(TPA, 9, 9);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
H := High(ATPA) - 1;
for I := 0 to H do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(100 + Random(200));
if IsUpText('Use') then
Mouse(x, y, 0, 0, True);
exit; // it clicks twice for some reason
end;
end;
end;
begin
SetupSRL;
ActivateClient;
banking;
WalkToAlter;
wait(1000 + random (100));
GetInAlter;
InAlter;
outAlter;
end.
i know im missing some essentilals declareplayers , antiban, antirandom but im jsut getting the harder part done before i do the stuff i can get from my other scripts