SCAR Code:
program AserPowerCutter;
{.include srl/srl.scar}
{.include srl/srl/skill/woodcutting.scar}
const
/////////////////////////////////////////////////////////////
// GENERAL SETUP //
TreeType = 'ree'; // Tree for now, might add other kinds later
UseMiniMapMove = True; //Will try to move to another tree if it
//can't find any near
WieldAxe = True; //Are you weilding the axe? False for no
LoadsToCut = 10; //False if extra axe in first inventory slot
//////////////////////////////////////////////////////////////
// COLOR SETUP //
TreeColor = 3700329; // Color of the Tree you want to cut
TreeColor2 = 2776404; //Another Color
TreeColor3 = 3766379; //Another Color
MiniMapTree = 78895; //Color of the tree on the mini map
var
Colour: array [0..2] of integer;
LoadCounter, EntsFound, BackupUsed : Integer;
//////////////////////////////////////////////////////////////
// PLAYER SETUP //
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; //account name
Players[0].Pass :=''; //account password
Players[0].Nick :=''; //3-4 Letters of name
Players[0].Active:=True; // Active true or false.
{Players[1].Name :=''; //account name
Players[1].Pass :=''; //account password
Players[1].Nick :=''; //3-4 Letters of name
Players[1].Active:=False; // Active true or false.
}
End;
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
/////................ END OF SETUP............////////////////////////
//////////////////////////////////////////////////////////////////////
procedure AntiBan;
begin
if not (LoggedIn) then exit;
case (Random(100)) of
0: RandomRClick;
5: HoverSkill('Woodcutting',False);
10:BoredHuman;
15:RandomMovement;
20:GameTab(Random(15));
///////ADD MORE///////////
end;
end;
procedure AntiRandoms;
var
x,y : Integer;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
if FindFight then
RunAway('n',True,1,5000);
if FindEnt(x,y,True) then //////////////////////////////////////////////////
Inc(EntsFound);
end;
procedure Login;
begin
if (not(LoggedIn))then
begin
LoginPlayer;
Wait(1000+random(1000));
MakeCompass('n');
Wait(500+random(1000));
end;
FindAxe;
if not EquipAxe then
begin
WriteLn('No axe was found switching players and setting this one as inactive');
NextPlayer(False);;
end;
end;
procedure MiniMapMove;
var
x,y : Integer;
begin
if not (LoggedIn) then exit;
if (InvFull) then exit;
if (UseMiniMapMove = True) then
begin
if (FindColorSpiral(x,y,MiniMapTree,MMX1,MMY1,MMX2,MMY2)) then
begin
AntiRandoms;
AntiBan;
Wait(100 + Random(100));
Mouse(x,y,3,3,True);
Flag;
end;
end;
end;
Procedure BackupCutter;
var
i,x,y,BackupFail : Integer;
BackupFind : Boolean;
begin
if not (LoggedIn) then exit;
if (InvFull) then exit;
for i:=0 to 2 do
if FindColorSpiral(x,y,Colour[i],MSX1,MSY1,MSX2,MSY2) then
begin
AntiRandoms;
AntiBan;
Wait(200 + Random(250));
Mouse(x,y,3,3,True);
BackupFind:= True;
Exit;
end;
if not (BackupFind = True) then Inc(BackupFail);
if (BackupFail > 1) then
begin
WriteLn('BackupFind failed moving if preferences allow');
MiniMapMove;
end;
end;
procedure FindAndCutTree;
var
i,x,y,MissFind : Integer;
Find : Boolean;
begin
if not (LoggedIn) then exit;
if (InvFull) then exit;
Login;
Colour[0]:= TreeColor;
Colour[1]:= TreeColor2;
Colour[2]:= TreeColor3;
for i:=0 to 2 do
begin
if FindObjCustom(x,y,[TreeType],[Colour[i]],5) then
begin
Wait(100 + random(100));
Mouse(x,y,2,2,False);
ChooseOption('hop');
Flag;
AntiBan;
AntiRandoms;
Wait(1001 + random(2000));
Find:= True;
end;
if not Find then
begin
Inc(MissFind);
WriteLn('Missed FindObjCustom Find ' + IntToStr(MissFind) + ' times.');
end;
if (MissFind > 1) then
begin
BackupCutter;
Inc(BackupUsed);
end;
end;
end;
procedure Drops;
var
i : Integer;
begin
if not (LoggedIn) then exit;
if (InvFull) then
begin
case [WieldAxe] of
True: begin
for i:=2 to 28 do
DropItem(i);
AntiRandoms;
end;
False: DropAll;
end;
Inc(LoadCounter);
if (LoadCounter + 1 > LoadsToCut) then
NextPlayer(True);
end;
end;
procedure ProgressReport;
begin
Wait(1000 + Random(250));
ClearDebug;
WriteLn('--------------------------');
WriteLn(' Aser"s Woodcutter ');
WriteLn(IntToStr(LoadCounter) + ' loads were dropped.');
WriteLn(IntToStr(EntsFound) + ' Ents were encountered.');
WriteLn('Backup was used ' + IntToStr(BackupUsed) + ' time(s).');
WriteLn('---------------------------');
end;
begin
SetupSRL;
SetupWoodcutting;
DeclarePlayers;
repeat
Login;
FindAndCutTree;
Wait(1000 + random(250));
Drops;
ProgressReport;
until(Players[0].Active = False);
end.