SRL Archive - Reflection Help

Some issues with object finding


Floor66

2009-01-05 06:46:33

I'm trying to open a deposit box, I.D: 814.
Now, when I do FindObject, it just clicks under my character :s

If FindObject(BBox, 814) Then
Begin
BBox := TileToMS(BBox, 2);
MMouse(BBox.x, BBox.y, 0, 0);
If IsUpText('eposit') Then
Begin
Mouse(BBox.x, BBox.y, 0, 0, True);
Randoms;
FFlag(0);
Wait(550+Random(500));
If BankScreenEx Then Exit;
T := 0;
MarkTime(T);
While Not BankScreenEx Do
Begin
Wait(100);
If TimeFromMark(T) > 15000 Then
Begin
Write('Max banking time.');
Randoms;
User[CP].Loc := 'BankDone';
Break;
Exit;
End;
End;
End;
End;

I'm clueless, other objects or NPC's finding work perfectly.
Any ideas?

Lee Lok Hin

2009-01-05 07:47:41

Since deposit boxes don't move, what's the point of a FindObject?

You can just use a If TileOnMS then

And then adjust the height parameter for the deposit box. I couldn't really see anything wrong with your code, maybe you clicked after that even if it didn't find the object?

Floor66

2009-01-05 07:48:49

I've tried just saving the coords for the box and do TileToMS, but that doesn't seem to work either o.O
I'll try it again soon.

n3ss3s

2009-01-05 07:50:08

Anyone check my thread in Reflection Discussion?

(Answers are there most likely)

benjaa

2009-01-05 08:59:50

i manage to utilize inanimate deposit boxes in my jug buyer

http://www.villavu.com/forum/showthread.php?t=40271?p=522899

theyre all pure ref coords, check it out

Floor66

2009-01-05 12:11:25

@benjaa
These deposit boxes are different, standing on these tables.
I'm talking about the kind of round pillar-ish things.

NCDS

2009-01-05 12:22:20

Why not just use color then? If you used a TPA im sure it would work as I have done it before :p

Floor66

2009-01-05 12:51:44

I suck at TPA's.. I know how to like do FindColorsSpiralTolerance but then =S
How to find the right one!

mormonman

2009-01-05 16:35:48

isuptext… ever heard of it?

Floor66

2009-01-06 09:59:53

Yeah but won't it still move the mouse to all found colours and check for the uptext then, just like FindObjCustom?

Shady?

2009-01-06 13:31:56

This is my function i made to click objects a long time ago, give it a try:
function ClickObject(id :integer;left:boolean): boolean;
var
xx : TPoint;
begin
if FindObject(xX,id) then
begin
XX:= TileToMS(XX, 0);
Mouse(xX.x,xX.y,2,2,left);
Result:= True;
end;
end;

noidea

2009-01-06 13:41:26

From: Shady?
This is my function i made to click objects a long time ago, give it a try:
function ClickObject(id :integer;left:boolean): boolean;
var
xx : TPoint;
begin
if FindObject(xX,id) then
begin
XX:= TileToMS(XX, 0);
Mouse(xX.x,xX.y,2,2,left);
Result:= True;
end;
end;


You should acctually put an uptext check, for saftey.
function ClickObject(id: integer; s: String; left: boolean): boolean;
var
xx : TPoint;
begin
if FindObject(xX,id) then
begin
XX:= TileToMS(XX, 0);
Mmouse(xX.x,xX.y, 6, ,6, left);
wait(70 + random(70));
if isuptext(s) then
begin
Result:= True;
getmousepos(xx.x, xx.y);
mouse(xx.x, xx.y, 0, 0, true);
exit;
end;
Writeln('Error! Wrong UpText!');
exit;
end;
Writeln('Error! Could not find Object!');
end;

Floor66

2009-01-06 13:43:18

Meh that takes only more time, and if you're sure that it's the correct object (for example, the exact coords of a bank booth), you don't need an extra check.

noidea

2009-01-06 13:49:48

From: Floor66
Meh that takes only more time, and if you're sure that it's the correct object (for example, the exact coords of a bank booth), you don't need an extra check.


What if your camera is not in the right angle and theres a tree in the way or something?

Floor66

2009-01-06 14:23:59

I almost always have north+highest angle..

benjaa

2009-01-07 03:38:46

I almost always have north+highest angle..


blind ref coords ftw
doesnt matter which dbox it is, it will always be ion the same position