SCAR Code:
Program MagicCutter;
{By: Jethr0x}
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\WoodCutting.scar}
{
********************************************************************************
********************************************************************************
** By: **
** Jethr0x **
** Magic Tree Cutter **
** Version 0.1 Made for: Sythe.Org **
** SRL-Forums.com **
********************************************************************************
** Notes: **
** 1: Start Player anywhere in Seers Bank **
** 2: You MUST have a rune of dragon axe **
** 3: YOU MUST BE ABLE TO WEILD THE AXE! **
** **
** Features: **
** 1: AntiBan **
** 2: Nice Tree Finding **
** 3: Nice Ent Finding **
********************************************************************************
}
var
x, y, Bankers, Loops, MagicLog,
LogsThisRun, TBanks , LogsT : integer;
procedure DeclarePlayers;
begin
NumberOfPlayers(1);
Players[0].Name := 'RuneScape';
Players[0].Pass := 'gawdimanoobf0rtry1ngthis';
Players[0].Nick := 'une';
Players[0].Active := true;
Players[0].Strings[1]:= 'woodcutting';
{
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active := true;
Players[1].Strings[1]:= 'woodcutting';
}
end;
{*******************************************************************************
Name:
By: Jethr0x
Discription:
*******************************************************************************}
procedure LoadDTMs;
begin
Bankers := DTMFromString('78DA63D4616060506200032608C5F0EFDF3F8' +
'6FF409A1188FF0301A32C902181AAE6CF1F260611A81A10605425' +
'428D01116A4C08AB010088F11196');
MagicLog := DTMFromString('78DA63E46160609060400115F9CE0CFC409A1' +
'1CA6704A9914355A3B5720EAA1A0E202185AA4673D94C54355C40' +
'428480394240828F010D30A2AA910512C204D448020905026A40F' +
'6281150C302246409A8610312A2B8D5FC070200A5590BA0');
end;
{*******************************************************************************
Name: FindTheAxe
By: PriSoner (DTMs) \ Jethr0x
Discription: Checks for the Axe.
*******************************************************************************}
type AllAxes = record
AxeDTM: integer;
AxeName: string;
MinLvl: integer;
AttLvl: integer;
end;
function FindTheAxe : boolean;
var ax, ay, SklWood, SklAtt, ctab, DTMAxe: integer;
i: integer;
AxeList: Array of AllAxes;
begin
SetLength(AxeList, 2);
AxeList[0].AxeDTM := DTMFromString('78DA6314616060E0664001A962BC0CFC409A1' +
'188FF0301231790C1C58006189148202D03243809A81106124204' +
'D430010919FC6A00E8B5053D');
AxeList[0].AxeName := 'Dragon Axe';
AxeList[0].AttLvl := 60;
AxeList[0].MinLvl := 61;
AxeList[1].AxeDTM := DTMFromString('78DA639CCEC4C0F09401051485F1318800694' +
'620FE0F048C4B806AEEA2AA718E4864E082AA0101C6C54035F751' +
'D5D887C6A1AA590A547313558D4B740A8A1A00CFA10E03');
AxeList[1].AxeName := 'Rune Axe';
AxeList[1].AttLvl := 40;
AxeList[1].MinLvl := 41;
ctab := GetCurrentTab;
SklWood := GetSkillInfo('woodcutting',False);
SklAtt := GetSkillInfo('attack', False);
GameTab(4);
DTMAxe := AxeList[i].AxeDTM;
if FindDTM(DTMAxe, ax, ay, 546, 203, 737, 466) then
begin
Writeln('[Setup] You have a ' +AxeList[i].Axename);
if (SklWood >= AxeList[i].MinLvl) and (SklAtt >= AxeList[i].AttLvl) then
begin
Mouse(ax, ay, 0, 0, true);
Result := True;
Exit;
end;
Writeln('[Setup] You Cannot use a ' +AxeList[i].AxeName);
Result := False;
end else
begin
GameTab(5);
if FindDTM(DTMAxe, ax, ay, 546, 203, 737, 466) then
begin
Writeln('[Setup] You are weilding a ' +AxeList[i].AxeName);
Result := True;
end;
end;
end;
function isAxe: boolean;
begin
if Pos('an axe', GetBlackChatMessage) = 17 then
begin
writeln('You don''t have an axe...');
result := false;
end else result := true;
end;
{*******************************************************************************
************************** Auto Coloring Functions *****************************
*******************************************************************************}
function FindTreeSymColor: Integer;
var
R,G,B,TestColor : Integer;
H,S,L : Extended;
X,Y,Z : Extended;
MyColor : Integer;
ColorsTPA : TPointArray;
C1 : TIntegerArray;
i,C2: Integer;
begin
MyColor := 1345034;
FindColorsSpiralTolerance(MSCX, MSCY, ColorsTPA, MyColor, MMX1, MMY1, MMX2,
MMY2, 60);
C1 := GetColors(ColorsTPA);
C2 := High(C1);
for i := 0 to C2 do
begin
if RS_OnMinimap(ColorsTPA[i].X, ColorsTPA[i].Y) then
begin
TestColor := GetColor(ColorsTPA[i].X, ColorsTPA[i].Y);
if SimilarColors(TestColor, MyColor, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -144, -104) then
if InRange(R - B, -30, 10) then
if InRange(G - B, 94, 134) then
if InRange(Round(S) - Round(H), 36, 66) then
if InRange(Round(L) - Round(H), -22, 8) then
if InRange(Round(H) - Round(L), -8, 22) then
if InRange(Round(X) - Round(Y), -15, -1) then
if InRange(Round(Y) - Round(Z), 6, 20) then
if GetColor(ColorsTPA[i].X + 2, ColorsTPA[i].Y + 2)
= TestColor then
if GetColor(ColorsTPA[i].X + 1, ColorsTPA[i].Y + 1)
= TestColor then
begin
Writeln('[AutoColor] TreeSymbol = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('[AutoColor] Could''t find the TreeSymbol Color.');
Result := 0;
end;
function FindMMRockColor: Integer;
var
R,G,B,TestColor : Integer;
H,S,L : Extended;
X,Y,Z : Extended;
MyColor : Integer;
ColorsTPA : TPointArray;
C1 : TIntegerArray;
i,C2: Integer;
begin
MyColor := 6971740;
FindColorsSpiralTolerance(MSCX, MSCY, ColorsTPA, MyColor, MMX1, MMY1, MMX2,
MMY2, 60);
C1 := GetColors(ColorsTPA);
C2 := High(C1);
for i := 0 to C2 do
begin
if RS_OnMinimap(ColorsTPA[i].X, ColorsTPA[i].Y) then
begin
TestColor := GetColor(ColorsTPA[i].X, ColorsTPA[i].Y);
if SimilarColors(TestColor, MyColor, 50) then
begin
ColorToRGB(TestColor, R, G, B);
ColorToHSL(TestColor, H, S, L);
ColorToXYZ(TestColor, X, Y, Z);
if InRange(R - G, -25, 15) then
if InRange(R - B, -34, 6) then
if InRange(G - B, -29, 11) then
if InRange(Round(S) - Round(H), -69, -39) then
if InRange(Round(L) - Round(H), -37, -7) then
if InRange(Round(H) - Round(L), 7, 37) then
if InRange(Round(X) - Round(Y), -8, 6) then
if InRange(Round(Y) - Round(Z), -10, 4) then
if GetColor(ColorsTPA[i].X + 2, ColorsTPA[i].Y + 2)
= TestColor then
if GetColor(ColorsTPA[i].X + 1, ColorsTPA[i].Y + 1)
= TestColor then
begin
Writeln('[AutoColor] RockColor = '+Inttostr(TestColor));
Result := TestColor;
Exit;
end;
end;
end;
end;
Writeln('Couldnt find MM rock color!');
Result := 0;
end;
{*******************************************************************************
***********************| End of Auto Coloring Functions |***********************
*******************************************************************************}
{********************************************************************************
Function TreeWalk(WhatTree: String; x1, y1, x2, y2: Integer) : Boolean;
By: NaumanAkhlaQ
Description: Walks to a tree in a specified area, for use in the MiniMap
Direction: In the string 'WhatTree' the valid arguments are 'RareTree' and 'Tree'
********************************************************************************}
Function TreeWalk(WhatTree: String; x1, y1, x2, y2: Integer) : Boolean;
Var
Tree : array [0..2] of Integer;
i : Integer;
begin
Tree[0] := 2250789;
Tree[1] := 2315315;
Tree[2] := 2442328;
Begin
Case WhatTree of
'Tree': Begin
For i:= 0 to 2 do
If FindColorSpiralTolerance(x,y,Tree[i],x1,y1,x2,y2,48) then
Begin
Writeln('[Walk] Tree Found!')
Result:= True;
Exit;
end else
Writeln('Tree Not Found, Exiting');
NextPlayer(False);
end;
end;
end;
end;
{*******************************************************************************
Name: Sets up the player.
By: Jethr0x
Discription:
*******************************************************************************}
procedure SetupPlayer;
begin
if not FindTheAxe then
begin
writeln('No Axe');
NextPlayer(False);
end else
SetAngle(True);
SetRun(True);
LoadDTMs;
end;
{*******************************************************************************
Name: Walk2Trees.
By: Jethr0x
Discription: Walks to the magic trees using:
-NaumanAkhlaQ's TreeWalk
-My AutoColor
-MouseBox <-- To the south west a bit, if not find magic trees.
*******************************************************************************}
procedure Walk2Trees;
var
RockColor, TreeSymColor : integer;
begin
MakeCompass('N');
{ Walks down to the most southern maple. }
TreeSymColor := FindTreeSymColor;
if (TreeSymColor > 0) then
begin
if RadialWalk(TreeSymColor, 90, 180, 72, 50, 50) then
begin
FFlag(10);
Writeln('[Walk2Trees] At 1st Maple.');
repeat
wait(100);
until(RadialWalk(TreeSymColor, 180, 270, 72, 50, 50))
end;
FFlag(10);
Writeln('[Walk2Trees] At 2nd Maple.');
end;
{ Should Walk To the rocks south of the Yews. }
RockColor := FindRockColor;
if (RockColor > 0) then
begin
if RadialWalk(RockColor, 180, 270, 72, 50, 50) then
begin
Flag;
Writeln('[Walk2Trees] At the rocks south of yews.');
MouseBox(606, 143, 622, 159, 1);
Flag;
end;
end else
Writeln('[Walk2Trees] Since we could not find the rock color... lets use TreeWalk!!!');
if TreeWalk('Tree', 596, 140, 635, 158) then
begin
Mouse(x, y, 1, 1, true);
Flag;
if TreeWalk('Tree', 563, 101, 591, 135) then
begin
Mouse(x, y, 1, 1, true);
Flag;
end;
end;
if RadialWalk(TreeSymColor, 110, 250, 72, 50, 50) then
begin
Writeln('[Walk2Trees] We made it to the magics!');
end else
if not (RadialWalk(TreeSymColor, 110, 250, 72, 50, 50)) then
begin
MouseBox(606, 143, 622, 159, 1);
FFlag(10);
if RadialWalk(TreeSymColor, 170, 310, 72, 50, 50) then
begin
Writeln('[Walk2Trees] We made it to the magics!');
FFlag(10);
SetRun(False);
end else
begin
Writeln('[FATAL] ' + Players[CurrentPlayer].Name + ' could not find magics.');
Logout;
NextPlayer(False);
end;
end;
end;
{*******************************************************************************
Name: Walk2Bank
By: Jethr0x
Discription: Does the exact reverse ad Walk2Trees;
*******************************************************************************}
Procedure Walk2Bank;
var
TreeSymColor : integer;
MMA : Extended;
begin
MakeCompass('S');
LoadDTMs;
MouseBox(606, 143, 622, 159, 1);
Flag;
if TreeWalk('Tree', 596, 140, 635, 158) then
begin
Mouse(x, y, 1, 1, true);
Flag;
if TreeWalk('Tree', 563, 101, 591, 135) then
begin
Mouse(x, y, 1, 1, true);
Flag;
end;
end;
TreeSymColor := FindTreeSymColor;
if (TreeSymColor > 0) then
begin
if RadialWalk(TreeSymColor, 120, 270, 72, 50, 50) then
begin
FFlag(10);
Writeln('[Walk2Trees] At 1st Maple.');
Mouse(627, 85+5, 0, 0, true);
Flag;
repeat
wait(100);
Mouse(627-2, 85+25, 0, 0, true);
Flag;
until(RadialWalk(TreeSymColor, 150, 290, 72, 50, 50))
end;
Flag;
Writeln('[Walk2Trees] At 2nd Maple.');
if(FindDTMRotated(Bankers, x, y, MMX1, MMY1, MMX2, MMY2, -Pi, Pi, 0.1,
MMA)) then
begin
Mouse(x, y, 0, 0, true);
end;
end;
FreeDTM(Bankers);
end;
{*******************************************************************************
Name: FindTree
By: Jethr0x
Discription: Finds the Tree, also does a quick check for ents before it clicks.
*******************************************************************************}
function FindTree:boolean;
var
i: integer;
S: TPoint;
Tree: TPointArray;
begin
if InvFull then Exit;
if not LoggedIn then exit;
FindColorsTolerance(Tree,9095886,MSX1,MSY1,MSX2,MSY2,25);
if length(Tree) = 0 then
begin
FindColorsTolerance(Tree,5143943,10,10,508,325,5);
end;
for i:= 0 to High(Tree)do
begin
if FindNormalRandoms then
begin
FindTree;
end;
S:= Tree[i];
if FindColorTolerance(x,y,9095886,S.X-20,S.Y-20,S.X+20,S.Y+20,30)then
begin
MMouse(S.X,S.Y,4,4);
wait(75+random(25));
GetMousePos(x, y);
FindEnt(x, y, true);
if (Pos('c t',rs_GetUpText) <> 0) then
begin
GetMousePos(x,y);
FindEnt(x, y, true);
result:= True;
Mouse(x,y,0,0,true);
FFlag(0);
if FindNormalRandoms then
begin
FindTree;
end;
Flag;
wait(2000);
if InvFull then Exit;
// if (not (isChatBlackTextAnyLine('wing your'))) then FindTree;
Break;
exit;
end;
end;
end;
end;
{*******************************************************************************
Name: AntiBan;
By: PriSoner.
Discription:
*******************************************************************************}
procedure AntiBan;
var OriginalDegrees: integer;
begin
case random(6) of
0: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
RandomMovement;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
1: begin
Players[CurrentPlayer].Integers[12]:= XpTillNextLevel('woodcutting');
Players[CurrentPlayer].Integers[2] := GetSkillInfo('woodcutting',false);
Players[CurrentPlayer].Integers[3] := (GetXP('woodcutting') - Players[CurrentPlayer].Integers[1]);
end;
2: PickUpMouse;
3: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
BoredHuman;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
4: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
RandomMovement;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
5: begin
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
BoredHuman;
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(true);
end;
end;
end;
{*******************************************************************************
Name: CoordsToDegrees(x,y);
By: Wizzup (Helped Me) \ PriSoner (I got the idea From) \ Jethr0x
Discription: Converts the points it clicks into degrees.
*******************************************************************************}
function CoordsToDegrees(x, y: integer): integer;
var
dx, dy : integer;
degree : double;
begin
dx := x - 260;
dy := y - 160;
degree := ArcTan2(dy, dx) * (180 div Pi) + 90;
if degree < 0 then degree := degree + 360;
result := round(abs(degree - 360) + rs_GetCompassAngleDegrees);
if result >= 360 then result := result - 360;
end;
{*******************************************************************************
function Find2TPApoints(TPA1, TPA2: TPointArray; w, h: Integer): TPointArray;
By: PriSoner
Description: Small function to find two points within different TPA arrays that
fall within a defined distance from each other.
Returns the mid value between every pair of points that match.
TPA1: First TPoint Array
TPA2: Second TPoint Array
w: Width (Maximum Distance points can be apart on the x axis)
h: Height(Maximum Distance points can be apart on the y axis)
*******************************************************************************}
function Find2TPApoints(TPA1, TPA2: TPointArray; w, h: Integer): TPointArray;
var i1, i2, l1, l2, r: LongInt;
begin
l1 := High(TPA1);
l2 := High(TPA2);
r := 0;
for i1 := 0 to l1 do
begin
for i2 := 0 to l2 do
begin
if (ABS(TPA1[i1].x - TPA2[i2].x) <= w) and (ABS(TPA1[i1].y - TPA2[i2].y) <= h) then
begin
Inc(r);
SetLength(Result, r + 1);
result[r].x := ((TPA1[i1].x + TPA2[i2].x) div 2);
result[r].y := ((TPA1[i1].y + TPA2[i2].y) div 2);
end;
end;
end;
end;
{*******************************************************************************
function StrangePlantFinder: Boolean;
By: PriSoner
Description: Finds a strange plant, and attrempts to pick fruit, if it is your
plant, it says so... if not, it says that it is not.
*******************************************************************************}
function StrangePlantFinder: Boolean;
var l, spx, spy, StartSPF, FruitCount, FruitDTM: integer;
TPA1, TPA2, TPA3: TPointArray;
Begin
if not LoggedIn then exit;
result := false
spx := MSCX;
spy := MSCY;
if FindColorTolerance(spx, spy, 945749, MSCX - 100, MSCY - 110, MSCX + 100, MSCY + 90, 4) and FindColorTolerance(spx, spy, 743503, MSCX - 100, MSCY - 110, MSCX + 100, MSCY + 90, 4) then
begin
FindColorsSpiralTolerance(spx, spy, TPA1, 945749, MSX1, MSY1, MSX2, MSY2, 4);
FindColorsSpiralTolerance(spx, spy, TPA2, 743503, MSX1, MSY1, MSX2, MSY2, 4);
SetLength(TPA1, High(TPA1) + 1);
SetLength(TPA2, High(TPA2) + 1);
TPA3 := Find2TPApoints(TPA1, TPA2, 18, 18);
l := High(TPA3);
if l >= 0 then
begin
if FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) then
begin
writeln('Found Strange Plant attempting to Pick fruit.');
FruitDTM := DTMFromString('78DA63E4646060E0654001B30A8E30B001694' +
'620FE0F048CDC400633031A60442281B40090E026A08607488812' +
'50C30A244408A861C67433BA1A008467066B');
FruitCount := CountItemsDtm('inv', FruitDTM);
Result := True;
MarkTime(StartSPF);
repeat
if FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) then
begin
MMouse(spx, spy, 1, 1);
wait(250 + Random(250));
if IsUpText('trange') then
begin
wait(250 + Random(250));
Mouse(spx, spy, 1, 1, false);
wait(250 + Random(250));
ChooseOption('ick');
wait(500 + Random(600));
if Pos('ready to', GetBlackChatMessage) > 5 then wait(2000 + Random(1000)) else //Text: The fruit isn't ready to be picked yet...
if (Pos('fruit from', GetBlackChatMessage) > 5) or (CountItemsDtm('inv', FruitDTM) > FruitCount) then //Text: You pick the fruit from the plant.
begin
result := true;
writeln('Picked Fruit From Strange Plant.. Waiting for plant to die...');
TypeSend('It was mine.');
FreeDTM(FruitDTM);
repeat
BoredHuman;
wait(2000 + random(1000));
until not FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) or FindFight;
Plants := Plants + 1;
SRLRandomsReport;
exit;
end else if Pos('unable', GetBlackChatMessage) > 5 then //Text: You're unable to pick the fruit.
begin
result := false;
writeln('The plant is not after you.. Waiting for plant to go...');
TypeSend('Not mine.');
FreeDTM(FruitDTM);
repeat
BoredHuman;
wait(2000 + random(1000));
until not FindObjTPA(spx, spy, 945749, 4, -1, 18, 18, 4, ['trange']) or FindFight;
exit;
end;
end;
end else break;
until (TimeFromMark(StartSPF) > 120000) or FindFight;
writeln('Failed to Pick Fruit From Strange Plant');
FreeDTM(FruitDTM);
end;
end;
end;
end;
{*******************************************************************************
Name: CheckForAllRandoms
By: PriSoner, changed a LITTLE by Jethr0x
Discription:
*******************************************************************************}
function CheckForAllRandoms: boolean;
begin
if Pos('tch sp', lowercase(GetTalkingNPCName)) > 0 then ClickContinue(true, true);
if FindNormalRandoms then result := true;
if FindInventoryRandoms then result := true;
//FindEnt(fx, fy, true);
if FindNonInventoryRandoms then result := true;
if FindTalk then result := true;
if Pos('arnav', lowercase(GetTalkingNPCName)) > 0 then
begin
Writeln('Player Ended: Unsolvasble random.');
result := false;
exit;
end;
if StrangePlantFinder then result := true;
if FindFight then
begin
RunAway('E', true, 1, 7500);
end;
end;
{*******************************************************************************
Name:
By: Jethr0x
Discription:
*******************************************************************************}
Procedure MakeCompassCoords(x, y : integer);
begin
MakeCompass(IntToStr(CoordsToDegrees(x, y)));
end;
{*******************************************************************************
Name: WaitTillDown
By: Jethr0x
Discription: Contains all of the Chopping procedures:
-TreeFinding
-Waiting
-Random Events
-Ent Finder
-AntiBan
*******************************************************************************}
Procedure WaitTillDown;
var
UpTimes, Mark1, Mark2, cx, cy : integer;
OriginD : extended;
begin
CheckForAllRandoms;
if (FindTree) then
begin
repeat
writeln('[Cut] Tree found at X: ' +IntToStr(x)+ ' Y: ' +IntToStr(y));
Writeln('[Cut] Rotating the screen...');
MakeCompassCoords(x, y);
MMouse(251, 81, 5, 5);
UpTimes := 0;
if IsUpText('ic') then
begin
GetMousePos(x, y);
MMouse(x, y, 0, 0);
end;
if InvFull then Exit;
if IsUpText('c t') then
begin
MarkTime(Mark1);
repeat
CheckForAllRandoms;
case random(10) of
0: begin
if IsUpText('ag') then GetMousePos(x, y);
GameTab(1+random(11));
Wait(2000+random(2000));
GameTab(4);
MMouse(x, y, 0, 0);
end;
1,
2: begin
OriginD := rs_GetCompassAngleDegrees;
case random(2) of
0: begin
KeyDown(VK_LEFT);
wait(random(200));
KeyUp(VK_LEFT);
wait(200);
MakeCompass(IntToStr(round(OriginD)));
wait(200);
end;
1: begin
KeyDown(VK_RIGHT);
wait(random(200));
KeyUp(VK_RIGHT);
wait(200);
MakeCompass(IntToStr(round(OriginD)));
wait(200);
end;
end;
end;
3,
4,
5,
6,
7,
8,
9: begin
if InvFull then Exit;
MMouse(247, 107, 1, 1);
if IsUpText('c t') then
begin
MarkTime(Mark2);
GetMousePos(x, y);
cx := x;
cy := y;
Writeln('**** Stable Magic Tree Found! ****');
repeat
FindEnt(cx, cy, true);
CheckForAllRandoms;
Wait(1000)
until(TimeFromMark(Mark2) > 10000)
end;
end;
end;
until(TimeFromMark(Mark1) > 30000)
end;
if not IsUpText('c t') then WaitTillDown;
until(InvFull);
end;
if not(FindTree) then
begin
if InvFull then Exit;
MakeCompass('W');
RadialWalk(FindTreeSymColor, 1, 359, 72, 60, 60);
wait(5000)
if CheckForAllRandoms then
case random(10) of
0,
1: begin
MakeCompass('S');
wait(100)
MakeCompass('W');
end;
2,
3: begin
SetAngle(False);
wait(10)
SetAngle(True)
end;
4: AntiBan;
5: GameTab(1+random(12));
end;
If CheckForAllRandoms then
wait(5000);
Writeln('[Cut] Waited... lets look now...');
CheckForAllRandoms;
wait(1000);
FTWait(4);
WaitTillDown;
end;
end;
{*******************************************************************************
Name: OpenBankQuiet2
By: Wizzup, customized by Jethr0x
Discription: Opens the bank. Valid Arguements are:
- sv, seers := Seers Village.
- asb, ardy := Ardougne South Bank.
*******************************************************************************}
function OpenBankQuiet2(WhichBank: string): Boolean;
var
TheCounter, dx, dy, tol, Mark2, Mark3: Integer;
acc, accthres : Extended;
begin
case WhichBank of
'asb', 'ardy': TheCounter := BitmapFromString(1, 10, 'beNqLiwgPDQr094wI8oKjlPDgl' +
'LgIEAIAmN4KFA==');
'sb', 'seers' : TheCounter := BitmapFromString(1, 6, 'beNoLs8rKjE1KivBwsvTzsEsNs0' +
'oFADiQBc4=');
end;
MarkTime(Mark3);
tol := 1;
accthres := 0.6;
repeat
if BankScreen or PinScreen then
begin
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
if IsUpTextMultiCustom(['ank', 'Bo', 'ot']) then
begin
GetMousePos(dx, dy);
Mouse(dx, dy, 0, 0, False);
if ChooseOption('uickly') then
begin
MarkTime(Mark2);
repeat
Wait(10);
if TimeFromMark(Mark2) > 20000 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
until BankScreen or PinScreen;
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
end;
FindDeformedBitmapToleranceIn(TheCounter, dx, dy, MSX1 + 50, MSY1 + 50, MSX2
- 50, MSY2 - 50, tol, 4, True, acc);
if (acc >= accthres) then
begin
if BankScreen or PinScreen then
begin
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
MMouse(dx, dy, 0, 0);
if IsUpTextMultiCustom(['ank', 'Bo', 'ot']) then
begin
GetMousePos(dx, dy);
Mouse(dx, dy, 0, 0, False);
if ChooseOption('uickly') then
begin
MarkTime(Mark2);
repeat
Wait(10);
if TimeFromMark(Mark2) > 20000 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
until BankScreen or PinScreen;
end;
Result := True;
FreeBitmap(TheCounter);
Exit;
end;
end;
Wait(100);
tol := tol + 4;
if tol >= 20 then
begin
tol := 1;
accthres := accthres - 0.1;
if accthres < 0.2 then
begin
WriteLn('couldnt find the bank. Exiting');
FreeBitmap(TheCounter);
Exit;
end;
end;
until TimeFromMark(Mark3) > 60000;
FreeBitmap(TheCounter);
end;
Procedure ProgressReport;
var
Money : integer;
begin
LogsT := LogsThisRun + LogsT;
Money := LogsT * 1205;
Writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('|| Jethr0x''s Magic Tree Cutter + Banker ||');
Writeln('||~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~||');
Writeln('|| Banked : '+IntToStr(TBanks)+ ' times ||');
Writeln('|| Magic Logs : ' +IntToStr(LogsT)+ ' ||');
Writeln('|| Made about : ' +IntToStr(Money)+ ' gp. ||');
Writeln('|=============================================');
Writeln('POST THIS | POST THIS | POST THIS | POST THIS');
Writeln('==============================================');
end;
{*******************************************************************************
Name: BankJ
By: Jethr0x
Discription: Opens Bank, Deposites all in inventory.
*******************************************************************************}
procedure BankJ;
begin
Flag;
LogsThisRun := CountItemsDTM('inv', MagicLog);
LogsThisRun := 28;
Writeln('We have ' + IntToStr(LogsThisRun) + ' magic logs in inventory');
repeat
OpenBankQuiet2('sb');
Tbanks := TBanks + 1;
wait(1000)
until(BankScreen)
DepositAll;
ProgressReport;
Exit;
end;
begin
ClearDebug;
SetupSRL;
LogsT := 0;
TBanks := 0;
ActivateClient;
DeclarePLayers;
if not (LoggedIn) then LoginPlayer;
wait(1000)
loops := 0;
SetupPlayer;
repeat
Walk2Trees;
wait(2000);
repeat
WaitTillDown;
wait(1000)
until(InvFull)
Walk2Bank;
repeat
ClearDebug;
BankJ;
wait(1000)
until(false)
loops := Loops + 28;
DisGuise('Banked Successfully: '+IntToStr(Loops)+ ' Log(s)');
until(False)
end.