Kyle Undefined
10-23-2008, 02:00 PM
Yeah, I was using SCAR. Here is the code.
program WillowRemover;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Woodcutting.scar}
const
{================================================= ====}
{ Willow Remover }
{================================================= ====}
{ Script By Quickmarch. }
{ }
{ 1. Put Players In Draynor Bank. }
{ 2. Setup Lines Below. }
{ 3. Drag Crosshair To Runescape Client. }
{ 4. Click Run. }
{ }
{ }
{ }
{================================================= ====}
{ Setup Here }
{================================================= ====}
RunDirection= 'N'; //Run Direction If Attacked.
YourSRLId= '';//Your SRL Stats ID.
YourSRLPassword= '';//Your SRL Stats Password.
{================================================= ====}
{ Declare Your Accounts. }
{================================================= ====}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //username.
Players[0].Pass := ''; //password.
Players[0].Nick := ''; //3-4 letters from your username.
Players[0].Strings[0] := ''; //Bank Pin Number Keep 0000 If You Dont Have One.
Players[0].Booleans[0] := True; //Is Axe Wielded? True If Yes.
Players[0].Integers[0] := 100; //Loads To Do Each Player.
Players[0].Active := True;
end;
{================================================= ====}
{ Edit If You Have Problems. }
{================================================= ====}
function StoneDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 965;
dtmMainPoint.y := 370;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 4671579;
dtmMainPoint.Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[0].x := 965;
dtmSubPoints[0].y := 370;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 4671579;
dtmSubPoints[0].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[1].x := 947;
dtmSubPoints[1].y := 332;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 195836;
dtmSubPoints[1].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[2].x := 955;
dtmSubPoints[2].y := 328;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 195836;
dtmSubPoints[2].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[3].x := 956;
dtmSubPoints[3].y := 319;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[4].x := 961;
dtmSubPoints[4].y := 286;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 794717;
dtmSubPoints[4].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
dtmSubPoints[5].x := 955;
dtmSubPoints[5].y := 327;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := 195836;
dtmSubPoints[5].Tolerance := 110; //Edit Tolerance Or Area If It Does Not Find Stone.
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
{================================================= ======}
{ Script Start. }
{================================================= ======}
var
BrokenDTM, NormalDTM, WillowDTM, BankDTM: integer;
procedure SetupDTMS;
begin
BrokenDTM := DTMFromString('78DA63E4626060E06740019D19420C92409 A1' +
'188FF0301232F90C1CC800618E16AC03C5620214E400D0FA6 5D30' +
'59B81A905DDC04CC110512BC04D488010916FC6A000035065 E');
NormalDTM := DTMFromString('78DA639CC0CCC0709391011934270930480 26' +
'990E87F20609C07547301550D4816A606CC03A9B94C40CD1C A09A' +
'1B04D44C07AAB94240CD64A09AEB04D4F403D53C24A0A60BA 8E61' +
'90135BD40357708A8994084DFA700D59CC3AF060021F015F0 ');
WillowDTM := DTMFromString('78DA63D467616088666440069E4E520C924 01' +
'A24FA1F08184D816A0250D58064616AC03C1BA09A78026A2C 806A' +
'9209A8D100AAC920A04619A82684801A39A09A04026A74816 A82F' +
'1AB0100EBF509F3');
BankDTM := DTMFromString('78DA636C67626008644001FFFFFD63F80FA 41' +
'9416C2060AC01AAF182C8B140D5FCF9C304A619A17CB09A20 4C35' +
'22E86AC2F09B0300F8811153');
end;
procedure Logo;
begin
ClearDebug;
WriteLn(' ________ ');
Wait(100);
WriteLn(' \______ \____________ ___.__. ____ ___________ ');
Wait(100);
WriteLn(' | | \_ __ \__ \< | |/ \ / _ \_ __ \ ');
Wait(100);
WriteLn(' | ` \ | \// __ \\___ | | ( <_> ) | \/ ');
Wait(100);
WriteLn(' /_______ /__| (____ / ____|___| /\____/|__| ');
Wait(100);
WriteLn(' \/ \/\/ \/ ');
Wait(100);
WriteLn(' __ __.__.__ .__ ');
Wait(100);
WriteLn(' / \ / \__| | | | ______ _ __ ');
Wait(100);
WriteLn(' \ \/\/ / | | | | / _ \ \/ \/ / ');
Wait(100);
WriteLn(' \ /| | |_| |_( <_> ) / ');
Wait(100);
WriteLn(' \__/\ / |__|____/____/\____/ \/\_/ ');
Wait(100);
WriteLn(' \/ ');
Wait(100);
WriteLn(' __________ ');
Wait(100);
WriteLn(' \______ \ ____ _____ _______ __ ___________ ');
Wait(100);
WriteLn(' | _// __ \ / \ / _ \ \/ // __ \_ __ \ ');
Wait(100);
WriteLn(' | | \ ___/| Y Y ( <_> ) /\ ___/| | \/ ');
Wait(100);
WriteLn(' |____|_ /\___ >__|_| /\____/ \_/ \___ >__| © ');
WriteLn(' ');
WriteLn(' Created By: Quickmarch ');
Wait(3000); //Delete If You Want.
end;
{------------------------------------------------------------------------------]
function IsUpTextColor(Text: string, Color: Integer): Boolean;
by: ZephyrsFury Edited By: Quickmarch
Description: Checks whether the 'Text' is a color at the top-left corner.
{------------------------------------------------------------------------------}
function IsUpTextColor(s: string; Color: Integer): Boolean;
var
CTS: Integer;
begin
Result := False;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
if (IsUpText(s)) then
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.75);
Result := (CountColorTolerance(Color, 9, 10, 124, 23, 4) > 10);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
ColorToleranceSpeed(CTS);
end;
var
x, y, rx, ry, xp: integer;
procedure SetupScript;
begin
if (not(LoggedIn)) then Exit;
Status('Setting Up Script...');
WriteLn('Setting Up Script...');
MakeCompass('N');
SetAngle(True);
FindAxe;
xp := GetXp('woodcutting');
if (InvFull) then
begin
Status('Banking Stuff.');
WriteLn('Banking Stuff.');
MakeCompass('N');
OpenBank('db', False, False);
Wait(500);
FixBank;
if (Players[CurrentPlayer].Booleans[0] = True) then
Deposit(1, 28, True);
if (Players[CurrentPlayer].Booleans[0] = False) then
Deposit(2, 28, True);
CloseBank;
end;
SetRun(True);
ChatsOff;
end;
var
RanAway, Ents: integer;
procedure AntiRandoms;
begin
FindNormalRandoms;
FindLamp('woodcutting');
if IsUpTextColor('illow', 118478) then
begin
Ents := Ents + 1;
ReportVars[0] := ReportVars[0] + 1;
WriteLn('Found Ent.');
Status('Avoiding Ent...');
Mouse(MMCX - 5, MMCY, 0, 0, True);
SleepAndMoveMouse(30000+random(5000));
Exit;
end;
if (FindFight) then
begin
Status('Running Away...');
WriteLn('Found A Fight.');
RunAway(RunDirection,True,1,20000);
RanAway := RanAway + 1;
ReportVars[1] := ReportVars[1] + 1;
end;
end;
procedure AntiBan; //antiban by quickmarch
begin
case random(10) of
0:begin
HoverSkill('random', False);
AntiRandoms;
Exit;
end;
1:begin
Retaliate(False);
AntiRandoms;
Exit;
end;
2:begin
Retaliate(True);
AntiRandoms;
Exit;
end;
3:begin
GameTab(random(12)+1);
AntiRandoms;
Exit;
end;
4:begin
RandomRClick;
AntiRandoms;
Exit;
end;
5:begin
PickUpMouse;
AntiRandoms;
Exit;
end;
6:begin
HoverSkill('woodcutting', False);
AntiRandoms;
Exit;
end;
end;
end;
procedure WalkToBank;
begin
if (not(LoggedIn)) then Exit;
begin
Status('Searching For Bank...');
MakeCompass('N');
SetAngle(True);
if DTMRotated(StoneDDTM, rx, ry, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(rx, ry, 4, 4, True);
AntiRandoms;
FFlag(0);
if DTMRotated(BankDTM, rx, ry, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Found Bank.');
WriteLn('Found Bank.');
Mouse(rx, ry, 5, 5, True);
AntiRandoms;
Wait(1000+random(1000));
FFlag(0);
Exit;
end else
begin
Status('Searching For Bank...');
MakeCompass('N');
SetAngle(True);
if FindSymbol(rx, ry, 'bank') then
begin
Status('Found Bank.');
WriteLn('Found Bank.');
Mouse(rx, ry, 5, 5, True);
AntiRandoms;
FFlag(0);
Exit;
end else
begin
Status('Searching For Bank...');
MakeCompass('N');
SetAngle(True);
if FindColorTolerance(rx, ry, 11908545, MMX1, MMY1, MMX2, MMY2, 3) then
begin
Status('Found Bank.');
WriteLn('Found Bank.');
Mouse(rx, ry, 5, 5, True);
AntiRandoms;
FFlag(0);
Exit;
end;
end;
end;
end;
end;
end;
procedure WalkToWillows; //walk to willows
begin
if (not(LoggedIn)) then Exit;
MakeCompass('N');
SetAngle(True);
Status('Finding Stone...');
if DTMRotated(StoneDDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Found Stone.');
WriteLn('Found Stone.');
Mouse(x, y, 2, 2, True);
AntiRandoms;
FFlag(0);
SetRun(True);
Exit;
end else
Status('Did Not Find Stone.');
WriteLn('Did Not Find Stone.');
begin
Status('Finding Fishing Symbol.');
MakeCompass('N');
SetAngle(True);
SymbolAccuracy := 0.5;
if FindSymbol(x, y,'fish') then
begin
Status('Found Fishing Symbol.');
WriteLn('Found Fishing Symbol.');
Mouse(x, y, 2, 2, True);
AntiRandoms;
FFlag(0);
SetRun(True);
Exit;
end else
WriteLn('Did Not Find Fishing Symbol.');
Status('Did Not Find Fishing Symbol.');
begin
WriteLn('Using RadialWalk...');
Status('Using RadialWalk...');
RadialWalk(FindWaterColor, 230, 220, 65, 0, 0);
AntiRandoms;
FFlag(0);
Exit;
end;
Status('Error...');
WriteLn('Did Not Find Willows Area.');
Logout;
TerminateScript;
end;
end;
var
Axe, i, Tries: Integer;
function FixAxe(Wield: Boolean): Boolean;
begin
if (FindDTM(BrokenDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) or (FindDTM(NormalDTM, rx, ry, MIX1, MIY1, MIX2, MIY2) = False) then
begin
case Random(10) of
0: TypeSend('AHHHHHHHHHH i hate woodcutting!!!!!1');
1: TypeSend('Stupid Axe...');
2: TypeSend('im so angry!!!!!!!!!!!!!!!111111');
3: TypeSend('awwwwww not my axe again');
4: TypeSend('red: axes....');
end;
WriteLn('Found Broken Axe.');
WalkToBank;
AntiRandoms;
FFlag(0);
OpenBank('db', False, False);
Deposit(1, 28, True);
if (FindDTM(NormalDTM, rx, ry, MSX1, MSY1, MSX2, MSY2)) then
begin
Result := True;
WriteLn('Found Good Axe.');
Mouse(rx, ry, 3, 3, True);
CloseBank;
AntiRandoms;
if (Wield) then
begin
if (FindDTM(NormalDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) then
begin
Status('Wielding Axe...');
WriteLn('Wielding Axe...');
Mouse(rx, ry, 4, 4, True);
if (FindBlackChatMessage('attack')) then
begin
WriteLn('You Do Not Have The Right Level To Wield That Axe.');
Tries := Tries + 1;
FixAxe(True);
ReportVars[2] := ReportVars[2] + 1;
if Tries= 3 then
begin
WriteLn('Could Not Find a Good Axe.');
Logout;
TerminateScript;
end;
end;
end else
begin
WriteLn('Couldnt Find Axe DTM.');
MouseItem(1, True);
if (FindBlackChatMessage('attack')) then
begin
WriteLn('You Do Not Have The Right Level To Wield That Axe.');
Tries := Tries + 1;
FixAxe(True);
ReportVars[2] := ReportVars[2] + 1;
if Tries= 3 then
begin
WriteLn('Could Not Find a Good Axe.');
Logout;
TerminateScript;
end;
end;
end;
end;
WalkToWillows;
end;
end;
end;
function FindWillows: Boolean;
var
x, y, rx, ry: Integer;
TPA: TPointArray;
Time: Integer;
ATPA: T2DPointArray;
begin
if (not(LoggedIn)) then Exit;
Status('Finding Willows...');
AntiRandoms;
MarkTime(Time);
x := MSCX;
y := MSCY;
FindColorsSpiralTolerance(x, y, TPA, 8693935, MSX1, MSY1, MSX2, MSY2, 3);
if Length(TPA) = 0 then FindColorsSpiralTolerance(x, y, TPA, 3231044, MSX1, MSY1, MSX2, MSY2, 3);
ATPA := TPAtoATPAEx(TPA, 50, 50);
for i := 0 to High(ATPA)do
begin
AntiRandoms;
if MiddleTPAEx(ATPA[i], rx, ry) then
MMouse(rx, ry, 4, 4);
if (IsUpTextColor('illow', 13948162)) then
Wait(100+random(100));
AntiRandoms;
begin
GetMousePos(rx, ry);
Mouse(rx, ry, 0, 0, False);
AntiRandoms;
Wait(100+random(200));
Result := ChooseOption('hop');
AntiRandoms;
if Result then
begin
repeat
Status('Chopping Willows...');
AntiRandoms;
Wait(1000+random(1000));
AntiRandoms;
AntiBan;
until(IsUpTextColor('illow', 13948162) = False) or FindBlackChatMessage('an axe');
if (FindBlackChatMessage('an axe')) then
begin
if (Players[CurrentPlayer].Booleans[0] = True) then
begin
GameTab(4);
if (FindDTM(WillowDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) then
begin
Status('Fixing Axe...');
Mouse(rx, ry, 5, 5, False);
Wait(100);
ChooseOption('rop');
end;
GameTab(5);
TakeOff(5);
GameTab(4);
AntiRandoms;
FixAxe(True);
AntiRandoms;
Axe := Axe + 1;
ReportVars[2] := ReportVars[2] + 1;
end;
if (Players[CurrentPlayer].Booleans[0] = False) then
begin
GameTab(4);
if (FindDTM(WillowDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(rx, ry, 5, 5, False);
Wait(100);
ChooseOption('rop');
end;
FixAxe(False);
AntiRandoms;
Exit;
end;
if (TimeFromMark(Time) > 30000) then Exit;
Exit;
end;
if (TimeFromMark(Time) > 30000) then Exit;
Exit;
end;
Wait(350+random(350));
if (TimeFromMark(Time) > 30000) then Exit;
Exit;
end;
end;
end;
var
Loads, Lot2, xp2, xp3: Integer;
procedure MyOpenBank;
begin
if (not(LoggedIn)) then Exit;
MakeCompass('N');
SetAngle(True);
OpenBank('db', True, True);
if (Players[CurrentPlayer].Booleans[0] = True) then
begin
if (PinScreen) then
InPin(Players[CurrentPlayer].Strings[0]);
if (FindDTM(WillowDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) then
begin
Status('Depositing Willows...');
WriteLn('Depositing Willows...');
Mouse(rx, ry, 5, 5, False);
Wait(100);
ChooseOption('ll');
Deposit(1, 28, True);
end;
end;
if (Players[CurrentPlayer].Booleans[0] = False) then
begin
if (PinScreen) then
InPin(Players[CurrentPlayer].Strings[0]);
if (FindDTM(WillowDTM, rx, ry, MIX1, MIY1, MIX2, MIY2)) then
begin
Status('Depositing Willows...');
WriteLn('Depositing Willows...');
Mouse(rx, ry, 5, 5, False);
Wait(100);
ChooseOption('ll');
Deposit(2, 28, True);
end;
end;
CloseBank;
Loads := Loads + 1;
ReportVars[3] := ReportVars[3] + 1;
xp2 := GetXp('woodcutting');
xp3 := xp2 - xp;
ReportVars[4] := xp2 - xp;
ClearDebug;
WriteLn('|======================================== ===============|');
WriteLn('| Willow Remover Report |');
WriteLn('|======================================== ===============|');
WriteLn(' WoodCutting Xp Gained: '+ IntToStr(xp3) +'.');
WriteLn(' Loads Done: '+ IntToStr(Loads) +'.');
WriteLn(' Time Running: '+ TimeRunning +'.');
WriteLn(' Ran Away: '+ IntToStr(RanAway) +'.');
WriteLn(' Ents Avoided: '+ IntToStr(Ents) +'.');
WriteLn(' Broken Axes: '+ IntToStr(Axe) +'.');
WriteLn('|======================================== ===============|');
WriteLn('| Thank You For Using This Script |');
WriteLn('|======================================== ===============|');
Lot2 := Lot2 + 1;
if Lot2=(Players[CurrentPlayer].Integers[0]) then
begin
WriteLn('Done All Loads For That Player.');
if (HowManyPlayers= 1) then
begin
WriteLn('All Players Successfully Finished.');
Logout;
TerminateScript;
end else
NextPlayer(False);
Lot2 := 0;
end;
MakeCompass('N');
SetRun(True);
SRLRandomsReport;
end;
procedure ScriptTerminate;
begin
Status('Terminated.');
FreeDTM(StoneDDTM);
FreeDTM(WillowDTM);
FreeDTM(NormalDTM);
FreeDTM(BrokenDTM);
FreeDTM(BankDTM);
end;
procedure MainLoop;
begin
DeclarePlayers;
Loginplayer;
SetupScript;
repeat
WalkToWillows;
repeat
FindWillows;
until(InvFull);
if (InvFull) then
WriteLn('Inventory Full.');
WalkToBank;
MyOpenBank;
until(PlayersActive = 0);
end;
begin
ScriptID := '1061'; //DO NOT TOUCH!!!
Disguise('Willow Remover');
Logo;
SRLId := YourSRLId;
SRLPassword := YourSRLPassword;
SetupDTMS;
SetupSRL;
ActivateClient;
MainLoop;
end.
{================================================= ======}
{ End Script. }
{================================================= ======}
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.