I'm trying to make a before and after TPA of the Red MM dots of loot in the Ancient cavern, it should combine the two then delete the duplicate portions leaving only the new loot points. It goes through and sets the loot points and I can tell because of the writeln's, but it doesnt actually have a length because it stops at
Simba Code:
if GetArrayLength(LootTPA[i]) > 0 then
Simba Code:
procedure FightFiends;
Var
BeforeKillTPA, AfterKillTPA: TPointArray;
begin
if not Fighting then
KillFiends;
if Fighting then
begin
BeforeKillTPA := GetMMDotsOnMS('red')
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 Looting2;
var
BeforeKillTPA, AfterKillTPA, 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
if GetArrayLength(LootTPA[i]) > 0 then
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;
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;
Looting2;
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.