SCAR Code:
program DraynorMasher;
{.include SRL/SRL/Misc/Smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/woodcutting.scar}
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//// ////
/// ///
/// ///
// //
// </////////// //
// // // **VERSION 1.4** //
// // // //
// // // //
// // // //
// </////////// RAYNOR WILLOW MASHER //
// *CREDITS* //
///BH(BobboHobbo)-His feedback,aswell as his DDTM walking tut helped alot ///
///Deathscytec-His Feedback helped us fix our antichat, aswell as using AC ///
////Frozen Soul-Looked over his AntiBan and AntiRandoms and used his ////
///////"InFight" procedure ////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
var
WillowDTM : Integer;
Chopped : Integer;
done:integer;
x, y, HP, Lvlups, HPTime, BankDTM: Integer;
ColorSign : string;
const//set number of loads before running the script
LoadsPerPlayer = 1; //Amounts of loads per player before switching.
Treecolor = 6061674;//Don't Touch
Treecolor2 = 3231573;//Don't Touch
World = 81;//World you want to smart to load
procedure DeclarePlayers;
begin
HowManyPlayers := 2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := True;}
end;
//////////////////////////////////////////////////////////////////////
//// DONT TOUCH ANYTHING BELOW THIS /////
//// (unless you know what you're doing of course) /////
//////////////////////////////////////////////////////////////////////
procedure Intro;
begin
Disguise(' Chopped: ' + IntToStr(Chopped) + ' Log(s)')
ClearDebug;
wait(225);
WriteLn(' Griff721 and');
wait(1000);
WriteLn(' ___ ____ ____');
wait(225);
WriteLn(' | __ \ | ___| | ___| ');
wait(225);
WriteLn(' | | | | | |___ | |___');
wait(225);
WriteLn(' | ___ / | ___| | ___|');
wait(225);
WriteLn(' | |__| | | |___ | |____');
wait(225);
WriteLn(' \____/ | ____| | ____|');
wait(500);
WriteLn(' Copyright © 2008-2009 Blumblebee/Griff721 ');
wait(1500)
ClearDebug;
WriteLn('Proudly Present:');
Wait(2000);
ClearDebug;
WriteLn(' <////////////');
WriteLn(' /// //');
WriteLn(' // // ');
WriteLn(' // // ');
WriteLn(' /// // RAYNOR WILLOW MASHER ');
WriteLn('<//////////// ');
Wait(1500);
WriteLn(' Version 1.7')
Wait(2000); // to give SMART an extra Time to start
ClearDebug;
end;
procedure AntiChat;//will be fixed for next update
begin
if (InChat('wc')) then
TypeSend('60');
if (InChat(Players[CurrentPlayer].Nick)) then
TypeSend('leave me alone');
if (InChat('hey')) then
TypeSend('hows it going?');
if (InChat('sup?')) then
TypeSend('nm nm');
if (InChat('lol')) then
TypeSend('lmao');
if (InChat('boring')) then
TypeSend('I know...');
if (InChat('Griff721 is sexy')) then
TypeSend('i know!');
end;
procedure SetUp;
begin
DeclarePlayers;
if not (LoggedIn) then
begin
LogInPlayer;
end;
if LoggedIn then
begin
SetRun(True);
MakeCompass('N');
Wait(400 + Random(655));
end;
end;
function InFight: Boolean; //Credit to Frozen Soul(from Forest FrostBite)
begin
if not (LoggedIn) then
Exit;
if Players[CurrentPlayer].Integers[4] = 0 then
begin
Players[CurrentPlayer].Integers[4] := GetSkillInfo('hitpoints', False);
GameTab(4);
end else
if Players[CurrentPlayer].Integers[4] > HP then
if TimeFromMark(HPTime) >= 60000 then
begin
x := TimeFromMark(HPTime) - 60000;
MarkTime(HPTime);
DecEx(HPTime, x);
Inc(HP);
end;
if FindColor(x, y, 65280, 217, 129, 297, 209) then
begin
x := GetMMLevels('hp', ColorSign);
if x = -1 then
begin
Result := FindFight;
Exit;
end;
if (x < HP) then
begin
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' + Chr(13));
TakeScreen('Found Fight');
Inc(Fights);
MarkTime(HPTime);
HP := GetMMLevels('hp', ColorSign);
if HP = -1 then
HP := Players[CurrentPlayer].Integers[4];
end;
end;
end;
procedure FindAllRandoms;
begin
if (not (LoggedIn)) then
Exit;
FindNormalRandoms;
if (InFight) then
begin
RunTo('E', True)
FFlag(0);
Wait(1000 + random(500));
if FindSymbol(x, y, 'fish') then
begin
mouse(x, y + 15, 6, 6, true);
end;
end;
end;
function FindGainedLevel: boolean;
begin
if not LoggedIn then Exit;
if ClickContinue(False,False) then
begin
if FindNPCChatText('lations', Nothing) then
begin
writeln('We gained a woodcutting level!');
Lvlups:=Lvlups+1;
ClickContinue(True,True);
Result := True;
Exit;
end;
end;
end;
Procedure AntiBan;
var
Bx:integer;
By:integer;
begin
if(not(LoggedIn))then
Exit;
case Random(55) of
0: begin
HoverSkill('Woodcutting', false);
wait(2453+Random(432));
end;
1:
begin
HoverSkill('Woodcutting',false);
wait(1000+Random(413));
GameTab(4);
end;
2: PickUpMouse;
3:
begin
MakeCompass('N');
wait(100+random(5));
MakeCompass('S');
wait(100+random(5));
MakeCompass('N');
end;
4:
begin
RandomRClick;
wait(500 + random(500));
end;
5:
begin
IdleTime(1000 + Random(750), 500, 0.5);
Wait(300 + random(700));
end;
6:
begin
MMouse(Random(x), Random(y), 0, 0);
Wait(200 + random(100));
if (IsUpText('opti')) then
begin
GetMousePos(Bx, By);
Mouse(Bx, By, 0, 0, false);
Wait(200 + random(100));
ChooseOption('xamine');
end;
end;
end;
end;
function FindEntText(YellowText : Integer): Boolean;
begin
If FindTextTPA(ClYellow, 30, MSX1, MSY1, MSCX, MSCY, 'illow', chopped, Move) Then
begin
WriteLn('Found Ent');
Runto('N',true);
FFlag(0);
Result := True;
Exit;
end else
Exit;
end;
function RockDDTM: Integer;//*Needs Editing, not right ATM*
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 629;
dtmMainPoint.y := 35;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 5134671;
dtmMainPoint.Tolerance := 10;
dtmSubPoints[0].x := 625;
dtmSubPoints[0].y := 33;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 3029039;
dtmSubPoints[0].Tolerance := 10;
dtmSubPoints[1].x := 630;
dtmSubPoints[1].y := 38;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 4344899;
dtmSubPoints[1].Tolerance := 10;
dtmSubPoints[2].x := 631;
dtmSubPoints[2].y := 32;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 1713179;
dtmSubPoints[2].Tolerance := 10;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function FindRockDDTM(A, B, C, D: integer): boolean;
var TheDTM: Integer;
begin
TheDTM := RockDDTM;
Result := FindDTM(TheDTM, X, Y, A, B, C, D);
FreeDTM(TheDTM);
end;
function ToTrees: Boolean;
var
RockDTM: integer;
begin
if not (LoggedIn) then
Exit;
SetRun(True);
FindAllRandoms;
if (FindRockDDTM(588, 12, 639, 58)) then
begin
Writeln('Going to willows');
Mouse(x + 30, y + 5, 9, 12, true);
FFlag(2);
Exit;
end else
if RadialWalk(FindWaterColor,210,260,72,4,4) then
begin
Writeln('Going to willows');
Result := True;
end else
begin
Result := False;
Writeln(' Both DDTM and Radial Walk failed tell Griff and blumblebee to fix they re script...politely of course');
FreeDTM(RockDTM);
if not (Result) then
begin
Logout;
exit;
end;
end;
end;
function BankDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 130;
dtmMainPoint.y := 85;
dtmMainPoint.AreaSize := 3;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 16711422;
dtmMainPoint.Tolerance := 255;
dtmSubPoints[0].x := 130;
dtmSubPoints[0].y := 85;
dtmSubPoints[0].AreaSize := 3;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 16711422;
dtmSubPoints[0].Tolerance := 255;
dtmSubPoints[1].x := 122;
dtmSubPoints[1].y := 77;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 195836;
dtmSubPoints[1].Tolerance := 25;
dtmSubPoints[2].x := 123;
dtmSubPoints[2].y := 85;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 62965;
dtmSubPoints[2].Tolerance := 25;
dtmSubPoints[3].x := 122;
dtmSubPoints[3].y := 90;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 25;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function ToBank: Boolean;
var
BankDTM: integer;
WalkAngle: Extended;
WalkDTM: integer;
begin
if not (LoggedIn) then
Exit;
makeCompass('n');
SetRun(True);
FindAllRandoms;
WalkDTM := BankDDTM;
if FindDTM(WalkDTM, X, Y, MMx1,MMy1,MMx2,MMy2) then
begin
Mouse(X, Y, 8, 8, True);
WriteLn('Back to Bank');
FFlag(0);
Result := True;
end else
FindAllRandoms;
if FindSymbol(x, y, 'bank') then
begin
mouse(x, y, 2, 2, true);
Writeln('Back to Bank');
FFlag(2);
Exit;
end;
begin
Result := False;
Writeln(' Both DDTM and Radial Walks failed tell Griff and blumblebee to fix they re script...politely of course');
FreeDTM(BankDTM);
if not (Result) then
begin
Logout;
exit;
end;
end;
end;
function Banking: Boolean;
var
BankDTM: integer;
begin
WillowDTM := DTMFromString('78DA63FCC4C4C0D0C9C8800A1819FE8349068' +
'6FF40C0C8C08C550D8204D2AC40355308A86104AA994940CD37A0' +
'7BE61050F31AA8A68F0835B3F0AB010040990CF0');
BankDTM := DTMFromString('78DA634C666260A86240017FFE30317001694' +
'620FE0F048C203525A86AFEFD1386AB0101007A1109D6');
begin
MakeCompass('S');
if DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(x - 7, y, 3, 6, true);
Writeln('Found Banker by BankDTM');
FFlag(0);
if FindDTM(WillowDTM,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Wait(350 + Random(500));
Writeln('Banking...');
OpenBankFast('db');
FFlag(0);
Wait(500);
begin
Mouse(x, y, 4, 3, false);
Wait(200 + Random(100));
Deposit(2, 28, true);
FreeDTM(WillowDTM);
FreeDTM(BankDTM);
end;
CloseBank;
Wait(150 + random (250));
MakeCompass('N');
Result := True;
chopped:=chopped+27
wait(500+ Random(200))
end else
begin
Wait(350 + Random(500));
Writeln('Banking...');
OpenBankFast('db');
FFlag(0);
Wait(500);
begin
Mouse(x, y, 4, 3, false);
Wait(200 + Random(100));
Deposit(2, 28, true);
FreeDTM(WillowDTM);
FreeDTM(BankDTM);
end;
CloseBank;
Wait(150 + random (250));
MakeCompass('N');
Result := True;
chopped:=chopped+27
wait(500+ Random(200))
end;
end;
end;
end;
procedure FindBrokenAxe;
var
baxe: integer;
begin
if not (LoggedIn) then
Exit;
if TimeFromMark(baxe) < 1000 then
Exit;
FindNormalRandoms;
MarkTime(baxe);
if (FindBlackChatMessage('You do not')) then
begin
Writeln('Broken Axe...Getting new axe.');
ToBank;
Banking;
end;
end;
function Chopping: Boolean;
var
x : integer;
y : integer;
begin
if not(LoggedIn) then Exit;
Writeln('Chopping Willow trees!');
wait(4000+random(250));
repeat
if not(LoggedIn) then Exit;
If(FindNormalRandoms) or (InvFull) then Exit;
AntiChat;
FindBrokenAxe;
if FindObjTPA(x, y, 4876128, 20, 2, 15, 25, 10, ['illow', 'Willo', 'Willow']) then
begin
Result := True;
Mouse(x, y, 0, 0, false);
ChooseOption('hop')
FindObjTPA(x, y, 4876128, 20, 2, 15, 25, 10, ['illow', 'Willo', 'Willow'])
end;
repeat
FindAllRandoms;
FindBrokenAxe;
AntiBan;
wait(500+random(250));
if (FindEntText(647134)) then
EntsAvoided:=EntsAvoided+1;
FindGainedLevel;
wait(1000+random(175));
Until not IsUpText('Willow') or (InvFull);
AntiChat;
FindAllRandoms;
FindBrokenAxe;
FindGainedLevel;
Until(invfull);
if not (Result) then
begin
Logout;
exit;
end;
end;
procedure ProgressReport;
begin
SRLRandomsReport;
WriteLn('****************************************');
WriteLn('****************************************');
WriteLn(' << << <<Progress Report>> >> >> ');
WriteLn('________________________________________');
Writeln(' Script Ran For ' + TimeRunning);
Writeln(' Willows Chopped ' + IntToStr(Chopped) + ' Log(s)');
Writeln(' Ents Avoided ' + IntToStr(EntsAvoided) );
Writeln(' Gained ' + IntToStr(Lvlups) + ' WC Level(s)' );
writeln('****************************************');
writeln('****************************************');
end;
begin
SetupSRL;
SmartSetupEx(World, True, True, False);
SetTargetDC(SmartGetDC);
BankDTM := DTMFromString('78DA634C666260A86240017FFE30317001694' +
'620FE0F048C203525A86AFEFD1386AB0101007A1109D6');
WillowDTM := DTMFromString('78DA63FCC4C4C0D0C9C8800A1819FE8349068' +
'6FF40C0C8C08C550D8204D2AC40355308A86104AA994940CD37A0' +
'7BE61050F31AA8A68F0835B3F0AB010040990CF0');
Intro;
DeclarePlayers;
if LoggedIn then Logout;
LoginPlayer;
MakeCompass('N');
SetAngle(true);
repeat;
AntiChat;
ToTrees;
Chopping;
if InvFull then
begin
ToBank;
Banking;
ProgressReport;
AntiChat;
done:=done+1;
end;
until(done >= LoadsPerPlayer);
begin
NextPlayer(True);
end;
if not Loggedin then NextPlayer(False);
end.
If you can help or give any advice that would be awsome,