SCAR Code:
{
John's Willow cutter
Description:
Cut's logs in draynor, then banks!
Instructions:
1. Set the Runescape brightness to V-bright, and your computer's
resolution to 32bit resolution.
2. Need SCAR version 3.12
3. Need SRL version 4
5. Setup Lines 60-64, and 70+
6. Start script in Draynor Bank.
7. Start with a axe in your first inventory slot or wielded.
8. Recomended to have extra axes near top of bank.
Features:
AutoResponder
AntiBan
Randoms
AutoColor
Multiple Players}
Program JohnWillowCutter;
{.Include SRL/SRL.Scar}
{.Include SRL/SRL/Skill/Woodcutting.Scar}
Var
BankDTM, TempWaterColor : Integer; //DTM and colors are integers
LogMask, AxeMask : Integer; //bitmaps are strings
Chat, Name, ChatName: String;
NoAxe, NoAxes: Boolean;
ChopMark, CallibrateTime: LongInt;
Loads, TotalWillows, TotalExp: Integer;
tx, ty : Integer; //added to use for coordinates
Mark : LongInt; //declared for your MarkTimes to work
{setup}
Const ver = '0.1'; //put your version in here
Const WaitTime= 25; //Second to wait before clicking tree again used as a failsafe random extra 5 seconds is added on
Const DebugMode= 2;
Const RunDirection= 'E'; //Direction To Run Incase of a Fight?
Const UseAutoResponder= True; //Enable The Auto Responder?
Const MaxLoadTime= 10; //Max Time 1 Load Can Take In Minutes
{players}
Procedure DeclarePlayers;
Begin
HowManyPlayers := 3;
CurrentPlayer:= 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; //3 Lowercase Letters of your username
Players[0].Integers[0] := 90; //Loads For Player
Players[0].Booleans[0] := False; //Equip Axe?
Players[0].Active := True;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Integers[0] := 60;
Players[1].Booleans[0] := True;
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Integers[0] := 35;
Players[2].Booleans[0] := False;
Players[2].Active := True;
End;
Procedure LoadDTMs;
Begin
BankDTM := DTMFromString('78DA63EC60626008614001FFFFFF676060042' + //Wizzup? =]
'310FB3F6303508D37448E09AAE6ED5B08CD08E583D50413A1269C' +
'809A0AC26A00E665129F');
End;
Function FindMMWaterColor: Integer;
Var
Tol, WX, WY, MMWater: Integer;
Begin
MMWater := BitmapFromString(4, 4, 'z78DA3377B53474B234A7190' +
'9002EDC1611');
Repeat
Begin
If(not(LoggedIn))then Break;
Tol:= Tol + 5;
If(FindBitmapToleranceIn(MMWater, WX, WY, MMX1, MMY1, MMX2, MMY2, Tol))then
Begin
WaterColor:= GetColor(WX, WY);
Result:= WaterColor;
End
End
Until(Result > 0) or (Tol > 75);
If(Result= 0)then
Begin
WriteLn('Could NOT Find MMWater Color, Please Restart Script!');
Logout;
End else
Begin
WriteLn('MMWaterColor - '+IntToStr(Result));
End
FreeBitmap(MMWater);
End;
function FindBankers(var x, y: Integer): Boolean; //The Claw =]
Var BankDTM : Integer;
begin
if not LoggedIn then Exit;
Result := DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2);
end;
Procedure AntiBan;
Var
X: Integer;
Begin
If(InvFull)then Exit;
If(TimeFromMark(ChopMark) > 1000+Random(4000))then
Begin
Status('AntiBan');
X:= Random(9)+1;
ActivateClient;
Case X of
0 : SleepAndMoveMouse(750+Random(2000));
1 : SendArrowSilentWait(((Random(2)*2)), 1000+Random(200));
2 : SendArrowSilentWait(((Random(2)*2) + 1), 200+Random(200));
4 : SendArrowSilentWait(((Random(2)*2)), 200+Random(200));
5 : SendArrowSilentWait(((Random(2)*2) + 1), 20+Random(20));
6 : SendArrowSilentWait(((Random(2)*2)), 20+Random(20));
7 : IdleTime(500, 500, 1.0);
8 : begin GameTab(1+Random(7)) Wait(Random(300)) GameTab(4) end;
9 : IdleTime(300, 200, 2.0);
End
FindTalk;
SendArrowSilentWait(0, 750+Random(500));
End
End;
Function GetChatMessage(Text: String): Boolean;
Var
TX, TY: Integer;
Chat: String;
Begin
If(IsTextInAreaEx(40, 415, 130, 415, TX, TY, ':', 0, SmallChars, False, True, 0, 0, 0))then
Begin
Chat:= Lowercase(Trim(GetTextAtEx(TX + 8, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, TR_AllChars)));
If(Pos(Text, Chat) <> 0)then
Begin
Result:= True;
End
End
End;
Function GetChatName(Name: String): Boolean;
Var
I: Integer;
Begin
ChatName:= Lowercase(Trim(GetTextAtEx(21, 415, 0, SmallChars, False, False, 0, 0, 0, 50, False, TR_AllChars)));
I:= Pos(':', ChatName);
If(I <> 0)then
Begin
Delete(ChatName, I, I);
End
If(Pos(Name, ChatName) <> 0)then
Begin
Result:= True;
End
End;
Function AutoRespond: Boolean;
Var
Responce, Lvl: String;
RandomReply: Integer;
Begin
OldLine:= TheLine;
TheLine:= Lowercase(Trim(GetTextAtEx(20, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, TR_AllChars)));
If(GetChatName(Players[CurrentPlayer].Name))then
Begin
Exit;
End
If(OldLine=theLine)then
Begin
Exit;
End
If(GetChatMessage(Players[CurrentPlayer].Name)) or (GetChatMessage(Players[CurrentPlayer].Nick))then
Begin
WriteLn(''+ChatName+': '+Chat);
RandomReply:= Random(10)+1;
Case (RandomReply) of
0 : Responce:= ('?');
1 : Responce:= ('what');
2 : Responce:= ('yes');
3 : Responce:= ('no');
4 : Responce:= ('what do you want');
5 : Responce:= ('me?');
6 : Responce:= ('Yah?');
7 : Responce:= ('who?');
8 : Responce:= ('wha?');
9 : Responce:= ('?');
10 : Responce:= ('???');
End
TypeSend(Responce+' '+Name);
Result:= True;
End
If(GetChatMessage('lol')) or (GetChatMessage('lmao')) or (GetChatMessage('rofl')) or (GetChatMessage('haha'))then
Begin
WriteLn(''+ChatName+': '+Chat);
RandomReply:= Random(19)+1;
Case (RandomReply) of
0 : Responce:= ('hehe');
1 : Responce:= ('lolol');
2 : Responce:= ('lol');
3 : Responce:= ('haha');
4 : Responce:= ('whoa');
5 : Responce:= ('hehe');
6 : Responce:= ('good');
7 : Responce:= ('lmao');
8 : Responce:= ('rofls');
9 : Responce:= ('fun');
10 : Responce:= ('nice');
11 : Responce:= ('lol');
12 : Responce:= ('yep');
13 : Responce:= ('nice');
14 : Responce:= ('wow');
16 : Responce:= ('rofl');
17 : Responce:= ('hahaha');
18 : Responce:= ('cool');
19 : Responce:= ('what?');
End
TypeSend(Responce);
Result:= True;
End
If(GetChatMessage('wc')) or (GetChatMessage('woodcutting')) or (GetChatMessage('woodcuttin'))
And
(GetChatMessage('lvl')) or (GetChatMessage('level')) or (GetChatMessage('lvls')) or (GetChatMessage('levels'))then
Begin
WriteLn(''+ChatName+': '+Chat);
Lvl:= IntToStr(GetSkillLevel('woodcutting'));
RandomReply:= Random(5)+1;
Case (RandomReply) of
0 : Responce:= ('i''m lvl '+Lvl+' woodcuttin');
1 : Responce:= ('level '+Lvl+' wc');
2 : Responce:= ('lvl '+Lvl+' woodcut!');
3 : Responce:= (+Lvl);
4 : Responce:= ('i''m level '+lvl);
5 : Responce:= (+Lvl+' here :P');
End
TypeSend(Responce);
Result:= True;
End
If(GetChatMessage('wat')) or (GetChatMessage('what')) and (GetChatMessage('doin')) or (GetChatMessage('doing'))then
Begin
WriteLn(''+ChatName+': '+Chat);
RandomReply:= Random(9)+1;
Case RandomReply of
0 : Responce:= ('not much');
1 : Responce:= ('nothing');
2 : Responce:= ('bored');
3 : Responce:= ('aye?');
4 : Responce:= ('emmm..nothin');
5 : Responce:= ('nope');
6 : Responce:= ('nothin');
End;
TypeSend(Responce);
Result:= True;
End;
If(GetChatMessage('hey')) or (GetChatMessage('hi')) or (GetChatMessage('hello')) or (GetChatMessage('wats up')) or (GetChatMessage('whats up')) or (GetChatMessage('yo'))then
Begin
WriteLn(''+ChatName+': '+Chat);
RandomReply:= random(9)+1;
Case RandomReply of
0 : Responce:= ('ello');
1 : Responce:= ('sup');
2 : Responce:= ('yo');
3 : Responce:= ('whats up everyone');
4 : Responce:= ('whats up');
5 : Responce:= ('welcome');
6 : Responce:= ('Hello');
7 : Responce:= ('wat up');
10 : Responce:= ('wasup');
End
TypeSend(Responce);
Result:= True;
End
End;
Procedure Fight;
Var x,y : integer;
Begin
RunAwayDirection(RunDirection);
Wait(10000+Random(2000));
RunBack;
if(FindSymbol(x, y, 'fishspot'))then
Begin
Mouse(x, y - 20, 5, 6, True);
FindTalk;
Flag;
End;
End;
procedure WalkToWillow; //From tails111's choppybank. =]
begin
if Not(LoggedIn) then
begin
LoginPlayer;
Exit;
end;
MakeCompass('N');
TempWaterColor := FindWaterColor;
RadialWalk(TempWaterColor, 230, 290, 70, 5, 5);
FFlag(1);
if(FindSymbol(tx, ty, 'fish'))then
begin
Mouse(tx, ty, 5, 5, True);
FFlag(1);
end else
begin
Mouse(625, 128, 15, 15, True);
FFlag(1);
if(FindSymbol(tx, ty, 'fish')) then
begin
Mouse(tx, ty, 5, 5, True);
FFlag(1);
end;
end;
end;
procedure WalkToBankWillow; //Tails111's choppy bank =]
begin
if not(LoggedIn) then
begin
LoginPlayer;
Exit;
end;
if(FindBankers(tx, ty)) then
begin
Mouse(tx, ty, 5, 5, True);
FFlag(0);
Exit;
Exit;
end else
if(FindSymbolIn(tx, ty, 'fish', 621, 76, 646, 91)) then
begin
Status('Walking from Fish Symbol');
Mouse(tx + 20, ty - 40, 4, 4, True);
FFlag(1);
FindBankers(tx, ty);
Mouse(tx, ty, 5, 5, True);
FFlag(0);
//MyFastRandoms; //Tails111's procedure? either way, not included in SRL or your script.
Players[CurrentPlayer].Loc := 'Bank - Walked In';
end;
end;
Function Ent(ex, ey: Integer): Boolean;
Var
Xe, Ye: Integer;
Begin
Status('FindEnt');
If(FindColorSpiralTolerance(Xe, Ye, 5535856, ex - 20, ey - 20, ex + 20, ey + 20, 12))then
Begin
MMouse(Xe, Ye, 5, 5);
Wait(100+Random(50));
End else
Begin
Exit;
End
If(IsUpTextMulti('hop down Will', 'down Willow', 'own Wil')) or (IsUpTextMulti('illow', 'low', 'Will'))then
Begin
If(FindColorSpiralTolerance(Xe, Ye, 383705, 1, 1, 180, 39, 20))or
(FindColorSpiralTolerance(Xe, Ye, 65535, 1, 1, 200, 40, 20))or
(FindColorTolerance(Xe, Ye, 55769, 85, 15, 115, 15, 20))then
Begin
EntsAvoided:= EntsAvoided + 1;
Result:= True;
End else
Result:= False;
Exit;
End
End;
Function ChopWillows: Boolean;
Var
CX, CY, x, y, TempColor: Integer;
Begin
If(not(LoggedIn))then Exit;
Status('Chopping');
If(IsUpTextMulti('hop down Will', 'down Willow', 'own Wil')) or (IsUpTextMulti('illow', 'low', 'Will')) Then
Begin
If(Random(20) < 15)then
Begin
Mouse(CX, CY, 2, 2, True);
Result:= True;
End
Else
Begin
Mouse(CX, CY, 2, 3, False);
If(IsUptext('hop down'))then //you had IsUpText(x, y, 'hop down');. IsUpText only requires the string to look for.
Result:= True;
End
End
If(FlagPresent)then
Begin
Flag;
End
Wait(200-Random(50));
Status('CheckAxe');
// FindAxeHead; //not found in SRL or your script.
If(Result= True)then
Begin
MarkTime(ChopMark);
Repeat
If(not(LoggedIn))then Break;
Status('FindRandoms->Nest->Axe');
// FindAxeHead; //not found in SRL or your script.
FindNormalRandoms;
Wait(Random(50));
FindBirdsNest;
If(NoAxe)then Break;
If(InvFull)then Break;
// WoodcuttingAntiban; //not found in SRL or your script.
If(UseAutoResponder)then Status('AutoRespond') AutoRespond;
If(Ent(CX, CY))then
Begin
Writeln('Found Ent!'); //you had debug. I just assume you want it written in the bottom box.
Mouse(MMCX, MMCY, 5, 5, True);
FindTalk;
Wait(10000+Random(5000));
FindNormalRandoms;
Exit;
End
Status('FindFight');
If(FindFight)then
Begin
Status('Found Fight');
// HandleFight; //not found in SRL or your script.
Exit;
End
Status('FindRandoms');
FindTalk;
Until(TimeFromMark(ChopMark) >= (WaitTime*1000+Random(5000))) or (not(FindColor(CX, CY, TempColor, CX - 10, CY - 10, CX + 10, CY + 10)));
End; //forgot a semicolon
End; //forgot a semicolon
//End; not needed. you've already ended everything for that.
{Function OpenBank: Boolean;
Var
BX, BY, Tries: Integer;
Begin
Repeat
If(FindObjectMulti(BX, BY, 'e Bank', 'Use Ba', 'ooth', 2842230, 3421241, 605778, 10, 5, True, True))then
MMouse(BX, BY, 2, 2);
If(IsUpTextMulti('e Bank', 'Use Ba', 'ooth'))then
Begin
Mouse(BX, BY, 4, 7, False);
Wait(10+Random(50));
If(ChooseOption(x, y, 'uickly'))then
Begin
MarkTime(Mark);
Repeat
Wait(10+Random(5));
If(TimeFromMark(Mark) > 20000)then
Begin
Result:= False;
Exit;
End
Until(BankScreen);
If(BankScreen)then
Begin
Result:= True;
Exit;
End
End
End
Else
Begin
Wait(1);
Tries:= Tries + 1;
End;
Until(Tries > 10);
End;}
//there are bank openers in bank.scar, also this name is already taken so it won't work.
Procedure CountLogs;
Var
WillowCount, WillowExp: Integer;
Begin
GameTab(4);
WillowCount:= CountItemBmpMaskTol(LogMask, 20, 10);
TotalWillows:= TotalWillows + WillowCount;
Players[CurrentPlayer].Integers[2]:= Players[CurrentPlayer].Integers[2] + WillowCount; //SRL uses Integers[2] instead of Integer2 now.
WillowExp:= (WillowCount*(125/2));
Players[CurrentPlayer].Integers[3]:= Players[CurrentPlayer].Integers[3] + Round(WillowExp);
TotalExp:= TotalExp + Round(WillowExp);
End;
Procedure BankWillows;
Begin
If(not(LoggedIn))then Exit;
Status('Banking');
CountLogs;
If(FlagPresent)then Wait(500+Random(2000));
HighestAngle;
MarkTime(Mark);
Repeat
//If(OpenBank)then Break; //this doesn't work because your procedure had different parameters than the srl one.
If(OpenBankQuiet('db'))then Break;
Until(BankScreen) or (TimeFromMark(Mark) > 90000);
If(TimeFromMark(Mark) > 90000)then
Begin
Players[CurrentPlayer].Loc:= 'Lost';
Logout;
Exit;
End
If(BankScreen)then
Begin
If(NoAxe= True)then
Begin
// ClickAllItemsColorWait('All', 65536, 500+Random(100)); //not quite sure what you're trying to do here. if your trying to bank, use DepositAll; for all items or Deposit(2, 28, 2); for all but first slot
FixBank;
Wait(Random(250)+300);
If(FindBitmapMaskTolerance(AxeMask, tx, ty, MSX1, MSY1, MSX2, MSY2, 20, 10))then //AxeMask doesn't exist. I declared it in globals so it will compile.
Begin
Mouse(tx, ty, 1, 1, True);
End else
Begin
Players[CurrentPlayer].Loc:= 'No Axes';
NoAxes:= True;
End
Wait(Random(250)+50);
End else
Begin
If(EquipAxe= False)then
Begin
Deposit(2, 28, 2);
Wait(100+Random(50));
Deposit(3, 28, 2);
End else
If(EquipAxe= True)then
Begin
// ClickAllItemsColorWait('All', 65536, 500+Random(100)); //Again, not quite sure what you're doing
Wait(Random(250)+300);
End
End
Repeat
If(not(LoggedIn))then Break;
CloseBank;
Until(not(BankScreen));
If(NoAxe= True)then
Begin
// FindAxeHeadColors; //not found in SRL or your script.
Wait(Random(300)+250);
If(EquipAxe= True)then
GameTab(4);
If(FindBitmapMaskTolerance(AxeMask, tx, ty, MIX1, MIY1, MIX2, MIY2, 20, 10))then
Begin
Mouse(tx, ty, 5, 5, True);
End
NoAxe:= False;
End
Loads:= Loads + 1;
Banks:= Banks + 1;
Players[CurrentPlayer].Banked:= Players[CurrentPlayer].Banked + 1;
End
End;
//proggy
Procedure PlayerStats;
Var
Active: String;
I: Integer;
Begin
If(Players[CurrentPlayer].Active= True)then
Begin
Active:= 'True';
End else
Begin
Active:= 'False';
End
WriteLn('________________________________________________'); //one too many ' were in here
Writeln(' Name : '+Players[CurrentPlayer].Name);
Writeln(' Number : '+IntToStr(CurrentPlayer));
Writeln(' Active : '+Active);
Writeln(' Location : '+Players[CurrentPlayer].Loc);
Writeln(' Chopped : '+IntToStr(Players[CurrentPlayer].Integers[2])+' willow[s].'); //Integers[2] not Integer2
Writeln(' Gained : '+IntToStr(Players[CurrentPlayer].Integers[3])+' exp.'); //Integers[3] not Integer3
Writeln(' Worked : '+IntToStr(Players[CurrentPlayer].Worked)+' mins.');
WriteLn('________________________________________________'); //one too many ' were in here
For I:= 0 to HowManyPlayers - 1 do
Begin
If(Players[i].Active= True)then Active:= 'T' else Active:= 'F';
WriteLn(' '+IntToStr(I)+' : '+Players[i].Name+' = '+Active+' - '
+'B '+IntToStr(Players[i].Banked)+' time[s], '
+'C '+IntToStr(Players[i].Integers[2])+' log[s], ' //Integers[2] not Integer2
+'G '+IntToStr(Players[i].Integers[3])+' exp., ' //Integers[3] not Integer3
+'L '+Players[i].Loc);
End
WriteLn('________________________________________________'); //one too many ' were in here
End;
Procedure ProgressReport;
Begin
ClearDebug;
WriteLn('________________________________________________'); //one too many ' in here
WriteLn('| -> Willow Chopper '+Ver+' > Prog Report < By - John <- |');
Writeln('________________________________________________');
WriteLn(' Worked for '+TimeRunning+'.');
WriteLn(' Banked '+IntToStr(Banks)+' Total Load[s].');
WriteLn(' Chopped '+IntToStr(TotalWillows)+' Total Willow[s].');
WriteLn(' Gained '+IntToStr(TotalExp)+' Total Exp.');
{If(HeadsFound > 0)then
WriteLn(' Found Axe Head '+IntToStr(HeadsFound)+' Time[s].');} //HeadsFound doesn't exist in your script or SRL
{If(AxesBroke > 0)then
WriteLn(' Broke '+IntToStr(AxesBroke)+' Axe[s].');} //Neither does this.
SRLRandomsReport;
PlayerStats;
End;
Procedure Callibrate;
Var
CX, CY: Integer;
Begin
If(not(LoggedIn))then Exit;
Status('Callibrating');
If(FindSymbol(CX, CY, 'fishing spot'))then
Begin
If(Distance(MMCX, CX, MMCY, CY) > 45)then
Begin
Mouse(CX +Random(5), CY - 10+Random(10), 4, 6, True);
Flag;
Writeln('Callibrated by Fishing Symbol.'); //debug -> writeln
End;
End;
{If(WeAreDead) or (FindSymbol(CX, CY, 'water source'))then //WeAreDead doesn't exist.
Begin
Players[CurrentPlayer].Loc:= 'Lumbridge';
Logout;
End;}
End;
Procedure Setup;
Begin
SetupSRL;
// LoadBitmaps; //you need a bitmap loading procedure. this is a huge problem
LoadDTMs;
DeclarePlayers;
MouseSpeed:= 10-Random(5);
ActivateClient;
If(not(LoggedIn))then LoginPlayer;
If(LoggedIn)then
Begin
EquipAxe:= Players[CurrentPlayer].Booleans[1]; //Boolean1 -> Booleans[1]
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
FindMMWaterColor;
FindTalk;
End
End;
//----------------------------------------------------------------------------
// Main Loop
//----------------------------------------------------------------------------
Begin
Setup;
Disguise ('iTunes')
Repeat
SetRun(True);
// DraynorBankToWillowTrees; //no such procedure exists
MarkTime(CallibrateTime);
MarkTime(Mark);
Repeat
If(not(LoggedIn))then Break;
If(TimeFromMark(CallibrateTime) >= (240000+Random(60000)))then
Begin
Callibrate;
MarkTime(CallibrateTime);
End
Wait(Random(50));
ChopWillows;
Until(InvFull) or (InvCount= 28) or (NoAxe) or (TimeFromMark(Mark) >= MaxLoadTime*60000);
Wait(Random(50));
SetRun(False);
// WillowTreesToDraynorBank; //no such procedure exists
BankWillows;
Wait(Random(50));
ProgressReport;
If(LoggedIn) and (Loads >= Players[CurrentPlayer].Integers[1]) or (NoAxes)then
Begin
Logout;
If(Random(5)= 1)then
Begin
Wait(1 * 60000 +Random(5 * 60000));
End else
Begin
Wait(1 * 60000 +Random(2 * 60000));
End
NextPlayer(True);
EquipAxe:= Players[CurrentPlayer].Booleans[1];
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
FindMMWaterColor;
FindTalk;
Loads:= 0;
End
If(not(LoggedIn))then
Begin
If(Random(5)= 1)then
Begin
Wait(1 * 60000 +Random(5 * 60000));
End else
Begin
Wait(1 * 60000 +Random(2 * 60000));
End
NextPlayer(False);
EquipAxe:= Players[CurrentPlayer].Booleans[1];
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
FindMMWaterColor;
FindTalk;
Loads:= 0;
End;
Until(False);
End.