program Treechopper;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/reflection/reflection.simba}
{dont have reflection http://blanddns.no-ip.org:81/repos/reflection}
{see my tut to set it up http://villavu.com/forum/showthread.php?p=710707#post710707}
var
x, y, a, b, c, d, e2, f, t, t1, t2: Integer;
r1, r2: String;
Bank, Trees, e: TTile;
{------------------------------------------------------------------------------}
{------------------------------PLayer setup------------------------------------}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; // Your RuneScape username.
Pass := ''; // Your RuneScape password.
Nick := ''; // 3-4 LOWERCASE letters from username.
Active := True; // Use this player?
end;
end;
{------------------------------------------------------------------------------}
{---------------------------------keep out-------------------------------------}
procedure Report;
begin
t := GetTimeRunning / 1000;
t1 := t / 60;
t2 := t1 / 60;
d := c * 28;
ClearDebug;
Writeln('-----Willow tree------');
Writeln('-------Chopper--------');
Writeln('Total loads ' + IntToStr(c) + ' Total logs ' + IntToStr(d));
Writeln('-----Current act------');
Writeln(' ' + r1 + ' ');
Writeln(' ' + r2 + ' ');
Writeln('------Time running----');
Writeln(' ' + IntToStr(t2) + ' hrs ' + IntToStr(t1) + ' mins ' + IntToStr(t) + ' sec');
Writeln('Levels gained: ' + IntToStr(b));
Writeln('Pos ' + IntToStr(e2) + ' anim ' + IntToStr(GetAnimation) + ' ');
end;
procedure StartUp;
begin
MakeCompass('n');
SetAngle(True);
r1 := 'Starting up.';
r2 := 'Making compass north.';
Report;
Bank := Tile(3092, 3243);
Trees := Tile(3085, 3237);
end;
procedure FaiSafe;
begin
repeat
if (not(R_LoggedIn)) then
LoginPlayer;
if not(FindObjCustom(x, y, ['illow'], [10076602, 5207920], 5)) then
begin
Inc(a);
Wait(2750 + Random(500));
r1 := 'No tree found, waiting.';
r2 := 'Try ' + IntToStr(a);
Report;
Writeln('No trees found waiting.');
end else
begin
r1 := 'Tree found! Moving on.';
r2 := 'Tries ' + IntToStr(a);
Report;
Writeln('Trees found right postion. Moving on.');
Wait(250 + Random(500));
a := 0;
Exit;
end;
Writeln('Try ' + IntToStr(a));
if(a = 5)then
begin
r1 := 'No tree found, max trys.';
r2 := 'logging out';
Report;
Writeln('LOST! logging out.');
LogOut;
TerminateScript;
end;
until False;
end;
procedure Bank1;
begin
if (not(R_LoggedIn)) then
LoginPlayer;
WalkToTile(Bank, 0, 0);
R_Flag;
r1 := 'Walking...';
r2 := ' ';
Report;
r1 := 'Looking for bank...';
r2 := ' ';
Report;
repeat
OpenBank('db', True, True);
Wait(250 + Random(500));
if (not(R_LoggedIn)) then
LoginPlayer;
until BankScreen;
r1 := 'Depositing all.';
r2 := ' ';
Report;
DepositAll;
CloseBank;
r1 := 'Waiting...';
r2 := ' ';
Report;
WalkToTile(Trees, 0, 0);
if (not(R_LoggedIn)) then
LoginPlayer;
R_Flag;
r1 := 'Entering failsafe...';
r2 := ' ';
Report;
FailSafe;
end;
procedure AntiBan;
begin
if (not(R_LoggedIn)) then
LoginPlayer;
case Random(8) of
1..3: SmartMoveMouse(x + Random(342), y + Random(452));
4: Wait(234 + Random(34));
5: MakeCompass(Random(180));
6: MakeCompass(Random(-180));
7, 8: RandomMovement;
end;
end;
procedure FindTrees;
begin
repeat
if (not(R_loggedin)) then
LoginPlayer;
r1 := 'Searching for tree.';
r2 := '';
Report;
if(FindObjCustom(x, y, ['illow'], [10076602, 5207920], 5))then
begin
SmartClickMouse(x, y, True);
R_Flag;
repeat
AntiBan;
Wait(1000 + Random(250));
if(LevelUp)then
begin
Inc(b);
LevelUp;
end;
until not((GetAnimation = 875) or (InvFull));
r1 := 'Tree gone.';
r2 := 'Or full.';
Report;
Wait(750 + Random(500));
until InvFull;
r1 := 'Full!';
r2 := 'Banking.';
Report;
Bank1;
end;
begin
SetupSRL;
Report;
DeclarePlayers;
LoginPlayer;
repeat
Wait(50 + Random(50));
until R_RSReady;
StartUp;
repeat
FindTrees;
until False;
end.
Just standardized it.