SRL Archive - Research & Development Lounge

FindObjTPA problem


mriddler

2012-02-02 13:55:30

I have having a problem with funtion, not sure what the problem is.

Function Ladder:Boolean;
var
x, y:Integer;

begin
if FindObjTPA(x, y, 3886429, 10, 10, 12, 12, 400, ('Climb')) then
begin
MoveMouse(x, y);
Wait(1000);
ClickMouse(x, y, 1);
end;
end;

I keep getting a type mismatch on the FindObjTPA line

Home

2012-02-02 14:04:23

From: mriddler
I have having a problem with funtion, not sure what the problem is.

Function Ladder:Boolean;
var
x, y:Integer;

begin
if FindObjTPA(x, y, 3886429, 10, 10, 12, 12, 400, ('Climb')) then
begin
MoveMouse(x, y);
Wait(1000);
ClickMouse(x, y, 1);
end;
end;

I keep getting a type mismatch on the FindObjTPA line



FindObjTPA(x, y, 3886429, 10, 10, 12, 12, 400, 'Climb') 


~Home

Inception

2012-02-02 14:04:51

Try this out.

Function Ladder:Boolean;
var
x, y:Integer;

begin
if FindObjTPA(x, y, 3886429, 10, 10, 12, 12, 400, ['limb']) then
begin
MoveMouse(x, y);
Wait(1000);
ClickMouse(x, y, 1);
end;
end;

NickMystre

2012-02-02 14:11:06

These are the arguments for the function FindObjTPA …

function FindObjTPA(var X, Y: Integer; Color, Tol, CTS, ObjWidth, ObjHeight, minCount: Integer; UpText: TStringArray): Boolean;

Here is your line of this code …

if FindObjTPA(x, y, 3886429, 10, 10, 12, 12, 400, ('Climb')) then   

Change ('Climb') to ['Climb'].

Also, just out of curiosity - you have CTS set to 10. I thought that the highest CTS could be was 3. Have I missed something perhaps?

Markus

2012-02-02 14:14:07

Nope, that's a bug. CTS 3 should do fine for this I think (I'm curious, as it sounds nice), default is CTS 1.

mriddler

2012-02-02 14:29:38

I give up, clicking a simpl ladder, out of all the things i have done in my script, seems to be out of my reach.

NickMystre

2012-02-02 14:37:21

Seriously, don't give up - just give your mind a breather. Look at some tutorials, or read the posts under iSPY - anything. Just change tack for a while - then go back to it later.

mriddler

2012-02-02 14:45:51

I found a easier way to put the ladder in one spot, but i can't find a responding color to move into that specific spot, but the only problem is making sure that color is off screen so it will click the ladder instead of continuously clicking that spot instead of the ladder.