This is an extract from @
kristi who replied to my thread on banking methods.
The same method can be adapted to find an object that you are wanting to pick pocket.
Simba Code:
program BankFinder;
{$I Aerolib/Aerolib.simba}
type
TBank = record //create a record with the necessary fields
Name : String; //not really necessary but can be used later on to identify the bank
BankCol : TColEx;
countMin, countMax : Integer;
end;
var
VarrockWest : TBank; //declare VarrockWest as a TBank
Procedure ScriptSetup;
begin
with VarrockWest do
begin
Name := 'Varrock West';
BankCol.Create(2379613, 2, 0.08, 3.64);{ create a TColEx,
this automatically creates a CTS2 color and you don't have to deal with
changing back CTS-speed and such, the parameters are (in order) : Color, Tolerance, Hue, Sat.
However, the tolerance is a bit too low, even if it matches in ACA, remember that Runescape
constantly changes colors, try switching worlds and grabbing colors or try to just add a few numbers,
e.g 2 >> 7, as long as it doesn't mess up the results }
countMin := 50; //min count of color (make sure you got the right count!)
countMax := 100; //max count
end;
end;
function TBank.Find(var p:TPoint) : Boolean; //create a general method of finding TBanks
var
i:Integer;
TPA:TPointArray;
ATPA:T2DPointArray;
tmpCTS: integer;
begin
if Self.BankCol.FindAllIn(AREA_MS, TPA) then //if the bankCol TColEx is found in area MS, store the points in TPA
begin
ATPA := ClusterTPAEx(TPA, 5, 5); //you'll have to figure out the right bounds
SortATPaFromMidPoint(ATPA, MSCP); //sort them from mainscreen centre
{
Delete TPA's in that are shorter than our countMin and larger than our countMax (I just chose 10000 as a really big number),
there is probably a fancier way to do this, but you get the point
}
FilterTPAsBetween(ATPA, 0, Self.CountMin);
FilterTPAsBetween(ATPA, Self.CountMax, 10000);
if Length(ATPA) < 1 then Exit; //when filtering and all is done, if the array is empty then no matching points where found, so we can exit
DebugATPA(ATPA, ''); //debug the atpa, will show a debug image with the TPA:s marked in red
for i := 0 to High(ATPA) do
begin
p := ATPA[i].MidPnt;
HumanMMouse(p, 0, 0);
wait(randomRange(60, 120)); //I like to add a wait here so the uptext has time to appear
if isUpText('ank') then
Exit(True);
end;
end;
end;
var
pnt : TPoint;
begin
initAl;
//now to find it just use:
VarrockWest.Find(pnt);
Writeln('found point: ' + toStr(pnt));
end.
The commented fields explain what most of the lines do, but I will try and add a bit more info to it.
Essentially what it does is creates a type called TBank (this can be named anything, like TNPC or TStealFromGuy).
The type has a few variables to it:
Name: Name of our object (not too important)
BankCol: Color of the object that we are wanting to find (you may need to find another way to declare TColEx based on the include you are using).
CountMin: Minimum color count the TPA must have to be considered.
CountMax: Maximum color count the TPA must have to be considered.
This allows us to access the information using Tbank.Variable (Tbank.Name, Tbank.BankCol etc).
The comments can advise you on the functions better than I can. Hope this helps