SRL Archive - Help and Support

TPA Issues


EtherFreak

2012-03-04 01:03:30

So I am working on a mining procedure with tpa's. I am trying the findcolorstolerence, and the findcolorsspiraltolerance, which both are working fine to find Adamantium rocks, but this does not seem to work for coal rocks whatsoever. I also am having issues with the FindObjEx for coal mining.

Colors that I am trying
526344
1579032

I am getting a return of an empty TPA even though I select the colors from the rock, and I have the tolerance at a reasonable level. Like I say, it works fine for addy rocks with a color of 7043947

Procedure Mine3(RockerCol: integer; RockerTxt: string);
Var
TPA:TPointArray;
TPAPoint : TPoint;
ATPA:T2DPointArray;
i:integer;
Begin
mousespeed:=(7+random(3));
FindColorsSpiralTolerance(MSCX,MSCY,TPA, RockerCol, MSX1, 40, MSX2,MSY2,6);//7043947 is addy rock color 526344 is coal
writeln(TPA);
for i:=0 to high(TPA) do
begin
TPAPoint := TPA[i]
writeln(High(TPA));
mmouse(TPAPoint.x,TPAPoint.y,1,1);
wait(300+random(100));
if isuptext(RockerTxt) then
begin
Mouse(x,y,1,1,true);
exit;
end else
writeln('failed mining');
end;
writeln('failed comp');
End;

Procedure Mine1;
Begin
if findobjex(x,y,['Coal','oal'],[526344],3,45,220,140,MSX2,240) then
begin
mmouse(x,y,4,4);
writeln('found possable coal');
wait(200+random(100));
end;
if isuptext('oal') then
mouse(x,y,1,1,true) else
writeln('failed mining');
End;

YoHoJo

2012-03-04 01:11:30

After your FindColorsSpiralTolerance line put
DebugTPA(RockerCol,'');

That will pop up a screen with colors/debug over all colors found, that way you can find out/see what colors (if any) are even found.

Two suggestions:
Learn to use ACA to get WAY MORE accurate with color finding.
Check out my tut here:
http://youtu.be/98wVrr6GwyU
Use Color Tol Speed 2 its so much more accurate!

Also, learn to use ATPAs too (Basically, it breaks the TPA up into multiple TPA with Width X and Height Y) you can then check each ATPA for a minimum pixel check to see if it's good or not.

Ex: You get RockerColor, break it into ATPA RockerColorBox with width X heigh appx 25X25, then check if in each box at least ~15 pixels of color is found, if so, then check it out! :D

EtherFreak

2012-03-04 01:35:27

I am planing on using atpa's once finished, but if it cannot find the darn rock to begin with(writeln(tpa) gives this [] for the coal color, which is an empty tpa). but it will generate a full list for the addy. the debug tpa does not work as well. it brings up a box that displays nothing, whereas for the addy rocks, it brings up a window showing the red where it found the color (like it is supose to).

I know the atpa is great, it worked great for my tree cutter, and old mining procedure (which I lost due to a HD failure).

YoHoJo

2012-03-04 01:38:39

Well then the answer is quite obvious is nothing is coming up in the TPA?
You're colors aren't resulting in anything being found.
Pick another color, or raise the tolerance and try again.
Also, use ACA to get the CTS2 color info, it's much more accurate!

EtherFreak

2012-03-04 01:46:19

Thats whats troubling, I chose the color, multiple times using the simba's "Pick a colour" and so a tolerence of 2 or 3 or even 5 should find the color, but it is not. I will look into using the ACA color finding, although I have never used it before.

I guess the problem at hand is that the findcolorsspiraltolerance is not finding the color with a tol of 4 or 5. tol of 6 or more results in finding everything around the window, which doesnt work.

YoHoJo

2012-03-04 01:53:23

That's a pretty low tolerance for main screen, colors change and differ A LOT on the mainscreen, and yeah watch my youtube video about it. Also check out my PMS script to get a bit of an example on how I do it. Lots of people use CTS2 info from ACA with TPA/ATPA and you will be able to find anything easily and awesomely, it's a super common and super accurate method!

Kyle Undefined

2012-03-04 02:07:00

Check out my Shilo Village script, it uses TPAs to find and identify everything :)

What I do to get a good color when using ACA is to login, grab colors, logout and back in, repeat a few times. Then, reload the client/change browsers and repeat the other steps. Delete duplicates, and you should have a color that hardly breaks :)

EtherFreak

2012-03-04 02:57:28

I understand colors change a lot, but what is making me mad, is that I pull the color (using color picker, and ACA) input the color, run, have a failure, check the color, see that it is still the same, and that it should have detected it…and ACA (with CTS set to 2) shows that it should have found it.

I am 100% sure that I have chose a valid color, and that it is not being found for some technical reason. I will sleep on it, and look at it further tomorrow.

Also, Thank you for your help! And I will be using ACA for color finding, as it is quite useful (but you knew that ;) )

UPDATE:
So I decided to use the actual client (I have been using SMART for a very long time, with no issues that I am aware of), and the colors that were not found in the smart client, were found without issue in the downloaded client. For some reason, the color 526344 is not being found in the smart window, but can be found in the RS Client window. the addy color of 7043947 worked fine in both windows. Still not sure the issue, but I will keep fooling around with it for now. At least I know I am not crazy, and that the colors I picked were correct…

Bam Bam

2012-03-05 03:44:42

From: EtherFreak
I understand colors change a lot, but what is making me mad, is that I pull the color (using color picker, and ACA) input the color, run, have a failure, check the color, see that it is still the same, and that it should have detected it…and ACA (with CTS set to 2) shows that it should have found it.

I am 100% sure that I have chose a valid color, and that it is not being found for some technical reason. I will sleep on it, and look at it further tomorrow.

Also, Thank you for your help! And I will be using ACA for color finding, as it is quite useful (but you knew that ;) )

UPDATE:
So I decided to use the actual client (I have been using SMART for a very long time, with no issues that I am aware of), and the colors that were not found in the smart client, were found without issue in the downloaded client. For some reason, the color 526344 is not being found in the smart window, but can be found in the RS Client window. the addy color of 7043947 worked fine in both windows. Still not sure the issue, but I will keep fooling around with it for now. At least I know I am not crazy, and that the colors I picked were correct…


There are many reasons why it may have worked once and not the second time. Colors also change significantly upon reloading the client. I highly recommend that you look into Color Tolerance Speed 2 which uses hue, saturation, and luminance values to compare colors. It is much more accurate and very easy to use (especially if you use auto color aid (ACA))