SRL Archive - Help

Fundamental Problems


Quazz

2013-01-04 18:21:21

I'm having problems doing basic things like finding an ore rock based on colour and clicking it.

I'm using this code:

program FindColorExample;
{$i srl/srl.simba}

procedure ClickTree;
var
x, y : Integer;
begin
if FindObjCustom(x, y, ['hop', 'own'], [2840186, 2708084], 5) then
begin
Writeln('Found tree!');
Mouse(x, y, 0, 0, True);
end else
Writeln('Couldn''t find the tree.');
end;

begin
ClearDebug;
SetupSRL;
Clicktree;
end.

Write now, all it does is move the cursor around a bit, stopping on trees (maybe the colour thing is working), but only clicks at the end.

What do I do?

riwu

2013-01-04 18:33:39

Probably because the tree has similar colors so it has to loop through all the points with the colors and stops only when the uptext matches.

Using CTS 2 can improve the color accuracy, and using custom TPA/ATPA allows more flexibility and other checks (such as length) to be done, hence filtering more points with the incorrect obj.

Quazz

2013-01-04 19:28:46

From: riwu
Probably because the tree has similar colors so it has to loop through all the points with the colors and stops only when the uptext matches.


I want it to click the first one it finds, but it doesn't.

From: riwu
Using CTS 2 can improve the color accuracy, and using custom TPA/ATPA allows more flexibility and other checks (such as length) to be done, hence filtering more points with the incorrect obj.


If I understand you correctly, these are different methods for object finding based on color?
Where can I find more info on these? I tried a quick search but didn't find anything.

riwu

2013-01-04 20:25:06

From: Quazz
I want it to click the first one it finds, but it doesn't.



If I understand you correctly, these are different methods for object finding based on color?
Where can I find more info on these? I tried a quick search but didn't find anything.

Probably because the first one's uptext doesn't match?

Check out some TPA tutorials
http://villavu.com/forum/forumdisplay.php?f=97