Simba Code:
//It can be used like this
renzanityFindObjrenzanityFindObj(HUE, SAT, WIDTH, HEIGHT, COLOR, TOLERANCE, MOUSE_LEFT, ['MOUSE OVER TEXT'], ['CHOOSE OPTION'], MINIMUM WAIT, MAXIMUM WAIT);
//This finds and clicks the bank
renzanityFindObj(0.84, 0.75, 5, 5, 4269630, 12, MOUSE_LEFT, ['ank'], [''], 100, 200);
//So if you will use the findObj function below, it will look like this
if randomRange(1, 101) <= 50 then
begin
if tabBackPack.countDTM(oreCopperDTM) < 14 then
renzanityFindObj(COPPER_HUE, COPPER_SAT, 10, 10, COPPER_COLOR, COPPER_TOLERANCE, MOUSE_LEFT, ['ine Copper'], [''], 100, 200);
end else
begin
if tabBackPack.countDTM(oreTinDTM) < 14 then
renzanityFindObj(TIN_HUE, TIN_SAT, 10, 10, TIN_COLOR, TIN_TOLERANCE, MOUSE_LEFT, ['ine Tin'], [''], 100, 200);
end;
Simba Code:
{*Simple Object Finder Function*
*From The Mayor's generic object finder*}
function renzanityFindObj(hue, sat: extended; W, H, colour, tolerance, clickType: integer; mouseOverText, chooseOptions: array of string; minWait, maxWait: integer): boolean;
var
i, x, y: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
if (not isLoggedIn()) or (not findColorsSpiralTolerance(x, y, TPA, colour, mainScreen.getBounds(), tolerance, colorSetting(2, hue, sat))) then
exit(false);
mouseSpeed := gaussRangeInt(40, 50); //For a human-like mouse speed movements
ATPA := TPA.cluster(W, H);
ATPA.filterBetween(0, 3);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
smartImage.debugATPA(ATPA);
for i := 0 to high(ATPA) do
begin
case random(5) of
0..3: missMouse(ATPA[i].getBounds().getRandomPoint(), true)
else
mouse(ATPA[i].getBounds().getRandomPoint(), MOUSE_MOVE, MOUSE_HUMAN);
end;
if isMouseOverText(mouseOverText, 170) then
begin
fastClick(clickType);
if clickType = MOUSE_LEFT then
begin
if randomRange(1, 100) <= 50 then
begin
fastClick(clickType);
smallRandomMouse(5 + random(50));
end else smallRandomMouse(5 + random(50));
end;
if clickType = MOUSE_RIGHT then
chooseOption.select(chooseOptions);
smartImage.clearArea(mainScreen.getBounds());
wait(randomRange(minWait, maxWait));
exit(true);
end;
end;
end;