From: Brandon
http://villavu.com/vb/showthread.php?t=85107
It's a bit advanced and I don't feel like breaking it down as it's part of my includes for my members scripts but it works like this:
Find the Colour of the rock itself. that's the brown part of the rock using ACA.
Search the brown rock to Find the Colour of the Iron veins within the brown rock.
That's it. So… Create a TPA of the brown rock, search it for the iron veins. Check Uptext. Mine Rock.
This is basically what I've done here's the code:
unction FindIron: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.17);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 2175062, MMX1, MMY1, MMX2, MMY2, 10);
if (Length(arp) = 0) then
begin
Writeln('Hmm..No rocks available pesky bots!');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 2.01) and (X <= 10.15) and (Y >= 1.67) and (Y <= 8.16) and (Z >= 0.86) and (Z <= 3.75) then
begin
Result := arC[i];
Writeln('FindIron=' + IntToStr(arC[i]));
Break;
end;
end;
end;
function MineOre: Boolean;
var x, y, PlusOne, MineCount :integer;
begin
PlusOne:=InvCount+1;
If FindObj(x, y, 'ron', FindIron, 1) or FindObj(x, y, 'ine', FindIron, 1) or FindObj(x, y, 'Ore', FindIron, 20) or WaitupText('ine ron', FindIron) then
begin
Mouse(x, y,3,3,true);
WaitOption('Mine Iron',500+randomrange(300,500));
writeln('Mining an Iron');
end;
repeat
wait(4050+randomrange(1500,2000));
until not IsUpText('ron') or (InvFull);
case random(1) of
1: Mouse(X, Y, 5, 5, True);
2: begin
Mouse(X, X, 5, 5, False);
WaitOption('Mine Iron', 500+randomrange(300,500));
end;
end;
repeat
Marktime(MineCount);
Antiban;
Wait(200)
If Invcount=Plusone then
Writeln('We got some ore');
Until(InvCount=PlusOne) or (TimeFromMark(MineCount) >5560)
end;
I'm using it in the falador mines and the color of the iron is the same as the walls. That's the problem its moving mouse all over the screen.