SRL Archive - OSR Help

Better method for finding rocks?


Syntax

2012-07-07 03:38:19

Hi guys, I've made an IronMiner that works fairly well. I made my own drop procedure, urn support the only problem I'm having is finding the Ore. I use the FindObject function in ACA but because the colour of the iron is basically identical to the rock in the walls it colours the whole patch in (yes i am using cts 2 :P)
What do you guys recommend i use to find the rocks other than ACA? Also if you could, could you give me a link to the thread?

Brandon

2012-07-07 03:43:36

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.

Syntax

2012-07-07 03:52:04

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.