SCAR Code:
Program Willower;
{.include SRL/SRL.Scar}
{.include SRL/SRL/Skill/Woodcutting.Scar}
const
SRLStatsID = ''; // Your SRL Stats ID
SRLStatsPW = ''; // Your SRL Stats Password
var Willow,x,y,LoadNumber,DroppedLogs : Integer;
MT : LongInt;
Procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;
Players[0].Name := ''; //UserName
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //Nickname (3-4 letters)
Players[0].Integers[0]:= 10; //Number of loads to bank/cut
Players[0].Active := True; //Active
Players[0].Booleans[0]:= True; //True = Bank logs, False = Drop logs (Power chop)
Players[0].Booleans[1]:= False;// False = Keep random event items, True = Drop
Writeln('Using '+IntToStr(HowManyPlayers)+' Players');
ClearDebug;
end;
{******************************************************************************}
procedure SetUpPlayer;
begin
DeclarePlayers;
if not (LoggedIn) then
begin
LogInPlayer;
end;
if LoggedIn then
begin
SetRun(True);
MakeCompass('N');
Wait(450 + Random(650));
end;
end;
{******************************************************************************}
Function FindRandoms: Boolean;
begin
If not (LoggedIn) then Exit;
If FindNormalRandoms then Result:= True;
If FindFight then
RunAway('e', true, 1, 13000 +random(5000));
If FindDead then
begin
Writeln('LOL ur dead and u never got a funeral...');
LogOut;
Exit;
end;
If IsChatBlackTextAnyLine('have an axe') then
begin
Writeln('Broke axe - BLAST back to bob...');
LogOut;
Exit;
end;
If FindTalk then Result:= True
end;
{******************************************************************************}
procedure LoadWillowDTM;
begin
Willow := DTMFromString('78DA6374666660E06262400651818A609A11C' +
'A67F405AA614655039385AB0904AA1122A0C60EA84682801A13A0' +
'1A41026A2C816A58F0AB01009FEE02D4');
end;
{******************************************************************************}
function GroundDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 849;
dtmMainPoint.y := 425;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 2778230;
dtmMainPoint.Tolerance := 5;
dtmSubPoints[0].x := 849;
dtmSubPoints[0].y := 425;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 2778230;
dtmSubPoints[0].Tolerance := 5;
dtmSubPoints[1].x := 854;
dtmSubPoints[1].y := 420;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 2977660;
dtmSubPoints[1].Tolerance := 5;
dtmSubPoints[2].x := 844;
dtmSubPoints[2].y := 409;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 2976124;
dtmSubPoints[2].Tolerance := 5;
dtmSubPoints[3].x := 852;
dtmSubPoints[3].y := 420;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 2977660;
dtmSubPoints[3].Tolerance := 5;
dtmSubPoints[4].x := 849;
dtmSubPoints[4].y := 426;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 2779510;
dtmSubPoints[4].Tolerance := 5;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
{*****************************************************************************}
function BankDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 878;
dtmMainPoint.y := 365;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 4539722;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 878;
dtmSubPoints[0].y := 365;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 4539722;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 869;
dtmSubPoints[1].y := 365;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 4539722;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 872;
dtmSubPoints[2].y := 370;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 10218994;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 872;
dtmSubPoints[3].y := 360;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 4539722;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
{******************************************************************************}
procedure WillowProgress;
begin
ClearDebug;
Writeln('|| (Worked For : '+ (TimeRunning));
Writeln('|| Did ' + IntToStr(LoadNumber) + ' Loads ||');
Writeln('||-------------------------------------------------------||');
Writeln('|| Thanks for using OH Willow Chopzor, post errors plz ||');
SRLRandomsReport;
end;
{*****************************************************************************}
procedure CountWillows;
begin
LoadWillowDTM;
Willow:=Willow + ItemAmount('inv', 'dtm', Willow, []);
end;
{******************************************************************************}
procedure FindBrokenAxe;
var
T: integer;
begin
if not (LoggedIn) then Exit;
if TimeFromMark(T) < 1000 then Exit;
FindRandoms;
MarkTime(T);
if (FindBlackChatMessage('You do not')) then
begin
Writeln('Broken Axe, logging out.');
end;
end;
{******************************************************************************}
function WalkToWillows: Boolean;
var
GroundDTM: integer;
begin
if not (LoggedIn) then Exit;
SetRun(True);
GroundDTM := GroundDDTM;
if FindDTM(GroundDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X , Y, 8, 8, True);
WriteLn('Moving to willows now');
FFlag(0);
Result := True;
end else
if RadialWalk(FindWaterColor,150,250,72,4,4) then
begin
Writeln('DDTM failed, now using RW to go to willows');
Result := True;
end else
if FindSymbol(x, y, 'fish') then
begin
mouse(x, y + 20, 6, 6, true);
Writeln('Found Fish Symbol *Phew*');
FFlag(2);
Exit;
Result := False;
FreeDTM(GroundDTM);
if not (Result) then
begin
Logout;
exit;
end;
end;
end;
{******************************************************************************}
function WalkToBank: Boolean;
var
BankDTM: integer;
begin
if not (LoggedIn) then Exit;
SetRun(True);
MakeCompass('N');
BankDTM := BankDDTM;
if FindDTM(BankDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Going to bank');
FFlag(0);
Result := True;
end else
if RadialWalk(BankColor,24,39,53,3,3) then
begin
Writeln('DDTM failed, now using RW to bank');
Result := True;
end else
if FindSymbol(x, y, 'bank') then
begin
FindRandoms;
mouse(x, y, 2, 2, true);
Writeln('Found Bank Symbol');
FFlag(2);
Exit;
begin
Result := False;
FreeDTM(BankDTM);
if not (Result) then
begin
Logout;
exit;
end;
end;
end;
end;
{******************************************************************************}
procedure AntiBan;
begin
if(not(LoggedIn))then Exit;
if not IsUpText('Willow') or (TimeFromMark(MT) < 4500 + random(5000)) then
begin
case Random(13) of
0: begin
HoverSkill('Woodcutting', false);
wait(2200+Random(900));
end;
1: begin
HoverSkill('Woodcutting',false);
wait(2400+Random(600));
GameTab(4);
end;
2: begin
RandomRClick;
wait(500 + random(500));
GameTab(1 + random(10));
end;
3: begin
GameTab(1 + random(10));
wait(900 + random(600));
GameTab(1 + random(200));
end;
4: begin
IdleTime(1000 + Random(500), 480, 0.4);
Wait(500 + random(750));
end;
5: begin
RandomRClick;
wait(500 + random(600));
end;
end;
end;
end;
{******************************************************************************}
procedure ChopWillows;
var
x,y,TC: Integer;
TreeColour: array[0..3] of integer;
begin
Wait(4000+random(400))
TreeColour[0] := 2048822
TreeColour[1] := 2704687
TreeColour[2] := 1651754
for TC := 1 to 3 do
begin
if not (LoggedIn) then Exit;
If (FindNormalRandoms) or (InvFull) then Exit;
FindBrokenAxe;
if (FindObjTPA(x, y, 4876128, 11, -1, 8, 8, 15, ['illow']))then
begin
MMouse(x,y,0,0);
if(IsUpText('illow'))then
FindObjTPA(x, y, 4876128, 11, -1, 8, 8, 10, ['illow']);
GetMousePos(x,y);
Mouse(x,y,0,0,True);
FindObjTPA(x, y, 4876128, 11, -1, 8, 8, 10, ['illow']);
end;
repeat
FTWait(2);
FindNormalRandoms;
AntiBan;
Wait(1200+random(240))
Until not IsUpText('Willow') or (InvFull);
end;
end;
{******************************************************************************}
procedure SRLstats;
begin
SetupSRL;
begin
SRLID := SRLStatsID;
SRLPassword := SRLStatsPW;
end;
end;
{******************************************************************************}
Procedure DropStuff;
var
WillowDTM : Integer;
i : Integer;
DropArr : Array of Integer;
begin
FindRandoms;
If not LoggedIn then Exit;
If (players[currentplayer].Booleans[0]=false) and (players[currentplayer].Booleans[1]=true) then
begin
LoadWillowDTM;
If FindDTM(WillowDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
Begin
if (IsUpText('illow'))then
begin
Mouse(x,y,0,0,False);
ChooseOption('Drop');
FindRandoms;
end;
end;
end;
If (players[currentplayer].Booleans[0]=false) and (players[currentplayer].Booleans[1]=false) then
begin
FindRandoms;
DropArr:= [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28];
for i := 1 to 26 do
If ExistsItem(DropArr[i]) then
DropItem(DropArr[i]);
DroppedLogs := DroppedLogs + 1
end;
{******************************************************************************}
begin
SetupSRL;
ActivateClient;
Wait (1000+random(120));
SetUpPlayer;
WalkToWillows;
repeat
ChopWillows;
if InvFull and (players[currentplayer].Booleans[0]=false) then
begin
DropStuff;
end;
if InvFull and (players[currentplayer].Booleans[0]=true) then
begin
WalkToBank;
end;
end.