SRL Archive - SRL Archives

Find Obj Custom??


Naum

2008-04-15 08:08:41

The New FindObjCustom seems not to work for me:
I'm not sure but the new one (Rev 15) is:

{*******************************************************************************
function FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol: Integer): Boolean;
By: Starblaster100
Description: Finds Object with custom amount of colors and custom amount of Uptext
Example: FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5);
*******************************************************************************}

function FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tol: Integer): Boolean;
begin
Result := FindObjEx(cx, cy, Text, Color, Tol, MSCX, MSCY, 1.0, MSX1, MSY1, MSX2, MSY2);
end;

But this one works better:

{*******************************************************************************
function FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray;
Tolerance: Integer): Boolean;
By: Stupid3ooo and Starblaster100
Description: Finds Object with custom amount of colors and custom amount of Uptext
Use: FindObjCustom(x, y, ['att', 'ack'], [123456, 345678], 5)
*******************************************************************************}

Function FindObjCustom(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray; Tolerance: Integer): Boolean;
var
a, b, c, i, x1, y1, x2, y2: Integer;
Start: Boolean;
begin
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (FindColorSpiralTolerance(cx, cy, color[b], MSX1, MSY1, MSX2, MSY2, Tolerance)) then
begin
Start := True;
Break;
end;
end;
if(Start)then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if not(LoggedIn)then break;
a := a + 1;
if (a = 1) then
c := c + 1
else if (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
end else
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
end else
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
end else
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
end;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (FindColorTolerance(cx, cy, Color[b], x1, y1, x2, y2, tolerance)) then
begin
MMouse(cx, cy, 0, 0)
if (IsUpTextMultiCustom(Text)) then
begin
Result := True;
Exit;
end;
end;
end;
end;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
end;
end;

^^^N.B this one is from rev 14 :)^^^^

PriSoner

2008-04-15 08:38:06

The same applies to FindObj.. I just switched back to the old which worked fine for me and included in my script..

I seem to recall that this may have already been mentioned but not actioned.

Naum

2008-04-15 09:43:39

Ok i hope something can be done about it becuase I miss FindObjCustom :( very much!

Harry

2008-04-15 10:15:58

http://www.srl-forums.com/forum/findobjcustom-t31158.html :rolleyes:
Close please?

mastaraymond

2008-04-15 11:01:54

From: Hy71194
http://www.srl-forums.com/forum/findobjcustom-t31158.html :rolleyes:
Close please?


At least someone searches..