SCAR Code:
{ [ Draynor Tree Chopper ]
[---------------------------------------------]
[ Writer: Skilld U ]
[ Category: Woodcutting ]
[ Version: 1.1 ]
[---------------------------------------------]
Chops all different types of trees in draynor according
to woodcut level :p }
Program DraynorWoodCutter;
{.include SRL/SRL.scar}
{.include srl/srl/misc/path.scar}
{.include srl/srl/misc/Users.scar}
{.include srl/srl/skill/woodcutting.scar}
var
TheLevel : integer;
WillowTrees, OakTrees, Trees, Yews, Bankers, Log : integer;
CloseToYews, TreesFromYews, RockByWillows : integer;
x, y, i, fx, fy : integer;
C1 : integer;
time : integer;
TreeColors: array[0..3] of Integer;
procedure PlayerSetup;
begin
SRLPlayerForm(True, ['Is Axe Equipped?'], ['Loads'], ['YourSRLId', 'YourSRLPassword'], []);
end;
procedure Bitmaps;
begin
WillowTrees := DTMFromString('78DA637CC6C4C0C0CFC8800CF40245C0344C9' +
'4F12E50CD7F06FC6A5E02D5301330E735508D1C013557806A7E10' +
'B0EB27500D37AA39A19E61286A00258B0B86');
OakTrees := DTMFromString('78DA635CC2C0C0F0850105E8058A806946289' +
'F711690F888AAC6D64F1C55CD5422CC9902249818F19B03B2EB21' +
'7EBB00F6FC09D5');
Trees := DTMFromString('78DA637CCFC8C0B08A0105D8FA89836946289' +
'FF12790B502558D5EA008AA9A6740D602543572CE7CA86AAE0159' +
'8B09987307C89A83AA26505F10450D0037370A89');
Bankers := DTMFromString('78DA639461606010654001FFFFFF07D38C503' +
'EA31090904455F3E70F13A61A41026A8481841C7E3500E04109A4' +
'');
Log := DTMFromString('78DA6314616060106340013E2E32609A11CA6' +
'7540412520C688011550D480B2F0135FC40828F801A7620214C40' +
'0D3311EE0199234F847B9408A891246C0E00D8F60238');
CloseToYews := DTMFromString('78DA637CCEC8C0B0840105D8C5F2816946289' +
'FF13E90359B809A7340D6025435FA09DCA86A3E0159F3F1AB0100' +
'C46C0897');
Yews := DTMFromString('78DA633CC5C8C0C00EC448202CC2174CC3441' +
'90F03594C04D41C02B2B808A8390764FD61C0AFE62290F505BF1A' +
'00BD460AEB');
TreesFromYews := DTMFromString('78DA631467626078CF8002EC62F9C0342394C' +
'FC80B54F39C801A76A09A4FA86AF413B851D5C801D5FC20608E04' +
'50CD53FCE600002768084A');
RockByWillows := DTMFromString('78DA637CCCC8C02001C448A038271B4CC3441' +
'92F025952A86A7C4A3451D55C01B2F808A83909647111618E2601' +
'3507812C46FC6A0040890B4A');
end;
procedure GetTheLevel;
begin
TheLevel := GetSkillInfo('woodcutting', false);
Writeln('Your Wc Level is ' + IntToStr(TheLevel));
end;
function WhichTreeToChop: String;
begin
if(TheLevel >=1) then
Result := 'Normal';
if(TheLevel >=20) then
Result := 'Oak';
if(TheLevel >= 41) then
Result := 'Willow';
if(TheLevel >= 65) then
Result := 'Yew';
Writeln(Result);
end;
procedure BankToTrees; //Instead of putting every one of your walks in the main loop, I made them into a case so you just put one.
begin
Case WhichTreeToChop Of
'Willow' :
begin
MakeCompass('N');
SetRun(True);
if not RadialWalk(FindRockColor, 175, 171, 49, 5, 5) then
begin
if DTMRotated(WillowTrees, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
if DTMRotated(RockByWillows, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
end;
end;
'Oak' :
begin
MakeCompass('N');
SetRun(True);
if not RadialWalk(2913660,81,91,42,5,5) then
begin
if DTMRotated(OakTrees, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
end;
end;
'Normal' :
begin
MakeCompass('N');
SetRun(True);
RoadColor := FindRoadColor
if not RadialWalk(RoadColor,304,321,54,5,5) then
begin
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=647;
Path[0].Mainpoint.y:=70;
Path[0].Subpoints[0].x:=622;
Path[0].Subpoints[0].y:=71;
Path[0].Subpoints[1].x:=635;
Path[0].Subpoints[1].y:=72;
Path[0].Subpoints[2].x:=653;
Path[0].Subpoints[2].y:=66;
Path[0].Subpoints[3].x:=672;
Path[0].Subpoints[3].y:=73;
Writeln(BoolToStr(FindPath(0, True)));
end;
begin
if DTMRotated(Trees, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
end;
end;
'Yew' :
begin
RoadColor := FindRoadColor
if not RadialWalk(RoadColor, 299, 312, 59, 5, 5) then
begin
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=647;
Path[0].Mainpoint.y:=70;
Path[0].Subpoints[0].x:=622;
Path[0].Subpoints[0].y:=71;
Path[0].Subpoints[1].x:=635;
Path[0].Subpoints[1].y:=72;
Path[0].Subpoints[2].x:=653;
Path[0].Subpoints[2].y:=66;
Path[0].Subpoints[3].x:=672;
Path[0].Subpoints[3].y:=73;
Writeln(BoolToStr(FindPath(0, True)));
end;
if DTMRotated(CloseToYews, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
RoadColor := FindRoadColor
if not RadialWalk(RoadColor, 320, 330, 59, 5, 5) then
begin
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=582;
Path[0].Mainpoint.y:=81;
Path[0].Subpoints[0].x:=603;
Path[0].Subpoints[0].y:=81;
Path[0].Subpoints[1].x:=559;
Path[0].Subpoints[1].y:=80;
Path[0].Subpoints[2].x:=594;
Path[0].Subpoints[2].y:=83;
Path[0].Subpoints[3].x:=573;
Path[0].Subpoints[3].y:=80;
Writeln(BoolToStr(FindPath(0, True)));
end;
if DTMRotated(Yews, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
if FindSymbol(x, y, 'Tree') then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
end;
end;
end;
procedure MyAntiBannage; forward;
procedure LetsChopTrees; //Same thing as the walks
begin
Case WhichTreeToChop Of
'Willow' :
begin
TreeColors[0] := 3896169; //Since you don't really need 4 arrays to store the tree colors I just made it into one.
TreeColors[1] := 3238238;
TreeColors[2] := 3902333;
TreeColors[3] := 1387816;
repeat
if not Loggedin then Exit;
for i := 0 to 3 do
begin
if(FindEnt(fx, fy, True))then exit;
if (FindObjCustom(X, Y, ['ill', 'low', 'illo'], [TreeColors[i]], 3)) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
GameTab(4);
FindNormalRandoms;
MyAntiBannage;
Wait(5000);
if InvFull then exit;
end;
end;
until (invfull);
end;
'Oak' :
begin
TreeColors[0] := 6464409;
TreeColors[1] := 2195310;
TreeColors[2] := 1715244;
TreeColors[3] := 11818;
repeat
if not Loggedin then Exit;
for i := 0 to 3 do
begin
if(FindEnt(fx, fy, false))then break;
if (FindObjCustom(X, Y, ['ak', 'Oak'], [TreeColors[i]], 3)) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
GameTab(4);
FindNormalRandoms;
MyAntiBannage;
Wait(5000);
end;
end;
until (invfull);
end;
'Normal' :
begin
TreeColors[0] := 2712154;
TreeColors[1] := 4088157;
TreeColors[2] := 1652782;
TreeColors[3] := 2195054;
repeat
if not Loggedin then Exit;
for i := 0 to 3 do
begin
if(FindEnt(fx, fy, false))then break;
if (FindObjCustom(X, Y, ['ree', 'Tree'], [TreeColors[i]], 3)) then
begin
Mouse(x, y, 3, 3, True);
GameTab(4);
FFlag(0);
FindNormalRandoms;
MyAntiBannage;
Wait(3000);
end;
end;
until (invfull);
end;
'Yew' :
begin
TreeColors[0] := 3166791;
TreeColors[1] := 3039576;
TreeColors[2] := 4030322;
TreeColors[3] := 3107424;
repeat
if not Loggedin then Exit;
for i := 0 to 3 do
begin
if(FindEnt(fx, fy, false))then break;
if (FindObjCustom(X, Y, ['ew', 'Yew'], [TreeColors[i]], 3)) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
FindNormalRandoms;
MyAntiBannage;
Wait(5000);
end;
end;
until (invfull);
end;
end;
end;
procedure TreesToBank; //Same deal as the ToTrees and CutTrees
begin
Case WhichTreeToChop Of
'Willow' :
begin
if not Loggedin then Exit;
MakeCompass('N');
SetRun(False);
GameTab(4);
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 3, 3, true);
FFlag(0);
end else
if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
end else
RadialWalk(5987171, 34, 39, 39, 5, 5);
end;
'Yew' :
begin
if not Loggedin then Exit;
MakeCompass('N');
SetRun(False);
GameTab(4);
if WhichTreeToChop = 'Yew' then
begin
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=667;
Path[0].Mainpoint.y:=79;
Path[0].Subpoints[0].x:=683;
Path[0].Subpoints[0].y:=86;
Path[0].Subpoints[1].x:=645;
Path[0].Subpoints[1].y:=85;
Path[0].Subpoints[2].x:=677;
Path[0].Subpoints[2].y:=77;
Writeln(BoolToStr(FindPath(0, True)));
end;
if DTMRotated(TreesFromYews, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
end;
RoadColor := FindRoadColor;
RadialWalk(RoadColor, 178, 155, 66, 5, 5);
RoadColor := FindRoadColor;
Path[0].Mainpoint.x:=672;
Path[0].Mainpoint.y:=100;
Path[0].Subpoints[0].x:=688;
Path[0].Subpoints[0].y:=99;
Path[0].Subpoints[1].x:=668;
Path[0].Subpoints[1].y:=99;
Writeln(BoolToStr(FindPath(0, True)));
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 3, 3, true);
FFlag(0);
end else
if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
end else
RadialWalk(5987171, 34, 39, 39, 5, 5);
end;
'Normal' :
begin
if not Loggedin then Exit;
MakeCompass('N');
SetRun(False);
GameTab(4);
RoadColor := FindRoadColor;
RadialWalk(RoadColor, 178, 162, 58, 5, 5);
RoadColor := FindRoadColor;
RadialWalk(RoadColor, 131, 104, 24, 5,5);
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 3, 3, true);
FFlag(0);
end else
if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
end else
RadialWalk(5987171, 34, 39, 39, 5, 5);
end;
'Oak' :
begin
if not Loggedin then Exit;
MakeCompass('N');
SetRun(False);
GameTab(4);
if FindSymbol(x, y, 'bank') then
begin
Mouse(x, y, 3, 3, true);
FFlag(0);
end else
if DTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
end else
RadialWalk(5987171, 34, 39, 39, 5, 5);
end;
end;
end;
procedure Bank;
begin
MarkTime(time);
repeat;
if (not (Loggedin)) then break;
OpenBankQuiet('db');
until (BankScreen or (TimeFromMark(time) > 120000));
if Players[CurrentPlayer].Booleans[0] then Deposit(1, 28, 2) else Deposit(2, 28, 2); //deleted a few lines by using an if...then...else statement
CloseBank;
C1 := C1 + 1;
ReportVars[0] := ReportVars[0] + 1;
SRLRandomsReport;
end;
procedure MyAntiBannage;
begin
case Random(40) of
0: RandomRClick;
1: BoredHuman;
2: RandomMovement;
3: AlmostLogout;
4: PickUpMouse;
5: HoverSkill('Woodcutting', False);
end;
end;
procedure Signature;
begin
Writeln(' ______ _ ____ __');
Writeln(' / __/ /__ (_) / /__/ /');
Writeln(' _\ \/ ^_// / / / _ / ');
Writeln('/___/_/\_\/_/_/_/\_,_/ ');
Writeln('Multi Tree Chopper and ');
Writeln(' Banker ');
end;
procedure Proggy;
begin
Writeln('[------Skilld Multi Tree Chopper------]');
Writeln('[-------------------------------------]');
Writeln('[---Worked For ' + TimeRunning + '---]');
Writeln('[----Banked ' + IntToStr(C1) + ' Times----]');
Writeln('[------Remember To Post Proggies------]');
end;
begin
SetupSRL;
ClearDebug;
Signature;
Wait(1000);
PlayerSetup;
SRLID := Players[0].Strings[1];
SRLPassword := Players[0].Strings[2];
ScriptID := '655';
ActivateClient;
repeat
if LoggedIn then Logout;
LoginPlayer;
Bitmaps;
GetTheLevel;
repeat
WhichTreeToChop;
BankToTrees;
LetsChopTrees;
if InvFull then
begin
TreesToBank;
Bank;
Proggy;
end;
until C1 = Players[CurrentPlayer].Integers[0];
NextPlayer(LoggedIn); //LoggedIn returns a boolean... so we can do this. very sexy too :)
until (false); //See my comments below the script please
FreeDTM(TreesFromYews);
FreeDTM(WillowTrees);
FreeDTM(Trees);
FreeDTM(Yews);
FreeDTM(Bankers);
FreeDTM(Log);
FreeDTM(CloseToYews);
end.