I need help with making good procedure that finds the middle of nearest rock
![]()
While finding colors with FindColorsTolerance/Spiral you can put MSCX and MSCY at the start(TPA's). FindObjCustom and FindObjTPA Searchs for the nearest color too.
Yes they find the nearest one...FindColors... try this:
SCAR Code:function FindObjMid(var x,y : integer, Color, Tol, ObjWidth, ObjH : Integer; UpText : String): boolean;
var
TPA : TPointArray;
TPAA : T2DPointArray;
i,TTime : integer;
begin
MarkTime(TTime);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, Tol);
if length(TPA) > 0 then
begin
TPAA := TPAtoATPAEx(TPA, ObjWidth, ObjH);
Writeln('Finding obj took: '+inttostr(TimeFromMark(TTime)));
for i:=0 to high(TPAA) do
begin
MiddleTPAEx(TPAA[i], x, y);
MMouse(x, y, 3, 3);
wait(50+random(50))
if isuptext(UpText) then
begin
GetMousePos(x, y);
Result := True;
Exit;
end else Continue;
end;
end else
Result := False;
end;
Ok I will try that findobjmid. I think it could work becouse you toke off the colortolerancespeed
EDIT1:P.S. I remember that someone relased script that reads image and tells what color and tolerance you should use. Does anyone know where I could get it?
EDIT2:It worked perfectly. Tytytyty.![]()
I will credit you if it's ok?
The colouring aid you were talking about up there...
http://www.villavu.com/forum/showthread.php?t=26944
[QUOTE]<GoF`> oh no its Raymooond
<Raymooond> Heya
<GoF`> is it ray or some other ray?
<LeeLokHin> No idea
<LeeLokHin> Raymond, what's the game you like the most?
<Raymooond> Runescape
<-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]
There are currently 1 users browsing this thread. (0 members and 1 guests)