King
2013-04-20 02:32:42
9 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
Pascal/C##/Java
Are you a member of any other communities?
Sythe, Tribot, Powerbot
Tell us about yourself…
From: King
Hey all, my name is Thomas, recently 17. I was born in Jackson Michigan. I love coding, drawing, and baseball. Im hoping to go to Eastern University in Pre-med with my major in Bio-medicine minor in business to become an orthopedic surgeon. I love the friendly community here and would love to stay for many more years and see it grow!
E* Fixed ring detection to use my own TPA/ATPA finding function, implemented location check failsafe (Walks back if Fiends not found in 10 tries) Added DTM item finding for most screens
Please show us one (or multiple) of your scripts.
program KingsWaterFiends;
{$DEFINE SMART8}
{$I SRL/SRL.simba}
{$I SPS/SPS.simba}
{$I SRL/SRL/skill/prayer.simba}
{$i SRL/srl/misc/smartgraphics.simba}
{.Include SRL\SRL\Misc\Debug.simba}
{$i SRL-OSR/SRL/misc/MouseHandler.simba}
{$i su_surfaces.simba}
var
Status: string;
x, y, fx, fy: Integer;
Shark, Rocktail, PrayerFlask, PrayerPotion, BunyipPouch, CharmingIMP: Integer;
GoToBank: Boolean;
obj_fairyring: TSurfaceObject;
BeforeKillTPA, AfterKillTPA: TPointArray;
const
//--------------------User Settings-------------------------------------//
Debug = True; //Set to True if you are editing
FoodAmount = 15; //Amount of Food to bring
FoodType = 'Shark'; //Name of food to bring, Only supports Shark and Rocktail atm!
FoodBound = '='; //Key on the action bar the food is bound too
PrayerPotAmount = 1; //Amount of prayer potions to bring
PType = 'Flask'; //Flask or potion?
Prayer = False; //Use quick prayer?
RangeBooster = False; //Bring other potions?
RangeBoosterName = 'Ranging potion';// Name of potion as written in runescape
BoosterAmount = 1; //Amount of other potions to bring?
LevelToRepotAt = 99; //When to repot?
LevelBoosted = 'Range'; //What level to look for repot level
HpToEatAt = 4000; //When do we want to eat?
TimeToRun = 4; //In hours
UseCharmingImp = True;// True if you are using, False if you are not
//--------------------End User Settings-------------------------------------//
procedure DeclarePlayers;
var
FileNum: integer;
s: string;
usrInfo: TStringArray;
begin
FileNum := OpenFile('C:\acc.txt', true); // Got the Idea from Football
ReadFileString(FileNum, s, FileSize(FileNum));
CloseFile(FileNum);
usrInfo := Explode(chr(10), s);
NumberOfPlayers(1);
CurrentPlayer := 0;
with Players[0] do
begin
Name := usrInfo[0];
Pass := usrInfo[1];
Pin := usrInfo[2];
Active := True;
end;
end;
function WalkToCaveRing: Boolean;
var
ToCaveRing: TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER, ['ANCIENT_CAVERN']);
ToCaveRing := [Point(141, 252), Point(124, 247), Point(110, 237), Point(92, 236), Point(81, 232), Point(72, 227)];
if SPS_WalkPath(ToCaveRing) then
begin
result := true;
Status := 'Walked to the ring';
if debug then
writeln(status);
exit;
end
else
begin
result := false;
Status := 'Did not walk to cave ring, stopping.';
if debug then
writeln(status);
Logout;
TerminateScript;
end;
end;
function LocationCheck: Boolean;
var
MyLoc, StartingLoc: TPoint;
begin
SPS_Setup(RUNESCAPE_OTHER, ['ANCIENT_CAVERN']);
Result := false;
MyLoc := SPS_GetMyPos;
StartingLoc := point(85, 230);
if Distance(myloc.x, myloc.y, startingloc.x, startingloc.y) > 50 then
begin
result := true;
status := 'Relocated';
if debug then
writeln(status);
WalkToCaveRing;
exit;
end
else
begin
status := 'Close enough still';
if debug then
writeln(status);
exit;
end;
end;
procedure DeclareDTMz;
begin
Shark := DTMFromString('mlwAAAHicY2dgYJjIxMDQAcQ9QDwLiJcA8VwoX4KRgUEaiDmBWBmKuYFYBYirUoKAupmwYmUG3IARD4YCAPHlBkA=');
Rocktail := DTMFromString('mggAAAHicY2NgYFgHxPOBeDsQrwDizUC8GoiVgVgXiKWgWA2INYG4o6KagQNIcwMxiOYFYjYgVmTADhhxYAgAAKkYBrQ=');
PrayerFlask := DTMFromString('mwQAAAHic42RgYDjIxMBwCIi3A/EpID4OxDug+CRUrpWRgaGUEUK3AHEtENcDcQ8QdwPxBCA2XFoFNI0JL1ZmIAwYicBwAADRlg0d');
PrayerPotion := DTMFromString('mlwAAAHicY2dgYDjIxMBwAIq3A/EpIN4JxMeAuJWRgaEUiCcAcTcQdwFxDRQbLq0C6mbCipUZcANGPBgKANdLCns=');
BunyipPouch := DTMFromString('mrAAAAHic42BgYDjABMGbgPg8EJ8A4p1AvBWIzwKxGCMDgwojhJYCYg4gZgdiBSBWBGIvL0OgKUw4sRwDfsBIAMMAAGekB9g=');
CharmingIMP := DTMFromString('mrAAAAHic42BgYHBlYmCwAGIbILZkgvCdgNgbiqUZGRh4oFgMiAWBWA6IJYFYGYgXWxoBTWHCieUY8ANGAhgGAB61BCY=');
end;
procedure FreeDTMz;
begin
FreeDTM(Shark);
FreeDTM(Rocktail);
FreeDTM(PrayerFlask);
FreeDTM(PrayerPotion);
FreeDTM(BunyipPouch);
FreeDTM(CharmingIMP);
end;
function FindArrow: Boolean;
var
tmpCTS: integer;
ArrowTPA: TPointArray;
begin
Result := False;
if not LoggedIn then
exit;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(1.88, 1.16);
if FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16) then
Result := True;
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
function Fighting: Boolean;
begin
if not LoggedIn then
exit;
if not (GetCurrentTab = tab_Combat) then
begin
GameTab(tab_Combat);
wait(RandomRange(1000, 1200));
end
else if FindArrow then
begin
writeln('We still have a target');
Result := True;
exit;
end
else
begin
Result := False;
writeln('No longer fighting');
exit;
end;
end;
function FairyScreen: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L, X, Y: Integer;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.18);
if InvFull then
Exit;
if FindColorsSpiralTolerance(x, y, TPA, 3948686, MSX1, MSY1, MSX2, MSY2, 14) then
begin
ColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
ATPA := TPAtoATPAEx(TPA, 40, 40);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
if debug then
DebugATPA(ATPA, '');
L := High(ATPA) for i := 0 to L do
if GetArrayLength(ATPA[i]) >= 25 then
begin
status := 'Found fairy screen';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
status := 'Did not find fairy screen';
if debug then
writeln(status);
result := false;
exit;
end;
end
else
begin
ColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
end;
function FindFairyScreen: Boolean;
begin
if FairyScreen then
begin
status := 'At fairy screen';
if debug then
writeln(status);
Result := true;
exit;
end
else
begin
status := 'Not at fairy screen';
if debug then
writeln(status);
result := false;
exit;
end;
end;
function PickLocation: Boolean;
begin
if FindFairyScreen then
begin
AL_HumanMMouse(point(53, 222), 2, 2);
ClickMouse2(true);
wait(RandomRange(1800, 2200));
AL_HumanMMouse(point(206, 216), 2, 2);
ClickMouse2(true);
wait(RandomRange(1800, 2200));
AL_HumanMMouse(point(371, 217), 2, 2);
ClickMouse2(true);
wait(RandomRange(1800, 2200));
AL_HumanMMouse(point(260, 284), 2, 2);
ClickMouse2(true);
wait(RandomRange(1800, 2200));
result := true;
status := 'Picked the location';
if debug then
writeln(status);
exit;
end
else
begin
result := false;
status := 'Fairy ring screen is not open';
if debug then
writeln(status);
TerminateScript;
end;
end;
function FindCaveFloor: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L, X, Y: Integer;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(12.50, 0.27);
if InvFull then
Exit;
if FindColorsSpiralTolerance(x, y, TPA, 3618613, 606, 24, 682, 134, 25) then
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.02);
ATPA := TPAtoATPAEx(TPA, 200, 200);
SortATPAFrom(ATPA, Point(MMCX, MMCY));
if debug then
DebugATPA(ATPA, '');
L := High(ATPA) for i := 0 to L do
if GetArrayLength(ATPA[i]) >= 5 then
begin
status := 'Found cave floor';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
status := 'Did not find cave floor';
if debug then
writeln(status);
result := false;
exit;
end;
end
else
begin
ColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
end;
procedure Init();
begin
SMART_ClearMS();
CreateSurfaceParts(obj_fairyring, 2);
with obj_fairyring do begin
parts[0].c := 13953702;
parts[0].hm := 0.03;
parts[0].sm := 3.28;
parts[0].t := 12;
parts[0].minw := 50;
parts[0].maxw := 75;
parts[0].minh := 50;
parts[0].maxh := 75;
parts[0].step := 32;
parts[0].max_distance := 999;
parts[1].c := 4344898;
parts[1].hm := 0.31;
parts[1].sm := 0.16;
parts[1].t := 12;
parts[1].filter := @SurfaceFilterClosest; // We want to have the closest fairy ring next to us.
parts[1].minw := 10;
parts[1].maxw := parts[0].maxw;
parts[1].minh := 10;
parts[1].maxh := parts[0].maxh;
parts[1].step := 32;
parts[1].max_distance := parts[0].max_distance;
name := 'Fairy ring';
uptext := 'Fairy';
filter := @SurfaceFilterClosest;
end;
end;
function FindZanarisFloor: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L, X, Y: Integer;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.09, 0.75);
if InvFull then
Exit;
if FindColorsSpiralTolerance(x, y, TPA, 5992015, MMX1, MMY1, MMX2, MMY2, 6) then
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.02);
ATPA := TPAtoATPAEx(TPA, 40, 40);
SortATPAFrom(ATPA, Point(MMCX, MMCY));
if debug then
DebugATPA(ATPA, '');
L := High(ATPA) for i := 0 to L do
if GetArrayLength(ATPA[i]) >= 150 then
begin
status := 'Found Zanaris floor';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
status := 'Did not find Zanaris floor';
if debug then
writeln(status);
result := false;
exit;
end;
end
else
begin
ColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
end;
function AtCave: Boolean;
begin
if FindCaveFloor then
begin
status := 'At the cave';
if debug then
writeln(status);
Result := true;
exit;
end
else
begin
status := 'Not at the cave';
if debug then
writeln(status);
result := false;
exit;
end;
end;
function AtZanaris: Boolean;
begin
if FindZanarisFloor then
begin
status := 'At Zanaris';
if debug then
writeln(status);
Result := true;
exit;
end
else
begin
status := 'Not at Zanaris';
if debug then
writeln(status);
result := false;
exit;
end;
end;
function UseFairyRing: Boolean;
begin
if ClickSurfaceObject(obj_fairyring, true) then
begin
while IsMoving do
wait(RandomRange(25, 50));
MarkTime(x);
repeat
wait(RandomRange(25, 55));
until ((TimeFromMark(x) >= 20000) or FindFairyScreen);
if FindFairyScreen then
begin
if PickLocation then
begin
MarkTime(x);
repeat
wait(RandomRange(25, 55));
until (AtCave or (TimeFromMark(x) >= 25000));
if AtCave then
begin
result := true;
status := 'Taveled to the cave';
if debug then
writeln(status);
exit;
end
else
begin
result := false;
status := 'Did not use the fairy ring correctly, exiting..';
if debug then
writeln(status);
TerminateScript;
end;
end;
end;
end
else
begin
result := false;
status := 'Could not find the fairy ring';
if debug then
writeln(status);
TerminateScript;
end;
end;
function CheckFood: Boolean;
var
FoodCount: Integer;
begin
case Lowercase(FoodType) of
'shark':
begin
FoodCount := CountItems('dtm', shark, []);
writeln(IntToStr(FoodCount) + 'Shark in inventory');
Result := (FoodCount > 5);
exit;
end;
'rocktail':
begin
FoodCount := CountItems('dtm', Rocktail, []);
writeln(IntToStr(FoodCount) + 'Rocktail in inventory');
Result := (FoodCount > 5);
exit;
end;
end;
end;
function CheckPrayerPotions: Boolean;
var
PotionCount: Integer;
begin
case Lowercase(PType) of
'flask':
begin
PotionCount := CountItems('dtm', PrayerFlask, []);
if debug then
writeln(IntToStr(PotionCount) + 'Flask in inventory');
Result := (PotionCount >= PrayerPotAmount);
exit;
end;
'potion':
begin
PotionCount := CountItems('dtm', PrayerPotion, []);
if debug then
writeln(IntToStr(PotionCount) + 'Potions in inventory');
Result := (PotionCount >= PrayerPotAmount);
exit;
end;
end;
end;
function ImpPresent : boolean;
begin
result := FindDTM( x, y, CharmingIMP, MIX1, MIY1, MIX2, MIY2);
end;
function NeedToBank: Boolean;
begin
if not (CheckFood) then
if UseCharmingImp then
if not ImpPresent then
begin
result := true;
GoToBank := true;
end;
end;
function FindWaterFiend: Boolean;
var
x, y, I, failcount: integer;
FiendTPA: TPointArray;
FiendATPA: T2DPointArray;
begin
Result := False;
failcount := 0;
repeat
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.23, 1.80);
if FindColorsSpiralTolerance(x, y, FiendTPA, 5653788, 45, 45, 499, 242, 10) then
begin
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
if Length(FiendTPA) < 5 then
begin
writeln('Could not find Fiend, exiting');
Inc(failcount);
if failcount > 10 then
LocationCheck;
end;
FiendATPA := TPAToATPAEx(FiendTPA, 10, 20);
SortATPASize(FiendATPA, true);
SortATPAFromMidPoint(FiendATPA, point(MSCX, MSCY));
for I := 0 to High(FiendATPA) do
if GetArraylength(FiendATPA[i]) > 10 then
begin
MiddleTPAEx(FiendATPA[i], x, y);
AL_BrakeMMouse(point(x, y), 2, 2, false);
if WaitUpTextMulti(['Water', 'fiend', 'Waterfiend'], 250) then
begin
AL_FastClick(1);
GetMousePos(fx, fy);
MarkTime(x);
repeat
wait(RandomRange(50, 60));
until (Fighting or (TimeFromMark(x) >= 2500));
if Fighting then
begin
Status := 'Fighting Fiend';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
Status := 'Could not find the Fiend uptext';
if debug then
writeln(status);
Inc(failcount);
if failcount > 10 then
begin
LocationCheck;
exit;
end;
end;
end
else
begin
Status := 'Could not find the Fiend uptext';
if debug then
writeln(status);
Inc(failcount);
if failcount > 10 then
begin
LocationCheck;
exit;
end;
end;
end
else
begin
Status := 'Could not find the Fiend';
if debug then
writeln(status);
Inc(failcount);
if failcount > 10 then
begin
LocationCheck;
exit;
end;
end;
end
else
begin
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
until ((failcount >= 10));
end;
function WalkToRing: Boolean;
var
ToRing: TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER, ['zanaris']);
ToRing := [Point(123, 138), Point(131, 143), Point(140, 147), Point(152, 154), Point(163, 159), Point(172, 162), Point(181, 166), Point(193, 171), Point(204, 178), Point(213, 183), Point(224, 192), Point(229, 200), Point(232, 210), Point(232, 222), Point(230, 231), Point(224, 237)];
if SPS_WalkPath(ToRing) then
begin
while ismoving do
wait(RandomRange(25, 45));
Status := 'At the ring';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
Status := 'Did not walk to the fairy ring';
if debug then
WriteLn(status);
TerminateScript;
end;
end;
function WalkToBank: Boolean;
var
ToBank: TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER, ['zanaris']);
ToBank := [Point(230, 213), Point(226, 194), Point(224, 187), Point(218, 183), Point(207, 177), Point(197, 176), Point(187, 175), Point(170, 173), Point(159, 169), Point(147, 161), Point(142, 154), Point(137, 144), Point(135, 141), Point(130, 139), Point(127, 138), Point(126, 138)];
if SPS_WalkPath(ToBank) then
begin
Status := 'At the bank';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
Status := 'Did not walk to the bank';
if debug then
WriteLn(status);
TerminateScript;
end;
end;
function ExitCave: Boolean;
begin
if WalkToCaveRing then
begin
if UseFairyRing then
if AtZanaris then
begin
status := 'Exited the cave';
if debug then
writeln(status);
result := True;
exit;
end
else
begin
status := 'Exited the cave';
if debug then
writeln(status);
result := false;
Logout;
TerminateScript;
end;
end;
end;
function GetToBank: Boolean;
begin
if AtCave and NeedToBank then
begin
if ExitCave then
begin
if WalkToBank then
begin
Result := true;
status := 'Got to the bank';
if debug then
writeln(status);
exit;
end
else
begin
Result := false;
TerminateScript;
end;
end;
end;
if not AtCave and NeedToBank then
begin
if WalkToBank then
begin
Result := true;
status := 'Got to the bank';
if debug then
writeln(status);
exit;
end
else
begin
Result := false;
TerminateScript;
end;
end;
end;
function OpenBankSRLKing: Boolean;
var
TPA: TPointArray;
ATPA: T2DPointArray;
i, L, X, Y: Integer;
R: TPoint;
begin
while IsMoving do
wait(RandomRange(25, 45));
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.24, 0.60);
if InvFull then
Exit;
if FindColorsSpiralTolerance(x, y, TPA, 9872302, MSX1, MSY1, MSX2, MSY2, 4) then
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.02, 0.02);
ATPA := TPAtoATPAEx(TPA, 20, 10);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
if debug then
DebugATPA(ATPA, '');
L := High(ATPA) for i := 0 to L do
if GetArrayLength(ATPA[i]) > 50 then
begin
R := MiddleTPA(ATPA[i]);
AL_HumanMMouse(point(r.x, r.y), 0, 0);
if WaitUptext('ank', 350) then
begin
ClickMouse2(false);
wait(RandomRange(250, 300));
ChooseOption('ank');
MarkTime(x)
repeat
wait(RandomRange(25, 45));
until (BankScreen or (TimeFromMark(x) >= 20000));
if BankScreen then
begin
result := true;
exit;
end
else
begin
result := false;
exit;
end;
end;
end;
end
else
begin
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.02);
end;
end;
function AtBank: boolean;
begin
Result := FindSymbolIn(x, y, Symbol_Bank, 550, 10, 700, 150) and (Distance(x, y, 627, 84) <= 30);
end;
function OpenZBank: Boolean;
begin
if OpenBankSRLKing then
begin
if PinScreen then
InPin(Players[0].Pin);
if BankScreen then
begin
status := 'Bank Open' if debug then
writeln(status);
result := true;
exit;
end
else
begin
status := 'Could not open bank' if debug then
writeln(status);
result := false;
TerminateScript;
end;
end;
end;
function WithdrawCustom(Item: string; ATW, TimeToWait: Integer): Boolean;
var
StartingInvCount: Integer;
begin
result := false;
StartingInvCount := InvCount;
SearchBank(Item);
wait(RandomRange(600, 722));
Withdraw(0, 0, ATW);
MarkTime(x);
repeat
wait(RandomRange(25, 30));
until ((TimeFromMark(x) >= TimeToWait) or (InvCount > StartingInvCount));
if (InvCount <= StartingInvCount) then
begin
result := false;
Status := 'Could not find' + Item;
if debug then
writeln(status);
TerminateScript;
end;
end;
function DoBanking: Boolean;
begin
result := false;
while IsMoving do
wait(RandomRange(25, 45));
if BankScreen then
begin
if BankScreen then
Deposit(1, 22, 1);
if UseCharmingIMP then
WithdrawCustom('Charming imp' , 1, 25000);
if Prayer then
WithdrawCustom('Prayer' + PType + '(4)' , PrayerPotAmount, 25000);
if RangeBooster then
WithdrawCustom(RangeBoosterName + '(4)' , BoosterAmount, 25000);
WithdrawCustom(FoodType , FoodAmount, 25000);
if CloseBank then
if not BankScreen then
begin
result := true;
Status := 'Banked';
if Debug then
writeln(status);
exit;
end;
end
else
begin
result := False;
Status := 'Couldnt Bank';
if Debug then
writeln(status);
TerminateScript;
end;
end;
function KillFiends: Boolean;
begin
if FindWaterFiend then
begin
BeforeKillTPA := GetMMDotsOnMS('red');
MarkTime(x);
repeat
wait(RandomRange(50, 75));
until ((TimeFromMark(x) >= 2500) or Fighting);
if Fighting then
begin
Status := 'Fighting Fiend';
if debug then
writeln(status);
result := true;
exit;
end
else
begin
Status := 'Not Fighting Fiend';
if debug then
writeln(status);
result := false;
exit;
end;
end;
end;
function Eating: Boolean;
var
currentHP: integer;
colorsign: string;
begin
if not LoggedIn then
exit;
CurrentHP := GetMMLevels('hp', colorsign);
wait(RandomRange(50, 150));
if CurrentHP < HpToEatAt then
begin
SendKeys(FoodBound, 50, 5);
begin
MarkTime(x);
repeat
wait(RandomRange(30, 60));
until ((CurrentHP < GetMMLevels('hp', colorsign)) or (TimeFromMark(x) >= 15000));
if GetMMLevels('hp', colorsign) > HpToEatAt then
begin
Result := True;
exit;
end
else
begin
if (GetMMLevels('hp', colorsign) < 2000) then
begin
Result := false;
GoToBank := True;
writeln('Banking because we are out of food and low on health');
exit;
end;
end;
end;
end;
end;
procedure FightFiends;
begin
if not Fighting then
KillFiends;
if Fighting then
begin
writeln('getting before kill TPA');
MarkTime(x);
repeat
Eating;
wait(RandomRange(150, 260));
until ((TimeFromMark(x) >= 45000) or not Fighting);
wait(RandomRange(5000, 6000));
AfterKillTPA := GetMMDotsOnMS('red');
writeln('getting after kill TPA');
wait(RandomRange(250, 300));
end;
end;
Procedure Looting;
var
LootTPA: TPointArray;
L, i:integer;
LootPoint: TPoint;
begin
writeln('looting');
LootTPA := combinetpa(BeforeKillTPA, AfterKillTPA)
cleardoubletpa(LootTPA);
L := High(LootTPA) for i := 0 to L do
begin
writeln('looting2');
LootPoint := MMToMSEx(0, 2, LootTPA[i]);
MMouse(LootPoint.x, LootPoint.y, 1, 1);
ClickMouse2(False);
if WaitOptionMulti(['ater orb', 'Rune helm', 'eaweed', 'attlestaff', 'eath rune', 'charm', 'Snape'], 350) then
begin
FFlag(1);
While IsMoving Do Wait(RandomRange(25, 50));
exit;
end;
end;
SetArrayLength(BeforeKillTPA, 0);
SetArrayLength(AfterKillTPA, 0);
end;
begin
SetupSRL;
DeclarePlayers;
MouseSpeed := 25;
DeclareDTMz;
AddOnTerminate('FreeDTMz');
Init;
repeat
if not LoggedIn then
begin
LogInPlayer;
wait(RandomRange(1000, 6000));
end;
if not NeedToBank and AtCave then
begin
repeat
FightFiends;
Looting;
until (GoToBank);
end;
if AtBank and NeedToBank then
begin
OpenZBank;
DoBanking;
end;
if not AtBank and NeedToBank then
begin
GetToBank;
OpenZBank;
DoBanking;
end;
if not NeedToBank and not AtCave then
begin
WalkToRing;
UseFairyRing;
end;
until (False);
end.E* updated looting method, fighting and small minor tweaks, no longer supports dramen staff ( did the quest)