Simba Code:
function SearchInvColor(Color, Tol: Integer; Hue, Sat: Extended; StartInvBox, EndInvBox: Integer): Boolean;
var
I, x, y, tmpCTS: integer;
invPattern: TIntegerArray;
slotBox:TBox;
begin
tmpCTS:= GetColorToleranceSpeed;
ColorToleranceSpeed(2); //searches using CTS 2
SetColorSpeed2Modifiers(Hue, Sat); //Hue and Sat modifiers
invPattern := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]; //the pattern it searches in
Writeln('Checking for colors in your Inventory.');
for I:= (StartInvBox) to (EndInvBox) do
begin
slotBox:= InvBox(invPattern[I]);
//Writeln('Checking item colors in InvBox['+IntToStr(invPattern[I])+']');
if (not FindColorTolerance(x, y, Color, slotBox.x1, slotBox.y1, slotBox.x2, slotBox.y2, Tol)) then
begin
Writeln('Could not find the color in InvBox['+IntToStr(invPattern[I])+']!');
Result:= false; // Could not find color
Exit; // Comment this line if you want
end;
end;
SetColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Result:= true;
end;