PHP Code:
program WillowChopperAndBanker;
{.include SRL/SRL.Scar}
Var
Loads : Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers:=1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;
Players[0].Name :='User';
Players[0].Pass :='Pass';
Players[0].Nick :='Nick';
Players[0].Active := True;
end;
Function WillowMM: 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.98, 4.84);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 473404, MMX1, MMY1, MMX2, MMY2, 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 >= 56) and (R <= 65) and (G >= 53) and (G <= 62) and (B >= 3) and (B <= 12) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 3.10) and (X <= 3.69) and (Y >= 3.66) and (Y <= 4.31) and (Z >= 0.65) and (Z <= 0.98) then
begin
Result := 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 BankColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
R, G, B: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(47.92, 2.38);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 5395022, MMX1, MMY1, MMX2, MMY2, 1);
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 >= 76) and (R <= 87) and (G >= 75) and (G <= 82) and (B >= 76) and (B <= 82) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 7.07) and (X <= 8.03) and (Y >= 7.42) and (Y <= 8.14) and (Z >= 8.16) and (Z <= 8.95) then
begin
Result := 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 Banker: 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.49, 0.90);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 13294737, MSX1, MSY1, MSX2, MSY2, 26);
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 >= 151) and (R <= 254) and (G >= 114) and (G <= 242) and (B >= 83) and (B <= 253) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 20.66) and (X <= 89.55) and (Y >= 19.56) and (Y <= 90.84) and (Z >= 11.05) and (Z <= 104.90) then
begin
Result := 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 Log: 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.19, 1.83);
FindColorsSpiralTolerance(MICX, MICY, arP, 1325377, MIX1, MIY1, MIX2, MIY2, 1);
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 >= 60) and (R <= 70) and (G >= 53) and (G <= 62) and (B >= 18) and (B <= 22) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 3.34) and (X <= 4.28) and (Y >= 3.66) and (Y <= 4.68) and (Z >= 1.13) and (Z <= 1.40) then
begin
Result := 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 WillowColor: 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, 0.76);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 4288349, MSX1, MSY1, MSX2, MSY2, 18);
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 >= 46) and (R <= 138) and (G >= 59) and (G <= 162) and (B >= 25) and (B <= 107) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.95) and (X <= 25.68) and (Y >= 3.89) and (Y <= 31.87) and (Z >= 1.56) and (Z <= 18.45) 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;
Procedure AntiBan;
begin
if(not(LoggedIn))then
Exit;
case Random(11) of
0: begin
HoverSkill('Woodcutting', false);
Wait(2500 + Random(500));
ClickMouse(658,185,true);
end;
1: begin
HoverSkill('Mining',false);
Wait(2500 + Random(500));
ClickMouse(658,185,true);
end;
2: PickUpMouse;
5: begin
case random(6) of
0: TypeSend('Whats up?');
1: TypeSend('wc lvls?');
2: TypeSend('Woodcutting levels?');
3: TypeSend('sup?');
4: TypeSend('This is so booring!');
5: TypeSend('Booring!');
end;
end;
6: begin
MakeCompass('N');
Wait(10+random(5));
MakeCompass('S');
Wait(10+random(5));
MakeCompass('N');
Wait(1000);
end;
8: SleepAndMoveMouse(6000+random(4000));
end;
end;
Procedure Proggy;
begin
ClearDebug;
Writeln('|||||||||||||||||||||||||||||||||||||||||||');
Writeln('WillowChopper By: Leevi');
Writeln('|||||||||||||||||||||||||||||||||||||||||||');
Writeln('Loads Done: '+ IntToStr(Loads));
Writeln('|||||||||||||||||||||||||||||||||||||||||||');
Writeln('Time Running: '+ TimeRunning);
Writeln('|||||||||||||||||||||||||||||||||||||||||||');
end;
Procedure WalkToTrees;
begin
If Not LoggedIn Then Exit;
If InvFull Then Exit;
RadialWalk(WillowMM, 195, 240, 55, 2, 2);
Wait(2000 + Random(1000));
AntiBan;
Exit;
end;
Procedure ChopTree;
Var
TPA : TPointArray;
ATPA : T2DPointArray;
I, H, X, Y : Integer;
Begin
If Not LoggedIn Then Exit;
If InvFull Then Exit;
Proggy;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.76);
FindColorsSpriralTolerance(MSCX, MSCY, TPA, WillowColor, MSX1, MSY1, MSX2, MSY2);
ATPA := TPAToATPA(TPA, 30);
If Length(ATPA) = 0 Then
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y);
MMouse(X, Y, 0, 0);
Wait(10 + Random(90));
If IsUpText('Willow')Then
Begin
Mouse(X, Y, 0, 0, False);
ChooseOption('hop');
Proggy;
Wait(10000 + Random(3000));
AntiBan;
Proggy;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
AntiBan;
Proggy;
Exit;
End;
End;
End;
Procedure ToBank;
Var
TPA : TPointArray;
ATPA : T2DPointArray;
I, H, X, Y : Integer;
Begin
If Not LoggedIn Then Exit;
If Not InvFull Then ChopTree;
Loads := Loads +1;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(47.92, 2.38);
FindColorsSpiralTolerance(MMCX, MMCY, TPA, BankColor, MMX1, MMY1, MMX2, MMY2,5);
ATPA : TPAToATPA(TPA, 2);
If Length(ATPA) = 0 Then
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y);
Mouse(X, Y, 0, 0, True);
Proggy;
Wait(15000 + Random(5000));
Proggy;
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.2, 0.2);
AntiBan;
Exit;
End;
End;
Procedure InBank;
Var
TPA,TPA2 : TPointArray;
ATPA,ATPA2 : T2DPointArray;
I, H, A, B, X, Y : Integer;
Begin
If Not LoggedIn Then Exit;
If Not InvFull Then WalkToTrees;
Proggy;
ColorSpeedTolerance(2);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Banker, MSX1, MSY1, MSX2, MSY2,5);
ATPA := TPAToATPA(TPA, 5);
If Length(ATPA) = 0 Then
Exit;
H := High(ATPA);
For I := 0 To H Do
Begin
MiddleTPAEx(ATPA[I], X, Y);
MMouse(X, Y, 0, 0);
Wait(50 + Random(50));
If IsUpText('Banker')Then
Begin
Mouse(X, Y, 0, 0, False);
ChooseOption('ank');
Wait(2000 + Random(500));
Proggy;
Begin
ColorSpeedTolerance(2);
SetColorSpeed2Modifiers(0.19, 1.83);
FindColorsTolerance(MICX, MICY, TPA2, Log, MIX1, MIY1, MIX2, MIY2);
ATPA2 := TPAToATPA(TPA2, 10);
If Length(ATPA2) = 0 Then
Exit;
A := High(ATPA2);
For B := 0 To H Do
Begin
MiddleTPAEx(ATPA2[B], X, Y);
MMouse(X, Y, 0, 0);
Wait(50 + Random(50));
If IsUpText('logs')Then
Begin
Mouse(X, Y, 0, 0, False);
ChooseOption('All');
Wait(1000 + Random(100));
ClickMouse(489, 34, True);
Wait(1000 + Random(100));
ColorSpeedTolerance(1);
AntiBan;
Proggy;
Exit;
End;
End;
End;
End;
End;
End;
Begin
SetupSRL;
ActivateClient;
DeclarePlayers;
AntiBan;
Proggy;
If Not LoggedIn Then LoginPlayer;
Repeat
WalkToTrees;
ChopTree;
ToBank;
InBank;
Proggy;
Until(False);
End.