I am trying to make a combat looting procedure. This is what I have so far...
Simba Code:
function Loot: Boolean;
var
CTS: Integer;
TPA, Player_TPA: TPointArray;
ATPA: array of TPointArray;
begin
if (not (LoggedIn)) then
Exit;
Player_TPA := TPAFromBox(IntToBox(245, 130, 285, 195));
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.40, 3.26);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 13949677, MSX1, MSY1, MSX2, MSY2, 10) then
begin
TPA := ClearTPAFromTPA(TPA, Player_TPA);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
RAaSTPA(TPA, 5);
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPAFromFirstPoint(ATPA, Point(MSCX, MSCY));
DeBugATPABounds(ATPA);
for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
HumanMMouse(x, y, 5, 5);
Writeln(GetUpText);
if WaitUpText('Take', 400) then
begin
Writeln('UpText match');
ClickMouse2(False);
if ChooseOption('charm') then
Result := True;
Exit;
end
else
begin
writeln('No charm');
Exit;
end;
end;
end;
end;
The function searches for the bone color and if it finds the bone color it right clicks and searches for option charm.
This works, but after it takes the charm I search again to look for another pile but it searches the same pile. Should I remove that point from the TPA once its been searched or what? This is my first combat script and first try at looting.